Relative Content

Tag Archive for rggplot2shiny

Shiny: Error in <-: replacement has length zero when using wrapping X Axis Label

I am trying to create a Shiny dashboard where the user can select a county based on a dropdown. My X axis values are long strings and I want to wrap it so that it renders properly. When I don’t use scale_x_discrete(labels = wrap_format(10)) it renders the dashboard without any errors. When I do use scale_x_discrete(labels = wrap_format(10)) it opens the dashboard with the following message:

How to have Shiny app render multiple plots

I’m building a small shiny app to demo some causal inference concepts and I want to split all the independent variables from a linear regression formula and show them in multiple plots.

Why is my Shiny app not generating a plot?

I am attempting to generate a plot using variables in my server code that can be changed- I’m not sure if I am formatting this wrong and that is why a plot is not generating. My goal is to generate a line plot depending on a change in the ‘mean sojourn time’ and ‘screen sensitivity’ (these are my input widgets)- a change in this variable impact the values of x and y in my line plot. I want to be able to visualize how changing these variables will change the line plot.

How to dynamically adjust plot widths to roughly match the width of data table rendered underneath?

In running the R Shiny code extract shown at the bottom of this post, I am trying to make the width of the 2 horizontally-rendered and jointly-rendered plots to roughly match the width of the data table that is rendered beneath the plots, and I am trying to make the height of the plots roughly equal their individual widths so they appear squarish. I have tried making the size of the plots dynamic as the width of the data table (in the full code this example is extracted from) changes. Is there a way to do this in R Shiny?