reference not working on shiny server but working locally

Hi everyone,

Me and my team are trying to build a web application on shiny and hosting it in a shiny server. After we have our application to the stage we want it to be, we saved the code and then push it into a ec2 AWS instance to be ran in a shiny server. The application works like a charm on Rstudio Cloud and Rstudio in my local machine and my teammate's local machine, but it does not work as intended in the server. We have the function:
unique(dataFrame$ColName) in order to get a vector with the unique values in that column but instead of this we get back a vector with only numbers instead of the actual string values.

For example: if I got the values in the column such as: ["apple", "pear", "apple", "pineapple"] I will get [1,2,3].
If I take away the unique() function and just leave dataFrame$ColName I would get [1,2,1,3].

This is just a really odd bug and we haven't found a fix for it. Thank you for any help you can give us, I will be super appreciated.

My guess is that one environment returns True and the other False for


This is probably due to different versions of R being run.

Hi Nirgrahamuk,

In both versions of R the function getOption("stringsAsFactors") was returning False therefore this wasn't the problem but it shed light into our problem. the function read.csv() was reading character columns as factor columns. After changing this our problem went away.

Thank you for your help!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.