Hi everybody, I'm a beginner in R and I'm having a hard time grouping my data by day. The data are in this format:
id; words 2005-07-07T09:59:56Z; 35 2005-07-07T10:01:39Z; 13 2005-07-08T10:02:22Z; 1 2005-07-09T10:03:16Z; 23 2005-07-10T10:04:23Z; 39 2005-07-10T10:04:39Z; 15 I've transformed the date strings in dates with the function: london$id <- transform(london$id, as.Date(london$id, format="%Y-%m-%d%T%H:%M:%S%Z")) and it seems to work. Now I would like to add a new "day" variable to group data by day, like this: id; words; day 2005-07-07T09:59:56Z; 35; 1 2005-07-07T10:01:39Z; 13; 1 2005-07-08T10:02:22Z; 1; 2 2005-07-09T10:03:16Z; 23; 3 2005-07-10T10:04:23Z; 39; 4 2005-07-10T10:04:39Z; 15; 4 How can I do that? Many thanks! Michela ______________________________________________ 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.