Using and displaying data using shiny - r

I have a .mat file that contains certain data. How would I insert that data and be able to display it using Shiny?

Use the R.matlab package and the readMat() function to get the file into R, after that, you can build a shiny app from scratch the way you normally would.

Related

Export data to different excel sheets in R shiny app

I'm wondering which package can be used in a Shiny App to export data to excel file.
I know I can use xlsx, but it requires RJava and I fear that other users can't install it.
you can easily export data to Excel using a download button and base R. Then your file would be a csv-file, which can be easily opened in Excel. An example could be:
https://shiny.rstudio.com/articles/download.html
Would a csv-File be sufficient or do you absolutely need an xlsx-file?

How can I get a user input from Excel in R dynamically?

I'm using Excel to call a script in R.
R eventually generates a graph, on the basis of which I want the user to be able to see and give an input.
Is there any way to get an input into R from Excel during runtime?
Thanks
So I found a solution.
I ran a shell script that called a vbs that invoked a different workbook that ran a vba code that called the original workbook I wanted to work with while R checked the contents of the new workbook until they were changed(which is when the input box was filled in the original workbook).

Web application which runs R

I have written my R script with some functions to do some calculations. On the output of my calculations, I have created plots in shiny(4 tab panels in that as of now, which is using the data specified in my global.R). Now I am trying to automate the process and deliver it to non technical users. So something like, users feed in 2 csv files in web UI and click a button in the web UI, which will then call my r scripts to do the calculations, then my server.R script should build plots on the output of it. Any similar examples? I tried different links, but nothing seems to be relevant.
If I add my R script using source(**.R) and use the functions mentioned in there. Or Do I still have to save output in data folder and specify something in global.R or just use the output of the function in my plot construction?
If I have the fileInput option in first tab in my tabpanels, how can I make stop the user from viewing the other tabs(tabs with graphs) without loading the input csv files and clicking the "Go" button?
Can I do this whole thing in Shiny ? Or better to go for rook or some other framework which calls my r script just for calculations?

R: Scheduling code in a webpage

I'm trying to build a webpage displaying a few graphs. I want to use R to build the graphs, and I want these graphs to automatically update themselves periodically. For example, a webpage showing a graph of the stock price of a particular company over time, which refreshes every day with new data.
what is the best way to approach this? Using Rook to run the R-scripts? can I use it along Markdown, for example, to make the html webpage? Or do you suggest something else?
You can make your plots in a R file and write your webpage in markdown in which you call your R objects and plots. Alternatively you can also run the R code directly in the markdown file. With the knit2html function of the knitr package you can create the html page with the desired output. You can find basic examples on the knitr webpage.
You can schedule these file(s) on your own computer or on a server to update the data of the html output every day. If you have a machine that runs on Windows you can use the Windows Task Manager to run the batch file.
EDIT:
Here you can find a worked out example.

automatic graph generation in xlsx

I wrote a script in R to do some analysis and make the result as a set of table in xlsx format.
However, I would like to have some automatically generated default graphics from these tables in another sheet.
one way is using
addPicture(file, sheet, scale=1, startRow=1, startColumn=1)
from the xlsx package. meaning generating this plots using R and saving them separating and inserting them in to the excel file.
I wonder, if there is any easier way, using excel functionality. For example if there is any formula for generating these plots to do so ?
Basically, I wonder, if there is any automatic scripting way to generate these graphs ? is there any way, like a formula to do such a thing ?

Resources