Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Non-standard file/directory found at top level: 'README.Rmd' persists even after implementing suggested solutions

I am working on a package and running R CMD CHECK on it using devtools::check() produces the following NOTE:

> checking top-level files ... NOTE
  Non-standard file/directory found at top level:
    'README.Rmd'

A variant of this question has been raised before (NOTE or WARNING from package check when README.md includes images), but that solution provided therein hasn't worked for me.

Here is my .Rbuildignore file. As has been suggested, I have included ^README-.*\.png$:

^.*\.Rproj$
^\.Rproj\.user$
^CONDUCT\.md$
^\.travis\.yml$
^README-.*\.png$
^cran-comments\.md$

Additionally, my README.Rmd document has the following chunk, which saves all figures in /man/figures/

{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-"
)

If you need more details about the .Rmd file, it's here: https://github.com/IndrajeetPatil/ggstatsplot/blob/master/README.Rmd

Given that it's better to get rid of all possible NOTES to successfully pass CRAN's R CMD CHECK, how can I avoid this particular NOTE?

like image 891
Indrajeet Patil Avatar asked Feb 23 '18 19:02

Indrajeet Patil


People also ask

What is a non standard directory in Windows?

Directories which do not come under the standard FHS are called non-standard directories. Non-standard directories are as follows: /cdrom. /run. /lost + found.

What is Rbuildignore?

Rbuildignore is a Perl-compatible regular expression that is matched, without regard to case, against the path to each file in the source package 1. If the regular expression matches, that file or directory is excluded.


1 Answers

To exclude the file README.Rmd from the tarball created by R, add

^README.Rmd

to the file .Rbuildignore you already have. "Writing R Extensions" has more, should you need it.

like image 104
Dirk Eddelbuettel Avatar answered Oct 05 '22 11:10

Dirk Eddelbuettel