Hi R, I have two columns of date in a CSV file in the below format 29-Dec-06 25-Jan-07 29-Dec-06 25-Jan-07 29-Dec-06 25-Jan-07 2-Jan-07 25-Jan-07 2-Jan-07 25-Jan-07 2-Jan-07 25-Jan-07
I read in R using dat<-read.csv("Z:\\data.csv"). > class(dat[,1]) [1] "factor" So I use dat[,1]=as.Date(as.character(dat[,1]),"%d-%b-%YY") > class(dat[,1]) [1] "Date" But when I do > fix(dat) Warning: class discarded from column 'Date' Also > dat[1,1] [1] NA My task is to compute the number of trading days between the two dates in col A and Col B. Any help would be appreciated! Thank you, Ravi Shankar S This e-mail may contain confidential and/or privileged i...{{dropped:10}} ______________________________________________ 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.