Re: [R] Creating a Date Field

2019-09-24 Thread Jim Lemon
Hi Phillip, Try this: as.Date(c("20180329","20180330","20180331"),"%Y%m%d") [1] "2018-03-29" "2018-03-30" "2018-03-31" Note that the format argument has to match the date format exactly. Jim On Wed, Sep 25, 2019 at 9:54 AM Phillip Heinrich wrote: > > The date is imbedded in the GameID characte

Re: [R] Creating a Date Field

2019-09-24 Thread Jeff Newmiller
You are not comparing your character date data with the format string. Specifically there are no spaces in your data but there are in your format string. Any characters in the format string that are not part of % date component specifications must be found in your data. On September 24, 2019 4:

[R] Creating a Date Field

2019-09-24 Thread Phillip Heinrich
The date is imbedded in the GameID character field so I created a date vector with the following code: ari18.test3$date <- substring(ari18.test3$GameID,4,11) And then created a new dataframe with just the Game ID and date vectors. The date field is a character as shown by the str() command. s