SachaEpskamp / bootnet

Bootstrap methods for various network estimation routines
30 stars 14 forks source link

Error with dplyr::bind_rows() #125

Closed emafin closed 9 months ago

emafin commented 9 months ago

I am trying to estimate centrality statistics but I keep getting the error:

in `dplyr::bind_rows()`:
! Can't combine `..1$node2` <integer> and `..3$node2` <character>.

I have re-installed both dplyr/tidyverse and bootnet (including the latest version from github) and I am currently running v. 1.5.6, but the error is still there. I am including a reproducible example, below. Thank you in advance for any help you may be able to offer.

# Load packages
library(bootnet)
library(tidyverse)

# Estimate network
net <- mtcars %>% 
  select(disp, hp, drat, wt) %>% 
  estimateNetwork(., default = "EBICglasso", threshold = TRUE, corMethod = "spearman")

# Centrality statistics
centr <-
  net %>%
  bootnet(.,
          nBoots = 100,
          default = "EBICglasso",
          type = "nonparametric",
          labels = colnames(.),
          statistics = "all",
          useCommunities = "all",
          communities = c("A", "A", "B", "B"))
emafin commented 9 months ago

Sorry, the problem was colnames(.) from a previous run, removing it solved.