[Bioc-devel] package vignette error : external data can't be captured when compiling package vignette

Jurat Shayidin juratbupt at gmail.com
Fri Dec 2 01:34:26 CET 2016


Hi BiocDevel :

I am getting vignette error when I building my packages, and external data
can't be captured by system.file() . I did unit test all function of my
packages, it works fine. When I am going to compile package vignette, test
input bed file can't be detected. However, I used devtools::install()command
to install my packages, but installation directory inst/ was not created
automatically. By R package convention, all external data must be located
in inst/, so I manually created this folder  inst/extdata and paste my
data, but vignette compilation still failed. According to convention of R
package, my package structure will be:

myPackage
`- inst
`- extdata
`- data1.bed
`- data2.bed
`- R
`- ...
`- NAMESPACE
`- DESCRIPTION

-- 

Note that readPeakFile take list of bed file as an input. Here is the toy
function I am going to use in vignette file .

readPeakFile<- function(mydat, ...) {
  files <- list.files(mydat, full.names = TRUE, "\\.bed$")
  readMe <- lapply(files, import.bed)
  return(readMe)}

I got error from this code chunk :

```{r}
library(MSPC)
inputBed <- list.files(system.file("extdata", package = "MSPC"), full.names
= TRUE)
inputData <- readPeakFile(peakFolder = inputBed)

inputData
```

Error: object 'inputData' not found

I tried another way which discussed in mailing list long time ago, but I
got empty list instead :

```{r}
library(MSPC)
extdata.dir <- system.file("extdata", package = "MSPC")
bedfiles <- dir(extdata.dir, pattern="\\.bed$", full.names=TRUE)
myData <- readPeakFiles(peakFolder = bedfiles)

myData
```
named list()

can't figure out why got these issue very often. why installation directory
inst not created automatically ? why test data can't be captured by
system.file() when compiling the package vignette ? I think inst must be
created automatically when I install my packages, but it didn't happen to
me, why is that ? How can I fix this compilation error for package vignette
? Any idea please ?

Here is what I got :

==> devtools::check()

Updating MSPC documentation
Loading MSPC
Writing NAMESPACE
Writing FDR_stats.Rd
Writing Fisher_stats.Rd
Writing MSPC-package.Rd
Writing info.Rd
Writing create_output.Rd
Writing denoise_ERs.Rd
Writing filterByFisherMethod.Rd
Writing filterByOverlapHit.Rd
Writing peakOverlapping.Rd
Writing pvalueConversion.Rd
Writing readPeakFiles.Rd
Setting env vars
---------------------------------------------------------------
CFLAGS  : -Wall -pedantic
CXXFLAGS: -Wall -pedantic
Building MSPC
------------------------------------------------------------------
"C:/PROGRA~1/R/R-devel/bin/x64/R" --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD build "C:\Users\jvrat\Documents\MSPC"  \
  --no-resave-data --no-manual

* checking for file 'C:\Users\jvrat\Documents\MSPC/DESCRIPTION' ... OK
* preparing 'MSPC':
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... ERROR
Quitting from lines 46-52 (vignette.Rmd)
Error: processing vignette 'vignette.Rmd' failed with diagnostics:
length(peakFolder) > 0 is not TRUE
Execution halted
Warning: running command '"C:/PROGRA~1/R/R-devel/bin/x64/Rscript" --vanilla
--default-packages= -e "tools::buildVignettes(dir = '.', tangle = TRUE)"'
had status 1
Error: Command failed (1)
In addition: Warning message:
@importfrom [peakOverlapping.R#23]: unknown tag
Execution halted

Exited with status 1.




Jurat Shahidin

Dipartimento di Elettronica, Informazione e Bioingegneria
Politecnico di Milano
Piazza Leonardo da Vinci 32 - 20133 Milano, Italy
Mobile : +39 3279366608 <+39%20327%20936%206608>

	[[alternative HTML version deleted]]



More information about the Bioc-devel mailing list