search for: as_date

Displaying 11 results from an estimated 11 matches for "as_date".

2023 Apr 12
3
converting to date object...
dear members, I want to convert "12 APR 2023" into a Date object. I tried as_Date() from lubridate, but it is not working: > as_date("12 APR 2023") [1] NA Warning message: All formats failed to parse. No formats found. > as_date("12-APR-2023") [1] NA Warning message: All formats failed to parse. No formats found. I am looking for a shorthand way of do...
2018 Jun 08
2
Date class shows Inf as NA; this confuses the use of is.na()
In the following example, the date class shows Inf as NA > as_date(Inf, origin = '1970-01-01') [1] NA This is misleading as is.na() reports incorrectly > is.na(as_date(Inf, origin = '1970-01-01')) [1] FALSE The correct approach here would probably to have an Inf (and -Inf) *displayed* rather than NA. [[alternative HTML version deleted]]
2023 Apr 12
1
converting to date object...
lubridate::dmy("12 APR 2023") On Wed, Apr 12, 2023 at 5:34?PM akshay kulkarni <akshay_e4 at hotmail.com> wrote: > dear members, > I want to convert "12 APR 2023" into a Date > object. I tried as_Date() from lubridate, but it is not working: > > > as_date("12 APR 2023") > [1] NA > Warning message: > All formats failed to parse. No formats found. > > as_date("12-APR-2023") > [1] NA > Warning message: > All formats failed to parse. No formats fo...
2023 Apr 12
1
converting to date object...
...though the internal storage is still a Date class object. Regards, Marc Schwartz On April 12, 2023 at 10:34:26 AM, akshay kulkarni (akshay_e4 at hotmail.com (mailto:akshay_e4 at hotmail.com)) wrote: > dear members, > I want to convert "12 APR 2023" into a Date object. I tried as_Date() from lubridate, but it is not working: > > > as_date("12 APR 2023") > [1] NA > Warning message: > All formats failed to parse. No formats found. > > as_date("12-APR-2023") > [1] NA > Warning message: > All formats failed to parse. No formats fo...
2018 Jun 08
0
Date class shows Inf as NA; this confuses the use of is.na()
> as_date Error: object 'as_date' not found Must be from some not-named package... But don't confuse the format of an object when printed with its underlying value: > as.Date(Inf,origin = '1970-01-01') [1] NA > str(as.Date(Inf,origin = '1970-01-01')) Date[1:1], format:...
2018 Jun 09
4
Date class shows Inf as NA; this confuses the use of is.na()
...have implications in other areas, there is a > possibility of breaking code and it should be investigated a bit further > imho. > Cheers > Joris > > > > > On Fri, Jun 8, 2018 at 11:21 PM, Werner Grundlingh <wgrundlingh at gmail.com> > wrote: > >> Indeed. as_date is from lubridate, but the same holds for as.Date. >> >> The output and it's interpretation should be consistent, otherwise it >> leads >> to confusion when programming. I understand that the difference exists >> after asking a question on Stack Overflow: >>...
2018 Jun 11
0
Date class shows Inf as NA; this confuses the use of is.na()
I don't think there's much wrong with is.na(as_date(Inf, origin='1970-01-01'))==FALSE, as there still is some "non-NA-ness" about the value (as difftime shows), but that the output when printing is confusing. The way cat is treating it is clearer: it does print Inf. So would this be a solution? format.Date <- function (x, ...)...
2018 Jun 08
2
Date class shows Inf as NA; this confuses the use of is.na()
Indeed. as_date is from lubridate, but the same holds for as.Date. The output and it's interpretation should be consistent, otherwise it leads to confusion when programming. I understand that the difference exists after asking a question on Stack Overflow: https://stackoverflow.com/q/50766089/914686 This un...
2018 Feb 12
4
problema de fechas
hola Patricio, usa: dplyr::if_else [[alternative HTML version deleted]]
2018 Jun 11
2
Date class shows Inf as NA; this confuses the use of is.na()
Emil et al., On Mon, Jun 11, 2018 at 1:08 AM, Emil Bode <emil.bode at dans.knaw.nl> wrote: > I don't think there's much wrong with is.na(as_date(Inf, > origin='1970-01-01'))==FALSE, as there still is some "non-NA-ness" about > the value (as difftime shows), but that the output when printing is > confusing. The way cat is treating it is clearer: it does print Inf. > > So would this be a solution? > > fo...
2018 Jun 09
0
Date class shows Inf as NA; this confuses the use of is.na()
...date for an infinite value, but given that this will have implications in other areas, there is a possibility of breaking code and it should be investigated a bit further imho. Cheers Joris On Fri, Jun 8, 2018 at 11:21 PM, Werner Grundlingh <wgrundlingh at gmail.com> wrote: > Indeed. as_date is from lubridate, but the same holds for as.Date. > > The output and it's interpretation should be consistent, otherwise it leads > to confusion when programming. I understand that the difference exists > after asking a question on Stack Overflow: > https://stackoverflow.com/q...