问题
I am trying to build an R package. I usually run the clean and rebuild command in Rstudio. I am now getting this error message:
==> devtools::document(roclets=c('rd', 'collate', 'namespace', 'vignette'))
Updating ED2io documentation
Loading ED2io
Deleting grapes-equals-grapes.Rd
Writing NAMESPACE
Documentation completed
==> R CMD INSTALL --preclean --no-multiarch --with-keep.source EDio
* installing to library ‘/opt/local/Library/Frameworks/R.framework/Versions/3.3/Resources/library’
* installing *source* package ‘ED2io’ ...
** R
** preparing package for lazy loading
No man pages found in package ‘ED2io’
** help
Error in .get_package_metadata(dir, FALSE) :
Files 'DESCRIPTION' and 'DESCRIPTION.in' are missing.
ERROR: installing Rd objects failed for package ‘ED2io’
* removing ‘/opt/local/Library/Frameworks/R.framework/Versions/3.3/Resources/library/ED2io’
Exited with status 1.
The DESCRIPTION
file is actually in the project folder and seems ok. It's a bit hard to provide a reproducible example because there are so many files in the project. Maybe someone has already seen this error.
回答1:
Turned out to be a missing escape character in the roxygen
comments.
#' @name %==%
instead of
#' @name \%==\%
来源:https://stackoverflow.com/questions/40136527/r-package-building-error