Hi:

Please provide a minimal reproducible example that resembles your real data
so that people can try it out and provide potential solutions for you. Show
what you tried that failed, and what you expect. A number of people on this
list are very adept in data summarization, but most of them are loath to
provide abstract solutions unless the problem is crystal clear.

On Thu, Sep 23, 2010 at 8:41 PM, Thomas Parr <thomasbp...@gmail.com> wrote:

> 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.
>
>
> This suggests you may need to reshape your data first.

>
> Site, Measurement 1, measurement2, measurement3, etc.
>
>
> Matrices are OK, data frames are usually better.


> 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.
>
> There are several functions/packages that are more than capable of solving
your problem, but it would be a lot easier and more productive if you
provide a concrete example.

HTH,
Dennis

>
>
> 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.
>

        [[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.

Reply via email to