A minor suggestion that might help reduce data import issues. Dataframes that have multiple classes cause unmarkedFrameOccu to fail if data.frame is not the first named class -- see example below. Using as.data.frame() solves the issue, but it could also be avoided if unmarkedFrameOccu checked the class of the object differently. The documentation for unmarkedFrameOccu just says that the input should be a dataframe, which fake.df in the example is, so it's not immediately obvious why it doesn't work without as.data.frame().
A minor suggestion that might help reduce data import issues. Dataframes that have multiple classes cause unmarkedFrameOccu to fail if data.frame is not the first named class -- see example below. Using as.data.frame() solves the issue, but it could also be avoided if unmarkedFrameOccu checked the class of the object differently. The documentation for unmarkedFrameOccu just says that the input should be a dataframe, which fake.df in the example is, so it's not immediately obvious why it doesn't work without as.data.frame().
library("dplyr") library("unmarked") fake.df <- data.frame(replicate.1 = 1:2, replicate.2 = 1:2) %>% as.tibble() class(fake.df) # [1] "tbl_df" "tbl" "data.frame" fake.umf <- unmarkedFrameOccu(y = fake.df, obsCov=list(reads=fake.df)) # gives error fake.umf <- unmarkedFrameOccu(y = fake.df, obsCov=list(reads=as.data.frame(fake.df))) # works OK