On Sun, 29 Aug 2021, Jeff Newmiller wrote:

The general idea is to create a "grouping" column with repeated values for
each day, and then to use aggregate to compute your combined results. The
dplyr package's group_by/summarise functions can also do this, and there
are also proponents of the data.table package which is high performance
but tends to depend on altering data in-place unlike most other R data
handling functions.

Also pay attention to missing data... if you have any then you will need
to consider whether you want the strictness of na.rm=FALSE or
permissiveness of na.rm=TRUE for your aggregation functions.

Jeff,

Thank you. Yes, there are missing data as sometimes the equipment fails, or
there's some other reason why some samples are missing.

Grouping on each day is just what I need. I'll re-learn dplyr and take a
look at data.table.

Regards,

Rich

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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