Skip to content

time_wrap creates error "Incompatible classes: <numeric> %% <Period>" #48

@EamonnMallon

Description

@EamonnMallon

Hi,

I'm having this problem analysing my own data. I managed to recreate it with the example given in https://rethomics.github.io/ggetho.html

library(damr)
library(dplyr)
library(lubridate)
library(ggetho)
library(ggplot2)
library(sleepr)
library(zeitgebr)

metadata_test <- data.table(id=sprintf("toy_experiment|%02d" , 1:40), region_id=1:40,
                       condition=c("A","B"),
                       sex=c("M","M", "F", "F"))
dt <- toy_activity_data(metadata_test, seed=107)
ggetho(dt, aes(x=t, y=moving, colour=sex)) + stat_pop_etho()#this command works fine
ggetho(dt, aes(x=t, y=moving), time_wrap = hours(24)) + stat_pop_etho()

I then get this error

Error: Incompatible classes: <numeric> %% <Period>

As this is happening with the toy example, I assume it is something to do with other packages perhaps lubridate?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions