I am working on a shiny app that is supposed to enable the user to load data from an excel file and to create some graphs based on this data. To do this I use read.xlsx and ggplot. The user can select the x variable input$x and y variable input$y from a list. This list is created based on the column names of the data set. Based on the input a graph is created:
ggplot() + geom_point(data=mydata, aes_string(x=input$x, y=input$y)
However, when some of the columns of my example dataset are chosen, I get an error. For instance, when i select the y variable to be equal to the AB (m/s), I get the following error:
Error: could not find function "AB"
The ggplot somehow does not recognize the special characters and only takes the first part of the column name. Is there a way to solve this?
_) you can try with`.`x`may work.