Dates and DateTimes with lubridate

Поделиться
HTML-код
  • Опубликовано: 18 сен 2024

Комментарии • 13

  • @gabrielmurarideandrade5755
    @gabrielmurarideandrade5755 2 года назад

    Thanks a lot! From UTC -3 :D

  • @amitbidlan8930
    @amitbidlan8930 3 года назад

    Thank You for this beautiful Session.

  • @noahsalazar2738
    @noahsalazar2738 2 года назад

    Great video, thank you for making this.

  • @manny1manito2
    @manny1manito2 2 года назад

    From Hadley's book. (In case you were wondering, “POSIXct” stands for “Portable Operating System Interface”, calendar time)

  • @Mahesh-yn6kz
    @Mahesh-yn6kz 2 года назад

    Very informative video

  • @MrKamilof4
    @MrKamilof4 2 года назад

    Hey Kelly
    I have the date column => 19/02/2001, and it is a character class. How can I convert it to Feb 2001?
    Thank you

    • @SuperKrazy2000
      @SuperKrazy2000  2 года назад +1

      If you use
      dat %>%
      mutate(
      date = lubridate::dmy(date)
      )
      Your column will be understood as a datetime object. If you wanted to bring it back to a String, but just say "Feb 2001", I'd do this:
      library(lubridate)
      dat %>%
      mutate(
      date = dmy(date),
      date_string = paste(month(date), year(date)
      )

    • @MrKamilof4
      @MrKamilof4 2 года назад

      @@SuperKrazy2000 Thank you!

  • @ahmed007Jaber
    @ahmed007Jaber 2 года назад

    Thank u for this. How to get previous working day date? Week starting on sunday and end on thurs day from 1 sep 2020 todate

    • @theecanmole
      @theecanmole Год назад

      Go back in time in Dr Who's TARDIS of course!

  • @michaelbeia1163
    @michaelbeia1163 2 года назад

    Many thanks for thi vids ! But I need help, how can I generate semester variable using an other date variable ?

    • @SuperKrazy2000
      @SuperKrazy2000  2 года назад

      As in, you'd like to make a variable marking the semester as "Fall", "Spring" or "None"?
      I'd do this:
      dat %>%
      mutate(
      semester = case_when(
      month(date) < 5 ~ "Spring",
      month(date) > 8 ~ "Fall" ,
      TRUE ~ "Summer"
      )
      )