R Leaflet loading lat/long from csv - r

I can make a R-Leaflet map in RStudio and export to html.
Here's the senario, a client has limited web infrastructure, basic webhosting: no database, no shiny server, no r-server etc.
They want an online map on their website which can be updated (by them), so how can I link the html so it looks up the coordinate from a file rather than being hard coded in the script (e.g. through src="lat-long.csv"). Alternatively could a shape file be accessed (using the SP library)? Or even a Geojson file.

Related

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?

Download excel file from an ArcGIS rest endpoint using R

I'm trying to download the excel file stored at https://www.arcgis.com/sharing/rest/content/items/b5e7488e117749c19881cce45db13f7e/data (website: https://www.folkhalsomyndigheten.se/smittskydd-beredskap/utbrott/aktuella-utbrott/covid-19/bekraftade-fall-i-sverige) with COVID-19 data on Sweden. The data is freely available and is stored on an ArcGIS infrastructure.
I tried with download.file() but the what is produced is not the excel but some unreadable file whose actual format is not clear to me.
I tried to investigate the ArcGis Rest API but I couldn't find a simple solution.
Do you have any guidance on how to do this with R or with a general CURL/WGET based infrastructure?

How can I publish an R Markdown Shiny Dashboard privately?

So for context, I have created a dashboard using Rstudio by using flexfdashboard. I is an R Markdown Shiny app with ui and source code all within the same file.
Data sources for this app are large, locally saved documents in. Txt and. Csv format, with sizes ranging from a few kilobytes to several gigabytes.
I am to present this work to my CEO but I will not have access to my current computer and so ideally would host my dashboard somewhere and simply load the dashboard in browser.
However, the datasets contain sensative customer information and so privacy or controlled access to all assets is essential, ruling out most 3rd party solutions.
Is there a simple method to achieve this that im missing, or will I have to just run it from a local machine?
Thanks

How to convert an interactive R shiny apps webpage/output tool into a file that can be saved and shared on a desktop/network

I'm trying to keep this tool internal and a shiny apps webpage may not be private enough to display the tool. I have created a tool for my company that is meant to be private and internal. The data is very confidential, and the tool displays the data in an interactive way, allowing the user to analyze it through visualizations. I coded in R, and the output is an interactive R shiny apps tool, that becomes a shiny apps webpage. I'm looking for a way to make this tool an internal file that can be saved on a desktop and shared across a network instead of having it as a webpage with a not-as-private link. Someone mentioned to me that a .exe file could be possible. I'd appreciate any suggestions of how I should go about converting this interactive R shiny apps output into a file.
shinyApp(ui, server)

Upload and store data to shiny

I am working on a RStudio shiny app that reads in a geojson file then creates a map using leaflet.
I take my geojson file, and put it in my /data folder prior to publishing.
Overall, everything works great. I am consistently changing some polygons in my geojson file, so I overwrite the old file and load the new all within the shiny app using an actionButton.
Things work great on my local machine but when I publish the app and use it on the web, my map file doesn't overwrite.
Is there a permissions issue within RStudio shiny?
I have also looked into using Google drive or dropbox to load then rewrite the file and have not had any luck.

Resources