datastorm-open / visNetwork

R package, using vis.js library for network visualization
Other
539 stars 126 forks source link

Test "highlight_combinaison.R" fails on Debian #298

Open mr-c opened 5 years ago

mr-c commented 5 years ago

Hello,

Thank you for your open source software. While packaging it for Debian I ran into the following failed test. I'm not an R developer, so let me know if I'm missing something basic.

BEGIN TEST highlight_combinaison.R

R version 3.5.2 (2018-12-20) -- "Eggshell Igloo"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> # simple nodes, passing some information individually
> nodes <- data.frame(id = 1:5, color = c("blue", NA, "green", NA, NA))
> 
> edges <- data.frame(from = trunc(runif(5)*(5-1))+1,
+                     to = trunc(runif(5)*(5-1))+1)
> 
> visNetwork(nodes, edges) %>% 
+   visOptions(highlightNearest = list(enabled = T, degree = 1, hover = F))
Error in visNetwork(nodes, edges) %>% visOptions(highlightNearest = list(enabled = T,  : 
  could not find function "%>%"

This is from the CRAN 2.0.5 release of visNetwork

julianstanley commented 4 years ago

Looks like the description now requires magrittr--which is the package where the %>% comes from. So that error should be fixed now? Otherwise, just calling library(magrittr) should get the example to run.