Re: [R] how to create a pivot table in r?

2020-02-14 Thread Bert Gunter
Please read ?tapply *carefully.* Note that in ...,list, simplify = FALSE), "list" is the value of the FUN argument for tapply(). So, in theory, you could replace "list" (without quotes of course) with another function such as max or min to get the latest or earliest date. **Except** that won't wo

Re: [R] how to create a pivot table in r?

2020-02-14 Thread Marna Wagley
Dear Peter and Rui, There are many dates (value) in some of the cells, If we want to chose only one date (either oldest or newest) from that cell, how can we make a table with that condition? For example, Using the following code; M <- with(daT, tapply(as.character(ObsDate), list(id, ObsSite), list