Icons for R files not showing on Mac after latest update - r

Rproject:
R markdown file:
The icons for my R projects and R markdown are not appearing on my Mac. Any help?
Tried changing the view options in the system preferences but at no avail.

Related

How can I open an R Markdown file from GitHub in Google Colab?

I´d like to create links for R markdown files (.Rmd) in a GitHub repo so that these directly open in Google Colab.
I can do this with Python Jupyter notebooks. However, I haven't found any way to achieve the same with R Markdown files.
How can I do this?
Thanks for any help or pointer in the right direction.
PS: One of the few hints I found online mentions this link format, which unfortunately doesn't work:
https://colab.research.google.com/github/<GITHUB ACCOUNT NAME>/<REPO NAME>/blob/master/example.Rmd
Colab yields this error message:
Notebook loading error
The file has been corrupted or is not a valid notebook file.
However, the notebooks that I tested work properly on any other platform, e.g. RStudio etc.

How do I stop R Studio and knitr from associating my .Rmd PowerPoint with an app other then MS PowerPoint

I am making my first rmarkdown for PowerPoint. I started a new .Rmd file from RStudio. I saved it to my working directory. When knitting it creates the .pptx file (I've confirmed the file is in the wd and it will open), but after rendering it tries to open another app (called thebrain, it is mind mapping software), not PowerPoint to open it. I've looked in Finder, using "Get Info" and verified that PowerPoint is the app associated with .pptx files, so it should not be a MacOS issue. I assume this is an RStudio, rmarkdown or knitr issue. I've searched using Google an on stackoverflow but cannot find anyone else dealing with this.
I've looked at the RStudio PowerPoint Trouble Shooting page, but it does not address.
I do not have reproducible code, but it is basically:
Open New .Rmd from RStudio, using .PowerPoint as the selection. Save the default file without changing anything. knit to PowerPoint.
The error message is: The document ed_wic_2020_presentatin.pptx could not be opened. TheBrain cannot open files in the "Office Open XML presentation: format.
I'm running R Studio Version 1.2.1335, R version 3.6.0 (2019-04-26) -- "Planting of a Tree", the latest and greatest version of PowerPoint for MacOs and MacOS Catalina 10.15.r
Any help is appreciated.

RStudio not showing code in Rmd file, while Notepad does

I'm currently running into an issue of a .Rmd file opening in RStudio without actually populating the Source pane with the code. The file was written in RStudio, and the code shows up when I open the file in Notepad (and copies with the right formatting), but there's nothing showing up inside of RStudio.
Has anyone run into this issue before or have a good fix?
I had this same challenge too. I had to install Rstudio directly from CRAN and it works now, this issue probably happens with R studio installed via Anaconda.

knitr doesn't print plots in latex document [duplicate]

i have a knitr based Rnw file that is compiling to pdf perfectly fine in RStudio on mac (v0.97.316) and knitr (v1.1) but in a windows enviornment (same versions) i get a compilation error. I've checked the options in RStudio in both environments and they are consistent.
It appears that the windows setup is always injecting: "\SweaveOpts{concordance=TRUE}" into the ".tex" file even though i have no such flag in the Rnw file, and/or if i toggle the settings in the preferences, and/or if i add the "opts_knit$set(concordance=FALSE)" options to a knitr settings chunk. If i drop the line from the ".tex" file and compile it manually at the cmd prompt the output is generated as expected.
I'm not sure if this is an RStudio or knitr problem, but any pointers would be appreciated.
Note, i've also posted this question on the RStudio support board (http://support.rstudio.org/help/discussions/problems/5039-knitr-compile-problems-with-rstudio-windows?unresolve=true).
The reason that it was injecting \SweaveOpts{concordance=TRUE} is likely to be your weaver was Sweave instead of knitr, and you also enabled Rnw concordance: http://www.rstudio.com/ide/docs/authoring/rnw_weave But I cannot say for sure it is not a bug for the Windows version of RStudio. Anyway, it is easy to verify if it is an RStudio problem -- open the Compile PDF panel and you should see the log like this:
If your weaver was Sweave, you will see something like this instead:
This is my configuration (I'm under Ubuntu):
If you are using knitr indeed, and RStudio still inserts \SweaveOpts{concordance=TRUE}, I guess it must be a bug of RStudio.
I encountered this problem with "R CMD build KFAS-master" downloaded 2016-04-24 as "KFAS-master.zip" clicking "Download ZIP" from KFAS on GitHub (https://github.com/helske/KFAS). I'm unable to replicate the problem, but the work around I used was to find the line mentioned in the pop-up (copied below), and comment it out by preceding it with "%%".
After downloading it, I unzipped it and changed the name of the folder to "KFAS". Then I got a command prompt and navigated to the directory containing the KFAS-master folder renamed as KFAS. This time "R CMD build KFAS" worked as expected. Then I opened ~KFAS/vignettes/KFAS.Rmw in RStudio 0.99.893, the current version as of 2016-04-26. I changed something and saved the result. When I repeated "R CMD build KFAS", I got the problem portrayed in the image below.
Jouni Helske directed me to this post. I commented out line 69 mentioned in the screen shot below by prepending "%%" to "\SweaveOpts{concordance=TRUE}". I saved the result, and "R CMD build KFAS" worked.
Something seems to occasionally insert a line like "\SweaveOpts{concordance=TRUE}" into a *.Rnw file, but I don't know what it is. I'm running R 3.2.4 on a MacBook Pro with OS X 10.11.2.
Thanks to Yihui and others for earlier posts in this thread.
screen shot showing pop-up complaining, "It seems you are using the Sweave-specific syntax in line(s) 69... ."
I had the same problem even when knitr was set for "Weave Rnw files using" by default.
I solved it by going to Tools/Global Options/Sweave and setting "Weave Rnw files using" to Sweave and pressing Ok. Then, I went back and set it back to knitr, and everything works fine now.
I guess it was indeed Rstudio bug

Is there a way to knitr and produce .rmd files using the external tools function of the StatET Eclipse plugin?

I'm becoming a fan of reproducible analyses and of Sweave, Beamer and specially of the knitr package.
RStudio allows to Sweave and knit documents with just one click, but although RStudio is easy to install, it is quite unstable and does not have the maturity and flexibility of the StatET plugin from Eclipse. Most tutorials or listservs tend to refer back to the RStudio IDE when asking questions about knitr and RMarkdown, but there's little out there about how to install and turn Markdown files into .Rmd using the knitr package. Jeffrey Horner said when he announced the R markdown package that:
"Markdown documents to HTML, created in collaboration with RStudio. It offers the complete R Markdown feature set available in their best-of-breed IDE, however useRs can integrate markdown into their own toolchain of choice."
The last sentence is what I have not been able to figure out. Elsewhere, I've seen suggested to manually knitr by using library(knitr); knit('myfile.Rmd'), however, when attempting to do this, I receive an error:
Warning in file(con, "r") :
cannot open file 'My file.Rmd': No such file or directory
Error in file(con, "r") : cannot open the connection
I was able to turn the My file.md file into html using:
library(markdown)
markdownToHTML(file = "C:/Dropbox/eclipse/8. CM/Myfile", output="C:/Dropbox/eclipse/8. CM/Myfile.html")
However, the R code is not run, and I suspect that I need to knit the .Rmd file first. Any help or directions about how to be able to knitr markdown files in StatET or somewhere else than Rstudio would be much appreciated.
I'm using R version 2.15.1 (2012-06-22) on a Windows 7 Professional OS.
Eclipse Version: 3.8.0 and StatET 3.0.
One way to do it is to use an R snippet:
1) create a stateET R project, with this file https://raw.github.com/yihui/knitr-examples/master/001-minimal.Rmd in it.
2) in Windows-> Preferences -> StatET -> Run/Debug -> R Code Snippets
click "Add...". to create a new snipped called Rmd2html.
content of the snippet:
file <- "${selected_resource_loc}"
if (!nzchar) stop('Select a file first')
library(knitr)
library(markdown)
library(tools)
md_file <- knit(file)
html_file <- paste(file_path_sans_ext(md_file), '.html', sep = '')
markdownToHTML(md_file, html_file)
click "OK", "OK".
3) back in your project, in the Project Explorer view, right click on the minimal.Rmd file,
and select "Run Code Snippet in R -> Rmd2html"
This should generate the minimal.html file.

Resources