Search
Question: Any way to debug unusual vignette error when building package?
0
gravatar for Jurat Shahidin
10 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

ADD COMMENTlink written 10 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 10 months ago by Martin Morgan ♦♦ 20k

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

ADD REPLYlink written 10 months ago by Jurat Shahidin60

This may be due to a change in the code but still using the cache of the old code. Try removing the cache of the vignette and compiling it again (If you are using cache storage).

ADD REPLYlink written 10 months ago by Lluís R300
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 254 users visited in the last hour