I have opencpu (single server) up and functioning. My first function will open a dataset from a csv file stored on my hard drive.
Where should I deploy the csv file? (I tried my apps www directory, but it doesn't work)
In sum: within an opencpu app, where do I deploy a file so that this line of code will work?
indf <- read.csv(".\\nouns-categorical_R1.csv")
The answer is simple to find.
add print(getwd()) to your opencpu function script. First call the function using POST The working directory can then be retrieved by calling a GET request for the url ending in "console"
The answer is that the working directory is a temp directory: .....AppData/Local/Temp/Rtmp0qr704/ocpu_session_3780fc520c8"
This means you cannot store csvs in the working directory. This working directory changes every time you start opencpu.
It is possible to use full path to the csv when calling read.csv(). However, you need to watch for security issues and file privileges once deployed on Ubuntu.