Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"NAs not allowed in burst" error to build vignettes #22

Closed
basille opened this issue Aug 4, 2020 · 2 comments
Closed

"NAs not allowed in burst" error to build vignettes #22

basille opened this issue Aug 4, 2020 · 2 comments

Comments

@basille
Copy link
Member

basille commented Aug 4, 2020

Installing with remotes with vignettes throws an error:

> remotes::install_github("mablab/sftrack", build_opts = c("--no-resave-data", "--no-manual"), build_vignettes = TRUE)
Downloading GitHub repo mablab/sftrack@master
✔  checking for file ‘/tmp/Rtmp2iVtLu/remotes17c4ebdc442/mablab-sftrack-6902309/DESCRIPTION’ ...
─  preparing ‘sftrack’:
✔  checking DESCRIPTION meta-information ...
─  installing the package to build vignettes
E  creating vignettes (4.2s)
   Loading required package: sp
   Loading required package: ade4
   Loading required package: adehabitatMA
   Loading required package: CircStats
   Loading required package: MASS
   Loading required package: boot
   Quitting from lines 112-122 (sftrack2_reading.Rmd) 
   Error: processing vignette 'sftrack2_reading.Rmd' failed with diagnostics:
   NAs not allowed in burst
   Execution halted
Error: Failed to install 'sftrack' from GitHub:
  System command 'R' failed, exit status: 1, stdout + stderr (last 10 lines):
E> Loading required package: sp
E> Loading required package: ade4
E> Loading required package: adehabitatMA
E> Loading required package: CircStats
E> Loading required package: MASS
E> Loading required package: boot
E> Quitting from lines 112-122 (sftrack2_reading.Rmd) 
E> Error: processing vignette 'sftrack2_reading.Rmd' failed with diagnostics:
E> NAs not allowed in burst
E> Execution halted
>

Simple install without vignettes runs fine (remotes::install_github("mablab/sftrack")).

Session info:

> sessionInfo()
R version 3.3.3 (2017-03-06)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 9 (stretch)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] ps_1.3.3          fansi_0.4.1       prettyunits_1.1.1 withr_2.2.0      
 [5] crayon_1.3.4      rprojroot_1.3-2   assertthat_0.2.1  R6_2.4.1         
 [9] backports_1.1.8   cli_2.0.2         curl_4.3          remotes_2.1.1    
[13] callr_3.4.3       tools_3.3.3       glue_1.4.1        processx_3.4.3   
[17] pkgbuild_1.1.0   
@birderboone
Copy link
Member

After our previous discussions on this and looking into it further as I cant reproduce it. I couldn't really prove anything without me reinstalling R as 3.3.3 on my system. I definitely agree its likely some change around 3.4 as no other users above that seem to be having an issue.

The code 'snags' during check_NA_burst, but only when constructing a burst from an ltraj. The problem comes down to that your R believes it can't convert our character vector to a factor without it becoming malformed, which it does automatically when unlisting the burst list at that stage. However, your R never snagged check_NA_burst while building an as_sftrack.data.frame. And theres nothing overly amiss in the code. I suspect theres just some attribute thats getting held over in the character vector from R <3.4 that wont allow it to auto convert. But I can't prove what it is.

I remade the check_NA_burst to contain a vapply (instead of unlist) which should bypass the requirement to convert anything to a factor. Let me know if this hotfix worked. This is an equally if not more efficient operation than the unlist anyway.

We'll keep this in mind and let me know if it ever snags again on 3.3.3.

@basille
Copy link
Member Author

basille commented Aug 6, 2020

Thanks for tracking it down! I remember now it has something to do with factors, and how they changed around 3.4…

The fix did the work: I could install the master branch with vignettes (with the code above), and all 5 vignettes now show properly. Thanks!

@basille basille closed this as completed Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants