ggplot2我将包含一些对象的列表导出到.RDS从 R 3.6.1 会话生成的文件中。然后,尝试将其导入 R 4.0.0 会话并收到以下错误:
Error in identicalUnits(x) :
old version of unit class is no longer allowed
Run Code Online (Sandbox Code Playgroud)
我可以读取这些图并将其导入 R 对象,但无法绘图。他们实际上拥有所有数据(数据、图层、比例映射...),但ggplot2没有绘制它们。
有什么办法解决吗?你们有人遇到过这个问题吗?是否ggplot2计划更新库以便我们可以导入旧版本的绘图?希望你能帮我找到解决方案,或者至少是一个补丁。谢谢!
一段时间以来,我一直很高兴使用 Github 的 Actions 来运行我的库R CMD check并部署包的文档。突然,打包操作开始失败,并出现以下错误:
\xe2\x94\x80\xe2\x94\x80 Commiting updated site \xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\xe2\x94\x80\nRunning git add -A .\nRunning git commit --allow-empty -m \'Built site for lares: 4.9.0@d936943\'\n\n*** Please tell me who you are.\n\nRun\n\n git config --global user.email "you@example.com"\n git config --global user.name "Your Name"\n\nto set your account\'s default identity.\nOmit --global to set the identity only in this repository.\n\nfatal: unable to auto-detect email address (got \'runner@Mac-1594850189701.(none)\')\n\nError: System command \'git\' failed, exit status: 128, stdout & stderr were printed\n\n …Run Code Online (Sandbox Code Playgroud) 特拉维斯CI检测并没有被发现问题,Build > Check在RStudio我的lares图书馆(在Github上找到作为laresbernardo /拉雷斯)。根据 Travis CI 的说法,我最后一次“通过”提交实际上是一个错字更改,因此库的代码应该不是问题;因此,当我devtools::check()为库运行时,我会收到R CMD check succeeded一条包含 0 个错误、警告或注释的好消息。
我已经尝试过消息建议的内容和其他内容:
brew install udunits在终端 (macOS) 中运行install.packages(units)devtools::install_github("r-quantities/units", args="--configure-args='--with-udunits2-lib=/usr/local/lib'")devtools::install_github("r-quantities/units", args="--configure-args='--with-udunits2-include=/usr/include/udunits2'")这是 Travis CI 日志的结尾,也可以在这里找到:https : //travis-ci.org/laresbernardo/lares
(...)
checking for ut_read_xml in -ludunits2... no
configure: error: in `/tmp/RtmpITNXhh/R.INSTALL3d3b9a0f951/units':
configure: error:
--------------------------------------------------------------------------------
Configuration failed because libudunits2.so was not found. Try installing:
* deb: libudunits2-dev (Debian, Ubuntu, ...)
* rpm: …Run Code Online (Sandbox Code Playgroud) 我希望生成一个gganimate对象,显示特定范围内的n个随机点.另一个限制是它应该绘制2^n点,意味着2, 4, 8, 16, 32, 64...点.我这样做是为了计算小数,pi但我想绘制这个动画,这样我就可以展示它如何以更好的方式给出更多的随机数来改善结果.
这是我到目前为止:
results <- c()
for(i in c(1:20)) {
r <- 1
limit <- 2^i
points <- data.frame(
x = runif(limit, -r, r),
y = runif(limit, -r, r))
points$d <- sqrt(points$x^2 + points$y^2)
points$type <- ifelse(points$d < r, "c", "s")
picalc <- 4 * length(points$type[points$type=="c"]) / limit
error <- pi - picalc
label <- paste0('Pi calc : ', round(picalc, 6), '\nError : ', round(error, 6))
iter <- …Run Code Online (Sandbox Code Playgroud)