Updating a CSV file once uploaded to private Shiny Server - r

Question is targeted at users experienced with shiny local server usage
My Shiny app uses a large csv file to read all its data from to prevent it from running a SQL command to get the same data everytime.
My question is once I have the app and all related files uploaded to my local shiny app server. Will I be able to locally write out from R to the csv file on my server (updating it with fresh data). Without having to re upload the shiny server app with the new data files?
Apologies if this isn't in everyone's most preferred way to ask questions around here but its just a simple question to find out if it can be done.

Related

Unsure where image_write downloads to in shinyapps.io

I'm attempting to make a public shinyapps.io website, and I'm trying to use image_write to create a file into a local directory.
The following code works on my local R studio code:
image_write(im.resized, path = paste0(output_file_directory, file_name), format = "jpg")
When I run the code on the shinyapps.io website, the code runs without error, but I'm not sure where it downloads the file to. I know that the output_file_directory part isn't the issue, so I'm a little lost. Any help would be much appreciated!
On shinyapps.io it is not possibly to store permanently data, due to:
"Shinyapps.io is a popular server for hosting Shiny apps. It is designed to distribute your Shiny app across different servers, which means that if a file is saved during one session on some server, then loading the app again later will probably direct you to a different server where the previously saved file doesn’t exist."
See here:
https://shiny.rstudio.com/articles/persistent-data-storage.html

Programatically transfer file to R Shiny application

I have the following situation/workflow:
The user utilizes Tool A to capture sensor data and save it to a CSV file.
The user takes the CSV and uploads it to a R Shiny Applications (using fileInput) to process it further.
I would like to get rid of the intermediate CSV and directly open the Shiny application with the data already loaded. I.e. I need a way to transfer the contents of the CSV automatically to the Shiny application.
What could work:
Tool A stores the CSV in a special location that is served by a HTTP server on a fixed endpoint.
The Shiny application requests the file from the known location on startup.
However, this still needs the intermediate CSV file, and adds complexity by introducing an additional server (or at least endpoint). Furthermore it needs additional logic if multiple users are active / multiple files are created at the same time. So it is far from ideal.
Is there any way to get the contents of the CSV directly from Tool A to the Shiny Application? E.g. by mimicking the messages the 'fileInput' widget produces?

To save data generated in a R shiny app in a .csv file in Amazon S3 bucket

I have a working R shiny app which is being hosted from our internal org Amazon AWS server. Now, Users will generate data on that Shiny app using different widgets provided there. Now, I need to save all the data generated in one session into a file that is stored in our internal Amazon S3 bucket.
The possible challenge that we are facing is how to save these data when multiple users could generate data using that Shiny App and then need to be saved and reloaded back to the Shiny app further if needed.
We just can't lose any data even if two users simultaneously add data using the Shiny App.
Please guide what could be our best approach.
I did follow the guideline provided here :
https://deanattali.com/blog/shiny-persistent-data-storage/
But, is there a way where we don't need to create as many .csv files as we have a number of users accessing the app.

Shiny putting app into production

I have created my first Shiny app and i want to share it with people.
I have a folder which contains my ui.R file and my Server.R file.
I have managed to get a server for it and install Shiny Server and it runs pretty well. In fact I have written the shiny app in the web browser.
My question is where do I save the scripts on the shiny server so that I can send the link to people and it will just load up as a website (assuming they have credentials?
Thank you for your time.
I found another question similiar to the one i was looking for.
Hosting LAN Shiny apps run from command line
This answers the question by specifiying that i should move my test scripts into production by saving them /srv/shiny-server/myApp
Which server do you use? Perhaps AWS (Amazon)? Then you can upload it in one of the folders on your server. In the case of Amazon, you do it through S3 Browser.
You can use a domain name to redirect you to the specific folder where you keep your shiny apps. Each shiny app should have its own sub-directory where you keep server and ui scripts. Then you load your shiny name like this:
yourdomain.com/sub_directory_where_shiny_script_are_located
Don't forget to adjust your directories in the script, so that when you load any data, it loads the data located on ubuntu server, for example.
if(Sys.info()[['user']] %in% c("ubuntu","shiny") ) {
load("/a2cka/ShinyApps/sub_directory_shin_app_/data.csv}

Deploy Shiny app that can read files from local computer (no possible Data-based solution)

I am trying to deploy a Shiny app on shinyapps, but it is not possible to read and write local files from the computer of the user. The idea is that every user can upload some datasets and images given a local path where this input is stored, not to have a same series of inputs for everyone stored in a ´Data´ folder.
I know there are other options to deploy shiny apps (amazon, shiny server), but I am afraid I will find the same kind of problems. Before losing too much time trying other approaches, I would like to know if there is any way to deploy a shiny app that can read these inputs given a local path and, if not, if there is an easy way to prepare an online app that can do this trasnlating from a shiny-based one. If not, I guess I will have to leave my app as a normal R package.
Thank you in advance.

Resources