Hey,
I have to use R Studio for my statistics course in uni. For my task I had to download tidy verse, everything went smoothly until I had to knit it to submit it. Now there is an error message shown. I google image reversed it and google gave me the code "options(repos = c(CRAN = "https://cran.rstudio.com/"))" is this the right one? Or what else should I try.
Here are the contents of the error:
Error in 'contrib.url()':
! trying to use CRAN without setting a mirror Backtrace:
'utils:: install packages("tidyverse")
-utils:: contrib.url(repos, "source")
thanks for any help in advance
Temperatur$Uhrzeit <- seq(from = as_datetime("2019_07_25 12:00:00"), to = as_datetime("2019_07_26 11:00:00"), by = "1 hour")
ggplot(Temperatur) +
geom_line(aes(x = Uhrzeit, y = innen), color = "blue", linewidth = 1) +
geom_line(aes(x = Uhrzeit, y = rand), color = "red", linewidth = 1) +
geom_line(aes(x = Uhrzeit, y = umland), color = "green", linewidth = 1) +
labs(x = "Zeit in h", y = "Temperatur in Grad Celsius", title = "Temperaturen München und Umland")
[/quote]
Yes the first Statement is within the Rmarkdown document. The second statement is from Google, when I google image reversed the error message so I don't know if it is correct or where it is from
Your first problem is than you cannot install a package within an RMarkdown document. You must install it at the normal operating level. You can only do
library("tidyverse")
within the document. By the way the "" are optional
library(tidyverse)
will work just as well.
You do not need
contrib.url(repos, "source")
It is not something you need in an ordinary R program or Rmarkdown document. It looks to me as if it is likely to cause problems, especially within an Rmarkdown document. Delete it.