0

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.

Manfredo
  • 1,760
  • 4
  • 25
  • 53
  • Plain as day: `Files 'DESCRIPTION' [...] missing.`. I don't use `devtools` but methinks you invoked the wrong / incomplete functions to create a stub package. – Dirk Eddelbuettel Oct 19 '16 at 16:17
  • Maybe start over with `package.skeleton()`, or `devtools::create()`, or `pkgKitten::kitten()`. I mostly use the latter one. – Dirk Eddelbuettel Oct 19 '16 at 16:18
  • 1
    Copy-paste fail? "R CMD INSTALL --preclean --no-multiarch --with-keep.source EDio" but everything else says "ED2io". Plus your prompts look strange. I've chased too many copy-paste ghosts on SO to take this further until you fix that all up. – Spacedman Oct 19 '16 at 16:32
  • That is just a name, it might be confusing but it's not that. My R project is called EDio while the package is called ED2io. – Manfredo Oct 19 '16 at 16:48
  • I changed the name of the R project to ED2io and i have the same exact error – Manfredo Oct 19 '16 at 16:57

1 Answers1

0

Turned out to be a missing escape character in the roxygencomments.

#' @name %==% instead of #' @name \%==\%

Manfredo
  • 1,760
  • 4
  • 25
  • 53
  • I can't duplicate your error when I have a simple package with one .R file with `#' @name %==%` in the roxygen for its function. If I add the backslashes and re-document() then I get a `backslash-grapes-equals-backslash-grapes.Rd` file and an error because there's two `\alias` lines in there. – Spacedman Oct 20 '16 at 09:13
  • Well I am not entirely sure but since changing that made the error disappear I assumed that was the reason. What to you mean by "two `\alias`"? – Manfredo Oct 20 '16 at 14:18
  • Well actually it now doen't give me an error when I clean and build but I have the same `Rd` file you mentioned and with the two `\alias` lines. Even if I cancel the file and re-generate it still has these two `alias` lines. Why is that? – Manfredo Oct 20 '16 at 15:01