r - 用于安装软件包的 R 版本记录在哪里?
问题描述
R> library(ggplot2)
Error: package or namespace load failed for ‘ggplot2’:
package ‘ggplot2’ was installed before R 4.0.0: please re-install it
R 知道已安装软件包的安装版本。
~/Library/R/4.0/library/ggplot2中有以下文件。有人知道哪个文件包含用于安装的 R 版本吗?谢谢。
./CITATION
./LICENSE
./NEWS.md
./R/ggplot2.rdx
./R/ggplot2.rdb
./R/ggplot2
./Meta/vignette.rds
./Meta/data.rds
./Meta/links.rds
./Meta/features.rds
./Meta/nsInfo.rds
./Meta/package.rds
./Meta/hsearch.rds
./Meta/Rd.rds
./NAMESPACE
./html/R.css
./html/00Index.html
./DESCRIPTION
./INDEX
./doc/index.html
./doc/ggplot2-specs.R
./doc/extending-ggplot2.Rmd
./doc/extending-ggplot2.R
./doc/ggplot2-in-packages.R
./doc/ggplot2-specs.Rmd
./doc/ggplot2-in-packages.html
./doc/ggplot2-in-packages.Rmd
./doc/extending-ggplot2.html
./doc/ggplot2-specs.html
./data/Rdata.rds
./data/Rdata.rdx
./data/Rdata.rdb
./help/ggplot2.rdx
./help/ggplot2.rdb
./help/AnIndex
./help/aliases.rds
./help/paths.rds
./help/figures/logo.png
./help/figures/README-example-1.png
解决方案
./Meta/package.rds 包含有关构建包的 R 版本的信息。这是我当前运行 3.4.1 的机器上的 yaml 包的示例
> # Working directory already set to the Meta folder of the package
> meta <- readRDS("package.rds")
> meta$Built
$R
[1] ‘3.4.2’
$Platform
[1] "x86_64-w64-mingw32"
$Date
[1] "2017-11-19 09:58:14 UTC"
$OStype
[1] "windows"
推荐阅读
- javascript - setState 与 useState 挂钩是异步的吗?
- clojure - 这段代码是惯用的吗?有没有更好或更简洁的方法来写这个?
- r - 如何计算 data.frame 中特定变量的完整观察值
- javascript - 如何将对象转换为数组?
- python - 尝试从多个日志文件中提取数据
- python - 如何将 pyspark rdd 转换为 Dataframe
- java - 如何使用java反射从接口返回类型对象调用类的方法
- python - MatplotLib 中子图 x 轴代码的问题
- reactjs - React-vis-timeline - 无法初始化项目数据
- python - 如何将 setPlaceholderText 包装在 QPlainTextEdit 字段中?