hypertidy/anglr

copy_down issue

Closed this issue · 1 comments

##Windows

library(anglr)
#> This is an early developmental version of anglr (0.4.8.9603),
#>  still in an experimental state with changes pending.
library(silicate)
#> 
#> Attaching package: 'silicate'
#> The following object is masked from 'package:stats':
#> 
#>     filter
tri <- TRI(cad_tas)
copy_down(tri, 10)
#> class       : TRI
#> type        : Primitive
#> vertices    : 5661 (3-space)
#> primitives  : 1887 (2-space)
#> crs         : +proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
sessionInfo()
#> R version 3.6.2 (2019-12-12)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 17763)
#> 
#> Matrix products: default
#> 
#> locale:
#> [1] LC_COLLATE=English_Australia.1252  LC_CTYPE=English_Australia.1252   
#> [3] LC_MONETARY=English_Australia.1252 LC_NUMERIC=C                      
#> [5] LC_TIME=English_Australia.1252    
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] silicate_0.3.0.9040 anglr_0.4.8.9603   
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_1.0.4              later_1.0.0             pillar_1.4.3           
#>  [4] compiler_3.6.2          highr_0.8               tools_3.6.2            
#>  [7] digest_0.6.25           jsonlite_1.6.1          evaluate_0.14          
#> [10] lifecycle_0.2.0         tibble_3.0.0.9000       lattice_0.20-38        
#> [13] pkgconfig_2.0.3         rlang_0.4.5             shiny_1.4.0.2          
#> [16] cli_2.0.2               reproj_0.4.0            crosstalk_1.1.0.1      
#> [19] yaml_2.2.1              unjoin_0.0.4            xfun_0.12              
#> [22] fastmap_1.0.1           dplyr_0.8.5             stringr_1.4.0          
#> [25] knitr_1.28              raster_3.0-12           vctrs_0.2.4            
#> [28] htmlwidgets_1.5.1       webshot_0.5.2           manipulateWidget_0.10.1
#> [31] grid_3.6.2              tidyselect_1.0.0        glue_1.3.2             
#> [34] R6_2.4.1                fansi_0.4.1             rgl_0.100.50           
#> [37] rmarkdown_2.1           decido_0.2.0.9001       sp_1.4-1               
#> [40] crsmeta_0.3.0           purrr_0.3.3             magrittr_1.5           
#> [43] promises_1.1.0          codetools_0.2-16        ellipsis_0.3.0         
#> [46] htmltools_0.4.0         assertthat_0.2.1        proj4_1.0-10           
#> [49] gibble_0.3.0            xtable_1.8-4            mime_0.9               
#> [52] httpuv_1.5.2            miniUI_0.1.1.1          stringi_1.4.6          
#> [55] crayon_1.3.4

Created on 2020-04-07 by the reprex package (v0.3.0)

Ubuntu

library(anglr)
#> This is an early developmental version of anglr (0.4.8.9603),
#>  still in an experimental state with changes pending.
library(silicate)
#> 
#> Attaching package: 'silicate'
#> The following object is masked from 'package:stats':
#> 
#>     filter
tri <- TRI(cad_tas)
copy_down(tri, 10)
#> Warning: Unknown or uninitialised column: 'object_'.
#> Error in `[[<-.data.frame`(`*tmp*`, .id, value = numeric(0)): replacement has 0 rows, data has 5661
sessionInfo()
#> R version 3.6.3 (2020-02-29)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 18.04.4 LTS
#> 
#> Matrix products: default
#> BLAS:   /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
#> 
#> locale:
#>  [1] LC_CTYPE=en_AU.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_AU.UTF-8        LC_COLLATE=en_AU.UTF-8    
#>  [5] LC_MONETARY=en_AU.UTF-8    LC_MESSAGES=en_AU.UTF-8   
#>  [7] LC_PAPER=en_AU.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] silicate_0.3.0.9040 anglr_0.4.8.9603   
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_1.0.4              pillar_1.4.3            compiler_3.6.3         
#>  [4] later_1.0.0             highr_0.8               tools_3.6.3            
#>  [7] digest_0.6.25           jsonlite_1.6.1          evaluate_0.14          
#> [10] tibble_2.1.3            lattice_0.20-40         pkgconfig_2.0.3        
#> [13] rlang_0.4.5             shiny_1.4.0.2           reproj_0.4.0           
#> [16] crosstalk_1.1.0.1       yaml_2.2.1              unjoin_0.0.4           
#> [19] xfun_0.12               fastmap_1.0.1           dplyr_0.8.5            
#> [22] stringr_1.4.0           raster_3.0-12           knitr_1.28             
#> [25] vctrs_0.2.4             htmlwidgets_1.5.1       webshot_0.5.2          
#> [28] manipulateWidget_0.10.1 grid_3.6.3              tidyselect_1.0.0       
#> [31] glue_1.3.2              R6_2.4.1                rgl_0.100.50           
#> [34] rmarkdown_2.1           decido_0.2.0            sp_1.4-1               
#> [37] crsmeta_0.3.0           purrr_0.3.3             magrittr_1.5           
#> [40] codetools_0.2-16        promises_1.1.0          htmltools_0.4.0        
#> [43] assertthat_0.2.1        proj4_1.0-10            gibble_0.3.0           
#> [46] xtable_1.8-4            mime_0.9                httpuv_1.5.2           
#> [49] miniUI_0.1.1.1          stringi_1.4.6           crayon_1.3.4

Created on 2020-04-07 by the reprex package (v0.3.0)

traceback()
6: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", 
       "replacement has %d rows, data has %d"), N, nrows), domain = NA)
5: `[[<-.data.frame`(`*tmp*`, .id, value = numeric(0)) at de-normalize.R#78
4: `[[<-`(`*tmp*`, .id, value = numeric(0)) at de-normalize.R#78
3: denorm_PRIM_addZ(x, z = z, ..., .id = .id) at copy_down.R#97
2: copy_down.TRI(tri, 10) at copy_down.R#49
1: copy_down(tri, 10)

Old tibble, based on fallout from removing tidyr (and sticking matrices into data frames).

Fixed.