Hi,
Try this:
Dates1<-c("2005-04-01 BST","2005-04-04 BST","2005-04-05 BST")
Dates2<-as.Date(gsub("\\s+\\w+$","",Dates1))
mat1<-matrix(1:9,nrow=3)
library(zoo)
z1<-zoo(mat1,Dates2)
z1
#
#2005-04-01 1 4 7
#2005-04-04 2 5 8
#2005-04-05 3 6 9
#if you use:
mat2<-matrix(1:9,nrow=3)
Thank you Petr!
--
View this message in context:
http://r.789695.n4.nabble.com/Help-with-adding-dates-string-as-rownames-to-matrix-tp4656611p4656617.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
ht
Hi
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of kevj1980
> Sent: Friday, January 25, 2013 11:22 AM
> To: r-help@r-project.org
> Subject: [R] Help with adding 'dates' string as rownames to matrix
>
> Hi, I need help with t
3 matches
Mail list logo