[R] "2013-06-28" coverts to 15884?

Pascal Oettli kridox at ymail.com
Thu Mar 20 00:25:00 CET 2014


Hello,

It works for me:

R> MaxUpdated_row <- NULL
R> MaxUpdated_val <- "2013-06-28"
R>
R>
R> rbind(MaxUpdated_row, as.Date(MaxUpdated_val, "%Y-%m-%d"))
      [,1]
[1,] 15884
R> c(MaxUpdated_row, as.Date(MaxUpdated_val, "%Y-%m-%d"))
[1] 15884
R> c(MaxUpdated_row, MaxUpdated_val)
[1] "2013-06-28"
R>

Regards,
Pascal

On Thu, Mar 20, 2014 at 6:46 AM, Jason Rupert <jasonkrupert at yahoo.com> 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))
>
> Any alternatives suggestions are much appreciated.
>         [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at 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.
>



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan




More information about the R-help mailing list