我在脚本中成功编写并运行了代码,现在尝试编织markdown文件。我一直收到tidyverse错误,并更新了RStudio的版本,希望对您有所帮助。它没有。有人可以帮助我解决错误的方法。
> library(tidyverse)
package �tidyverse� was built under R version 3.6.3Error: package or namespace load failed for ‘tidyverse’ in namespaceExport(ns, exports):
undefined exports: %>%
> library(tidyverse)
Warning: package ‘tidyverse’ was built under R version 3.6.3
Error: package or namespace load failed for ‘tidyverse’ in namespaceExport(ns, exports):
undefined exports: %>%
更新后,尝试在脚本文件中构建图也出错(更新之前我没有图):
> ggplot(advertising, aes(Daily.Internet.Usage, Age, colour = Clicked.on.Ad)) +
+ geom_point()
Warning in (function (filename = "Rplot%03d.png", width = 480, height = 480, :
unable to open file 'C:/Users/matpo/AppData/Local/RStudio-Desktop/notebooks/F7130DD5-HW3P2_final/1/3023B567657018D6/cd109ty709ig8_t/_rs_chunk_plot_001.png' for writing
Warning in (function (filename = "Rplot%03d.png", width = 480, height = 480, :
opening device failed
Error in (function (filename = "Rplot%03d.png", width = 480, height = 480, :
unable to start png() device
我将不胜感激!
答案 0 :(得分:0)
遇到了完全相同的问题。相同的R版本,相同的错误消息,以及编织的Markdown文件。
我通过运行library(dplyr)
和library(ggplot2)
解决了这个问题,因为我注意到它无法识别管道符号"%>%"
,我记得它们在这两个软件包中都没有。
那么看来问题是由软件包之间的依赖关系引起的吗?如果我弄错了,请纠正我。