I've hunted around to try to work this out and cannot find anything aposite, although there are exhortations to read News files and the fine manual in response to similar queries. Hope I haven't missed anything obvious. I want to read in csv files that contain dates, or date times. If I read them in directly: x <- read.csv ("file") the relevant dataframe column is of type string. It would be nice to read in in one go, but not necessary. If I parse the data and then try to overwrite the original column of the data frame: y <- strptime (x$datefield, "%d/%m/%Y") x$datefield <- y I get an error: Error in `$<-.data.frame`(`*tmp*`, "datefield", value = list(sec = c(0, : replacement has 9 rows, data has 16 y has 16 values, as does x$datefield. I'm sure that this is a common problem. Has anyone got any pointers? tia Tim This email and any attachment may contain confidential, privileged information for the sole use of the intended recipient. If you are not the intended recipient, do not disclose, reproduce, disseminate or otherwise use this communication. If you received this communication in error, please immediately notify the sender via email and delete the communication from your system. Company information : Tideway Systems Ltd, Registered Office: Anchor House, 15-19 Britten Street, London, SW3 3TY. Registered in England & Wales Reg. Reg. No: 4598072 VAT No: 805 5153 50
[[alternative HTML version deleted]] ______________________________________________ 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.