[R] Converting POSIXct format date to Character format

Bert Gunter bgunter@4567 @end|ng |rom gm@||@com
Thu Mar 25 02:40:49 CET 2021


What package is select() in?

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Wed, Mar 24, 2021 at 4:42 PM Jeff Newmiller <jdnewmil using dcn.davis.ca.us>
wrote:

> Please don't reply to a thread to start a new question... create a new
> email to avoid linking your question with the one you replied to.
>
> On March 24, 2021 12:11:07 PM PDT, e-mail ma015k3113 via R-help <
> r-help using r-project.org> wrote:
> >I have a data frame "PLC" which has two variables Year_END_Date   EPS
> >
> >YEAR_END_Date     EPS
> >2010-09-10        .10
> >2009-08-10        .20
> >
> >When I tried to convert Year_END_Date to character format using
> >
> >select(PLC, format(Year_END_Date,format = "%B %d, %Y"), EPS) I get an
> >error
> >
> >Error: Can't subset columns that don't exist.
> >x Column `Year_END_Date` doesn't exist.
> >
> >I tried using
> >
> >PLC_1 <- select(PLC, as.character(YEAR_END_DATE), EPS)
> >
> >I get the following error
> >
> >Error: Can't subset columns that don't exist.
> >x Columns `2010-09-30`, `2009-09-30`, `2008-09-30`, `2007-09-30`,
> >`2006-09-30`, etc. don't exist.
> >Run `rlang::last_error()` to see where the error occurred.
> >
> >Can anyone please guide me what is happening and how can I resolve it?
> >
> >______________________________________________
> >R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >https://stat.ethz.ch/mailman/listinfo/r-help
> >PLEASE do read the posting guide
> >http://www.R-project.org/posting-guide.html
> >and provide commented, minimal, self-contained, reproducible code.
>
> --
> Sent from my phone. Please excuse my brevity.
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list