Search
Question: Any way to debug unusual vignette error when building package?
0
22 months ago by
Italy
Jurat Shahidin60 wrote:

Hi:

I got vignette error when I intend to build my packages. I've test all part of my code outside the .Rmd file with same parameter setting and data set, and result is very optimal. But I tried to rebuild my package' vignette in order to improve the result, and I got an error. The point is, I tried very specific duplicate removal for my data set (a.k.a, list of GRanges), for the matter of efficiency, I tried data.table solution and it worked very nice, but this time vignette compilation is failed. I don't know how to debug this unusual error.

for reproducible data, using list of GRanges object with name, score, p.value is its metadata.

This is my data.table solution to apply duplicate removal for my data:

out <- Map(function(x,y) setDT(x)[x[, .I[(1:.N)<=y] , .(name, score, p.value)]\$V1], myList, 1:3)

I got this error message :

Error in 1:.N : argument of length 0
Calls: <Anonymous> ... [.data.table -> [.data.frame -> [ -> [.data.table -> [.data.frame

I don't understand my code works perfectly outside vignette, but have unusual error when I tried to rebuild .Rmd file. Any efficient way to debug vignette error ? How can I get rid of this error? Any idea please ? Thanks a lot

Best regards:

Jurat

written 22 months ago by Jurat Shahidin60
1

Questions about package development belong on the bioc-devel mailing list.

To debug, 'tangle' the vignette

cd mypkg/vignettes
R CMD Stangle myvignette.Rnw

and then source the code into a 'vanilla'  R session

R --vanilla
source ("myvignette.R")

It is also possible to create the 'tangled' version of the vignette inside R, using Stangle() or perhaps knitr::purl().

ADD REPLYlink written 22 months ago by Martin Morgan ♦♦ 22k

Dear Martin :

Thanks for helpful answer. I'll give it try by using your recommendation. I will keep this in mind  that open this sort of question through BiocDevel mailing list.

Best regards :

Jurat