vlarmet / cppRouting

Algorithms for Routing and Solving the Traffic Assignment Problem
106 stars 9 forks source link

makegraph - Rcpp_precious_remove error #4

Closed dcooley closed 2 years ago

dcooley commented 2 years ago

I'm using v2.0.0 of cppRouting and the example for makegraph gives an error

#Data describing edges of the graph
edges<-data.frame(from_vertex=c(0,0,1,1,2,2,3,4,4), 
                  to_vertex=c(1,3,2,4,4,5,1,3,5), 
                  cost=c(9,2,11,3,5,12,4,1,6))

#Construct directed and undirected graph 
directed_graph<-makegraph(edges,directed=TRUE)

> Error in Remove_duplicate(df[, 1], df[, 2], df[, 3], length(Nodes)) : 
>   function 'Rcpp_precious_remove' not provided by package 'Rcpp'
─ Session info ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
setting  value                       
version  R version 4.1.0 (2021-05-18)
os       macOS Big Sur 11.3.1        
system   aarch64, darwin20           
ui       RStudio                     
language (EN)                        
collate  en_AU.UTF-8                 
ctype    en_AU.UTF-8                 
tz       Australia/Melbourne         
date     2021-08-04                  

─ Packages ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
package      * version date       lib source        
cppRouting   * 2.0     2020-01-07 [1] CRAN (R 4.1.0)
data.table   * 1.14.0  2021-02-21 [1] CRAN (R 4.1.0)
Rcpp           1.0.6   2021-01-15 [1] CRAN (R 4.1.0)
RcppParallel   5.1.4   2021-05-04 [1] CRAN (R 4.1.0)
RcppProgress   0.4.2   2020-02-06 [1] CRAN (R 4.1.0)

I also get an occasional crash / abort of RStudio which suggests there's an index out of range issue somewhere, but I can't track this down*.

phewson commented 2 years ago

Are you a minor version of Rcpp behind? It's at 1.0.7 now and that precious_remove is a function that's been added rather than removed.

dcooley commented 2 years ago

@phewson indeed! yes that was the issue. Thanks for pointing it out.

Does this need to be added to the imports do you think?