I am new to Shiny Notebooks in R. I'm just tinkering around trying to learn. I am trying to get a ggplot to look right in the HTML document output, but I cannot get the scaling correct. If I run the same ggplot in the Shiny notebook without using input variables it looks the way I would expect. Why does this happen?
The follow code produces an output that is unusable:
```{r selectInput for iris database}
selectInput("x_axis", "X-Axis",
choices = names(iris))
selectInput(inputId = "y_axis", label = "Y-Axis",
choices = names(iris))
renderPlot({
ggplot(iris, aes(input$x_axis, input$y_axis, colour = Species)) +
geom_point()
})
The following code works correctly:
##GGPLOT Example
```{r}
ggplot(iris, aes(Petal.Length, Sepal.Length, colour = Species)) +
xlim(0,10) +
ylim(0,10) +
geom_point()
```