简体   繁体   中英

How can I open up rmarkdown script in rstudio

I try to write a report using rmarkdown, but I have tried all the methods to download the lastest version rmarkdown package. When I try to open up the rmarkdown script, it shows that

Required version package could not be found: rmarkdown 1.2 is required but 1.1 is available Check that getOption("repos") refers to CRAN repository that contains the needed package versions.

Some of the code I have tried:

install.packages("rmarkdown")
update.packages("rmarkdown")
install_github("rstudio/rmarkdown")

And my R version is 3.3.2 and my rstudio is already the lastest version now, which I think might be the problem coming from.

I am glad the problem being solved! Instead of keep trying installing packages, I updated my cran URL to cran.project. And learnt some function of adding repos, thank you all! The code follows as :

local({r <- getOption("repos"); r["CRAN"] <- "https://cran.r-project.org/"; options(repos = r)})

This is a total reach, but I've been teaching R and RStudio and have seen this happen a lot!

Make sure the Markdown file you're creating has extension ".Rmd"

Many of my students have named their Markdown files something like "Foo.Rproj".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM