rmarkdown interactive time selector - r

I often create chart reports on rstudio, knit it with rmarkdown and upload it to a private hosting account so I can share the document to be viewedas a webpage on a browser .
However those reports are static, therefore the viewer cannot, for example, select a time period he or she wishes to apply to the chart.
I wonder what would be the best solution, to add an interactive time selector to this rmarkdown document and make it work online.
I would really appreciate any advise for a quick and simple solution to this cenario.
Thanks

Related

Interactive Document (takes input gives output) in Rpubs

Is it possible to publish an RMarkdown file to Rpubs that takes input and gives out put from the Rpubs site? I want to create a simple calculator related to my job that takes a few inputs and gives an output and, if possible, publish to Rpubs for people to view and use.
SHINY: I know this is what shiny is for, creating interactive apps, but I dont know it very well or how to implement an app I create for multiple people to use, or how to imbed the link to the app, and so on. Just trying to see if this is possible in things I already know how to use
RPubs is for HTML documents that don't require R calculations on the backend. In some instances, there can be some degree of interactivity e.g., brushing and linking plots, filtering data and having the filter propagate to a plot. These happen through the crosstalk package. However, it sounds like you need a shiny app that can take inputs and have R do some calculation of those on the back end. You could host your app on shinyapps.io
It's also possible, depending on how complicated the calculations are, that the entire app could be written in native javascript, which wouldn't require a server-side computation, so could be hosted on any website.

Best way to collaborate with manager on R Markdown reports?

I'm producing plenty of analyses in R and utilizing the .html Markdown format to present and communicate work. Often, my manager will need to correct/add to the text which accompanies the code blocks, and has practically no interaction with the code blocks. The analyses are typically produced by myself alone, so code collaboration is a low priority.
In an ideal world, he could open up the .html and edit the text in a browser, which I understand is not possible.
Are there any simple solutions for this? I am sure this is a common problem so there must be an easy solution I am overlooking. Here are the current solutions being considered:
Use Git (but my manager wouldn't like to learn Git)
Use Jupyter Notebooks (but I would prefer to stick with R Markdown for integration with RStudio and for the reproducible templates)
Knit the Markdown as a word document with manual version control on a shared network, allow tracking of changes in the word document, and copy-and-paste over changes made to the .Rmd file
The latter is least elegant but most likely to be used at the moment. If you have any suggestions, please let me know!
Here's a solution that is tailor-made your exact situation.
Use jupytext for bi-directional lossless interoperability between jupyter notebooks and R Markdown documents!
Maybe redoc is an option for you. Haven't tried it myself and it's still experimental but it would allow you to collaborate via Word. Basically the Word document can be edited and passed back to RMarkdown with all changes. See here.
I suggest you try trackdown https://claudiozandonella.github.io/trackdown/
trackdown offers a simple answer to collaborative writing and editing of R Markdown (or Sweave) documents. Using trackdown, the local .Rmd (or .Rnw) file is uploaded as plain-text in Google Drive where, thanks to the easily readable Markdown (or LaTeX) syntax and the well-known online interface offered by Google Docs, collaborators can easily contribute to the writing and editing of the narrative part of the document. After integrating all authors’ contributions, the final document can be downloaded and rendered locally.
Moreover, you can hide code chunks setting hide_code = TRUE (they will be automatically restored when downloaded). This prevents collaborators from inadvertently making changes to the code that might corrupt the file and it allows collaborators to focus only on the narrative text ignoring code jargon.
You can also upload the actual Output (i.e., the resulting complied document) in Google Drive together with the .Rmd (or .Rnw) document. This helps collaborators to evaluate the overall layout, figures and tables and it allows them to use comments on the pdf to propose and discuss suggestions.

Can automated PDF reports based on template be made in Plotly Dash or R Shiny?

I work for a company that runs market research surveys for clients. Hundreds of different clients participate in each survey, so they do not all get an individual report. Instead, we have a report template in PowerPoint which is the same for all clients, and then we use a program called E-Tabs Enterprise to populate the template for each client with that client's own survey results.
These reports are typically about 100 slides long, and contain a mixture of static text and images, which are the same for all clients, and survey results, which vary between different clients. The reports are sent as a PowerPoint or as a PDF to clients via an FTP.
To increase efficiency, I want to switch either to Python Plotly Dash or RStudio Shiny to create static PDF reports (although I will also be interested in making dashboards in the future). I am trying to see which, if either of these, has the capabilities I need. I am already competent at Python Pandas.
It is clear from the Shiny website (link here: https://shiny.rstudio.com/articles/) that Shiny can make a report and export it as a static PDF. However, I have two questions:
Can the open-source version of Plotly Dash also be used to create a report and export it as a PDF?
Is it possible, within (open-source) Shiny or Dash, for the code to loop through the data for the different clients and export each as a separate PDF?
If this is not possible, could you please tell me what the limitations are and whether it is possible in the paid versions of the two programs?
Please let me know if my question is in any way unclear. I would also be open to recommendations for other software if there is something out there more suitable for what I need. Thank you for your help in advance.
Kind regards
Thank you for your answers. I can see that RMarkdown has the capabilities I need. It seems that there is no good equivalent of RMarkdown in Python at present, unfortunately, so RMarkdown is the right tool to use.

Using readline(prompt = "") in rMarkdown

I'm currently attempting to automate some statistical report generation, however to do so I would like to collect a couple of piece of information from the user before beginning, then create a markdown report from it.
When knitting the document however it hangs forever because it has no route to receive the user input from. Does anyone know of one, or would it be a case of using a separate r script to gather the information then using calling the report generation from within that using rmarkdown::render?
You could embed a Shiny app or make use of parameterized reports in the Rmarkdown document. Without further detail (eg some code), it is hard to tell you more.
I hope that this helps, though.

Is there a way for RPubs to automatically re-run the markdown document every time the page is loaded?

I currently have a markdown document which scrapes data from a website and outputs a table using that data. I published the HTML to RPubs using the knit function on Markdown. I'm wondering if there is a way for the table to be updated automatically on RPubs without having to go into R and knitting and publishing the document every day. The data from the website changes every day, so the table changes every day as well.
Thank you!
No, RPubs just takes the static HTML file.
What you want is reactive markdown (using shiny) which you can also host for free. (Though unless you run your own server behind a firewall or pay it will be public)
Here is the tutorial: http://rmarkdown.rstudio.com/authoring_shiny.html
In your case, since you don't actually want it to be reactive, just rerun, I don't think you are going to have to change much of your code.

Resources