The original dataset is ver large(~39G), so I have already converted into .Rds format (~5.5G). However, when I tried to read the .Rds file into R all at once with df=readRDS('/tier2/lab/merge.Rds'), I got the error:
Error in readRDS("/tier2/lab/merge.Rds") :
error reading from connection
How should I deal with the error?
Where should I put the loaded data df? In the server.R, ui.R or in a new .R?
It's usual to read in common data files in the global section of the app, outside of ui and server (in a single file app the global section is the code before the ui definition, or it could be in a separate global.R file). Then it only occurs once and will be available to all users of the app.
I'm not sure how shiny handles files in subdirectories, have you tried putting the file directly in the main project directory?
Your file is still quite big, you might be able to reduce the size further by recoding, filtering, etc.
Actually, I am running the R studio on cluster instead of locally. It seems to take forever time when I tried to upload the file into the main project directory...
For the file size, I think it may because I have a large amount of rows with 7 columns...The file is already processed but I will still have a look at the link you sent.
You will be limited by network speed, you might be interested to detect your upload speed, and then estimate a transfer time, perhaps with internet speed test - Google Search
and then like 5.5gigabyes at 1megabits/s - Wolfram|Alpha
if I had to upload such a file at my 1megaBITS per second upload rate it would take me over 12hours