Any way to debug unusual vignette error when building package?
0
0
Entering edit mode
@jurat-shahidin-9488
Last seen 4.7 years ago
Chicago, IL, USA

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

r compilation error error handling data.table • 1.7k views
ADD COMMENT
1
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 748 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6