Giter VIP home page Giter VIP logo

Comments (7)

garrettgman avatar garrettgman commented on July 20, 2024

like month(x, string =T) = "January" ?

from lubridate.

garrettgman avatar garrettgman commented on July 20, 2024

Should the settors work the same way?
wday(x) <- "Monday"

from lubridate.

hadley avatar hadley commented on July 20, 2024

Yeah, although label might be a better argument name, and maybe we need abbr as well. month(ymd(080101) + months(1:12), label = T, abbr = T) should return ordered(1:12, labels = c("Jan", "Feb", ... "Dec"))

Hadley

from lubridate.

garrettgman avatar garrettgman commented on July 20, 2024

I wrote it for the accessors but not the settors. So that:

month(ymd(080101) + months(1:12), label = T, abbr = T) returns

[1] "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"
"Jan"

and month(ymd(080101) + months(0:11), label = T, abbr = T) returns

[1] "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"

from lubridate.

garrettgman avatar garrettgman commented on July 20, 2024

so..

from lubridate.

hadley avatar hadley commented on July 20, 2024

We could work the same way for gettors, i.e. month(x, label = T) <- "January", but it might get more complicated with internationalsation. What happens if the French user says month(x, label = T) <- "Janvier" ?

from lubridate.

garrettgman avatar garrettgman commented on July 20, 2024

Well right now it says Error in month<-(*tmp*, label = T, value = 1) :
unused argument(s) (label = T)

Should they have to specify label = T to input "January" ?

I'm not sure how we could anticipate all of the different words for January. We could just look at the first three letters, but that might not always work.

from lubridate.

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.