我正在尝试使用roxygen来记录我的包函数,但是当需要roxygen来记录时,我仍然遇到相同的错误错误:
==> devtools::document(roclets=c('rd', 'collate', 'namespace'))
Error: ‘roxygen2’ >= >= 6.1.0 must be installed for this functionality.
Execution halted
Exited with status 1.
这个答案似乎是不言自明的,唯一的问题是我安装了roxygen2 6.1.1 ...
> devtools::session_info()
─ Session info ───────────────────────────────────────────────────────
setting value
version R version 3.5.3 (2019-03-11)
os Ubuntu 18.04.2 LTS
system x86_64, linux-gnu
ui RStudio
language (EN)
collate en_US.UTF-8
ctype pt_PT.UTF-8
tz Europe/Lisbon
date 2019-04-25
─ Packages ───────────────────────────────────────────────────────────
package * version date lib source
assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.5.3)
backports 1.1.4 2019-04-10 [1] CRAN (R 3.5.3)
callr 3.2.0 2019-03-15 [1] CRAN (R 3.5.3)
cli 1.1.0 2019-03-19 [1] CRAN (R 3.5.3)
commonmark 1.7 2018-12-01 [1] CRAN (R 3.5.3)
crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.3)
desc 1.2.0 2018-05-01 [1] CRAN (R 3.5.3)
devtools * 2.0.2 2019-04-08 [1] CRAN (R 3.5.3)
digest 0.6.18 2018-10-10 [1] CRAN (R 3.5.3)
fs 1.2.7 2019-03-19 [1] CRAN (R 3.5.3)
glue 1.3.1 2019-03-12 [1] CRAN (R 3.5.3)
magrittr 1.5 2014-11-22 [1] CRAN (R 3.5.3)
memoise 1.1.0 2017-04-21 [1] CRAN (R 3.5.3)
packrat 0.5.0 2018-11-14 [1] CRAN (R 3.5.3)
pkgbuild 1.0.3 2019-03-20 [1] CRAN (R 3.5.3)
pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.5.3)
prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.5.3)
processx 3.3.0 2019-03-10 [1] CRAN (R 3.5.3)
ps 1.3.0 2018-12-21 [1] CRAN (R 3.5.3)
R6 2.4.0 2019-02-14 [1] CRAN (R 3.5.3)
rcmdcheck 1.3.2 2018-11-10 [1] CRAN (R 3.5.3)
Rcpp 1.0.1 2019-03-17 [1] CRAN (R 3.5.3)
remotes 2.0.4 2019-04-10 [1] CRAN (R 3.5.3)
rlang 0.3.4 2019-04-07 [1] CRAN (R 3.5.3)
roxygen2 6.1.1 2018-11-07 [1] CRAN (R 3.5.3)
rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.5.3)
rstudioapi 0.10 2019-03-19 [1] CRAN (R 3.5.3)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.5.3)
stringi 1.4.3 2019-03-12 [1] CRAN (R 3.5.3)
stringr 1.4.0 2019-02-10 [1] CRAN (R 3.5.3)
testthat 2.1.1 2019-04-23 [1] CRAN (R 3.5.3)
usethis * 1.5.0 2019-04-07 [1] CRAN (R 3.5.3)
withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.3)
xml2 1.2.0 2018-01-24 [1] CRAN (R 3.5.3)
xopen 1.0.0 2018-09-17 [1] CRAN (R 3.5.3)
yaml 2.2.0 2018-07-25 [1] CRAN (R 3.5.3)
[1] /home/pedro/lemonPKG/packrat/lib/x86_64-pc-linux-gnu/3.5.3
[2] /home/pedro/lemonPKG/packrat/lib-ext/x86_64-pc-linux-gnu/3.5.3
[3] /home/pedro/lemonPKG/packrat/lib-R/x86_64-pc-linux-gnu/3.5.3
我正在使用Packrat,您在上面可以看到3条路径。我已经在所有3个软件包上安装了该软件包,然后尝试从所有3个软件包分别加载该软件包,但没有结果:
> .libPaths()
[1] "/home/pedro/lemonPKG/packrat/lib/x86_64-pc-linux-gnu/3.5.3"
[2] "/home/pedro/lemonPKG/packrat/lib-ext/x86_64-pc-linux-gnu/3.5.3"
[3] "/home/pedro/lemonPKG/packrat/lib-R/x86_64-pc-linux-gnu/3.5.3"
> lapply(.libPaths(), dir)
[[1]]
[1] "askpass" "assertthat" "backports" "base64enc"
[5] "BH" "Boruta" "brew" "broom"
[9] "callr" "caret" "cellranger" "cli"
[13] "clipr" "clisymbols" "colorspace" "commonmark"
[17] "crayon" "curl" "data.table" "DBI"
[21] "dbplyr" "desc" "devtools" "digest"
[25] "dplyr" "ellipsis" "evaluate" "fansi"
[29] "forcats" "foreach" "fs" "generics"
[33] "ggplot2" "gh" "git2r" "glue"
[37] "gower" "gtable" "haven" "highr"
[41] "hms" "htmltools" "httr" "ini"
[45] "ipred" "iterators" "jsonlite" "knitr"
[49] "labeling" "lava" "lazyeval" "lubridate"
[53] "magrittr" "markdown" "memoise" "mime"
[57] "ModelMetrics" "modelr" "munsell" "numDeriv"
[61] "openssl" "packrat" "pillar" "pkgbuild"
[65] "pkgconfig" "pkgload" "plogr" "plyr"
[69] "praise" "prettyunits" "pROC" "processx"
[73] "prodlim" "progress" "ps" "purrr"
[77] "R6" "ranger" "rcmdcheck" "RColorBrewer"
[81] "Rcpp" "RcppEigen" "RcppRoll" "readr"
[85] "readxl" "recipes" "rematch" "remotes"
[89] "reprex" "reshape2" "rlang" "rmarkdown"
[93] "roxygen2" "rprojroot" "rstudioapi" "rvest"
[97] "scales" "selectr" "sessioninfo" "SQUAREM"
[101] "stringi" "stringr" "sys" "testthat"
[105] "tibble" "tidyr" "tidyselect" "tidyverse"
[109] "timeDate" "tinytex" "usethis" "utf8"
[113] "viridisLite" "whisker" "withr" "xfun"
[117] "xml2" "xopen" "yaml"
[[2]]
[1] "roxygen2"
[[3]]
[1] "base" "boot" "class" "cluster" "codetools"
[6] "compiler" "datasets" "foreign" "graphics" "grDevices"
[11] "grid" "KernSmooth" "lattice" "MASS" "Matrix"
[16] "methods" "mgcv" "nlme" "nnet" "parallel"
[21] "roxygen2" "rpart" "spatial" "splines" "stats"
[26] "stats4" "survival" "tcltk" "tools" "utils"
这是我的第一个软件包,因此这可能是一个小问题,但我还没有找到有关此问题的任何有关roxygen的文档。 packrat可能有问题吗?任何帮助或线索均表示赞赏!
谢谢