Git Product home page Git Product logo

Comments (6)

qgeissmann avatar qgeissmann commented on August 17, 2024

Hi @EamonnMallon,
Thanks for reporting. I will look into that. I am in a bit of a busy time ATM, but should have some time next week. Don't hesitate to update or remind me

from ggetho.

EamonnMallon avatar EamonnMallon commented on August 17, 2024

For info

dt[, phase := ifelse(t %% hours(24) < hours(12), "L", "D")]

creates the same error

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

dt[, phase := ifelse(as.period(t) %% hours(24) < hours(12), "L", "D")]

works.

So I guess it is sometime to do with t being a numeric but timewrap needing period data?

from ggetho.

EamonnMallon avatar EamonnMallon commented on August 17, 2024

dt_curated$t<-as.period(dt_curated$t) # doesn't work

ggetho(dt_curated, aes(y=asleep, colour=as.factor(sugar)), time_wrap = hours(24)) + stat_pop_etho() + stat_ld_annotations() + facet_grid(as.factor(agar) ~ .) + scale_y_continuous(name= "Fraction of time sleeping",labels = scales::percent)

Just trying to change it to period before running the command doesn't work

from ggetho.

EamonnMallon avatar EamonnMallon commented on August 17, 2024
ggetho(dt_curated, aes(y=asleep, colour=sleepDeprived), time_wrap = mins(1440)) +
stat_pop_etho() +
stat_ld_annotations() +
scale_y_continuous(name= "Fraction of time sleeping", limits = c(0,1), labels = scales::percent)

This worked. That is when I expressed the timewrap in minutes. So my issue is completely resolved. Not sure if it was due to my data or a more general problem.

from ggetho.

epetersen-sci avatar epetersen-sci commented on August 17, 2024

I had this issue as well. It comes from a conflict with the lubridate package. I don't load that package anymore and it seems to fix the issue. I'm not sure where lubridate is being used in the rest of the code, but I haven't run into any issues as of yet

from ggetho.

EamonnMallon avatar EamonnMallon commented on August 17, 2024

I'll give that a try as well. Thanks @epetersen-sci

from ggetho.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.