On 03/20/2014 08:46 AM, Jason Rupert wrote:
MaxUpdated_row<-NULL
MaxUpdated_val<- "2013-06-28"
rbind(MaxUpdated_row, as.Date(MaxUpdated_val, "%Y-%m-%d"))
[,1]
[1,] 15884
c(MaxUpdated_row, as.Date(MaxUpdated_val, "%Y-%m-%d""))
[1] 15884
c(MaxUpdated_row, MaxUpdated_val)
[1] 15884
Evidently, I'm again missing something simple, as I would prefer to be able to
see the actual date to be shown.
I found a work around, but I don't like it, as I have to convert back to date
later:
c(MaxUpdated_row, as.character(MaxUpdated_val))
Hi Jason,
You aren't converting the date to something else, just displaying it as
a character vector by using the format function. Whenever you form a
vector, R tries to convert everything in it to the same data type. If
you _assign_ that vector to something else:
mymax<-c(MaxUpdated_row, as.Date(MaxUpdated_val, "%Y-%m-%d""))
you will have the date type in the MaxUpdated_val and the character type
in mymax.
Jim
______________________________________________
R-help@r-project.org mailing list
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.