ScottClaessens / coevolve

coevolve R package for Bayesian dynamic coevolutionary models using Stan
GNU General Public License v2.0
7 stars 0 forks source link

Tibbles not accepted #34

Closed ScottClaessens closed 2 months ago

ScottClaessens commented 2 months ago

The package fails when using tibbles rather than data frames as input.

library(ape)
library(coevolve)
library(tidyverse)
set.seed(1)
n <- 10
tree <- rcoal(n)
d <- tibble(
  id = tree$tip.label,
  x = rnorm(n),
  y = rnorm(n)
  )
m <- coev_fit(
  data = d,
  variables = list(
    x = "normal",
    y = "normal"
  ),
  id = "id",
  tree = tree
)
Error in `[.data.frame`(data, , id) : undefined columns selected

Tibbles should be converted to data frames at the beginning of the workflow.

ScottClaessens commented 2 months ago

Fixed in f631520. The above code now runs normally.