I'm trying to figure a way to automatically open the pdf-output of an R script after i run it. My goal is to integrate that into Sublime Text (under osx) to make something like an automatic viewer for my generated plots.
Any idea is welcome (obviously if there exists a plugin that already acts as a viewer for R, much better)
Related
I've encountered a very bizarre problem with my R scripts. I had a bunch saved in a folder, and after reinstalling R (which was itself having some issues), the rather large scripts I had can easily open in R, but appear to have no text on them (this is despite it clearly labeled as an R document in the folder and being 26kb). Yet when I upload my scripts in a message on Slack, it appears perfectly fine.
Here is what my R script looks like presently:
And this is what it should look like:
I'm thinking it has something to do with the way R is reading the text in the script, but I couldn't find any answers online that were helpful. I would greatly appreciate any advice, as I dont' want to have to recreate all of these using Slack of all things...
I figured it out with some tinkering and it was a rather simple fix that mirrored what I thought the issue was. Apparently my RStudio program was set to read the text in CP936 format. I set it to system default:
And viola! My text is now back!
Not sure this is the right place for this kind of question, but I am looking for ideas on how to share some R Markdown Notebooks with non-R users, but that still have some dynamic functionality in them. For example, I can create a notebook with html-widgets to adjust time windows, choose different data points, etc. I compile this in R Studio and it looks great on my machine. But sharing the .nb.html file with co-workers, they don't get the same level of interactivity, which is expected.
Is there a way to share these files or similar R files with non-R users? Additionally, I don't have access to a personal/company website where I could host these notebooks.
you could for example use :
DT package to give your Rmd output filter- able html data frames .
you can also use plotly() to have interactiv plots [easy to do for ggplot2 users using ggplotly() ]
further check out :
flexdashboards https://rmarkdown.rstudio.com/flexdashboard/
sematic dashboards. https://cran.r-project.org/web/packages/semantic.dashboard/semantic.dashboard.pdf
both are solutions for more dynamic Rmarkdown reports, but not as demanding to programm as full blown shiny apps.
Is there any way out here?
Evince is the standard PDF viewer of Ubuntu. The immensely popular platform for statistics, R, started its life as a Linux package. But when I do a plot in R -- vanilla, no frills, no user options -- and save it to PDF, I can never see axis labels, titles etc. In evince, even though they appear in every possible viewer (Acrobat, Foxreader, Sumatra, qpdfview) on any OS. I have included qpdfview as default in memeapps.list, but when I double-click a PDF file, I get evince. Is there any help except uninstall evince (which I don't want to do as it helps with other file formats).
I have produced a plot using the ggvis package in R. The plot is interactive which can be changed by moving around the slider. However when I save it, it is just a picture of current status without sliders.
I have seen people posting these interactive plots on the website, so I think there should be a way to save it first. How can I do this?
From the Rstudio page for ggvis:
Note: If you’re viewing the HTML version of this document generated with knitr, the examples will have their interactive features disabled. You’ll need to run the code in R to see and use the interactive controls.
From this and the whole page I gather that sharing the interactive graphics can be done using Shiny Apps and/or R Markdown documents. To deploy either of those to people who do not have R installed you need to a) use Shiny Apps IO; or b) install Shiny Server, which has a free version with very basic administration capabilities, and a paid version for confidential information in corporate environment (which I'm only mentioning in case you are not allowed to share your data).
Either way, read through the Shiny Tutorial, the
R Markdown Tutorial, and the combination.
I am having some problems with my clipboard contents when using R. When I run my scripts/commands in tinn-r, very often I would get something that I had ran earlier pasted onto my R Console instead of the command that I have just selected.
To get over this, I would go to my clipboard and delete its content(text/syntax). However, the same text/syntax that I had just deleted would re-appear on my clipboard and would again appear on my R Console when trying to run a different syntax from my tinn-r.
Good luck. Tinn-R seems to be a particularly buggy way of interacting with R. Though it takes some effort to set up, the StatET plugin interface from Eclipse has been working way better for me than Tinn-R ever did.