If this has already been answered, my apologies in advance I am relatively new to this aspect of [R]. it is a bit of a basic question.
I have 4 columns of data (site, Date, measurement type, value) in a tab delimited text file. Site is a site where measurements were collected, Date is a date in DD/MM/YYYY format, measurement is a code for the type of measurement made, and value just the value observed. So each site has multiple dates on which it was sampled and each date has multiple measurement types (fortunately only one value per measurement type per day). I want to know how I can separate this into multiple columns by measurement type averaged over the range of dates available. The output would have a single averaged measurement value per site. Site, Measurement 1, measurement2, measurement3, etc. I have been reading it in as a matrix as.matrix(read.table("myfile.txt", headers=TRUE)), but I don't quite know what to do with it afterward. Thanks [[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.