label_events | R Documentation |
Sometimes it is useful to number events consecutively such as forageing events for a seabird. often times these events have multiple rows per event/bout. This function numbers these evens consecutively by bird and by trip nested within bird.
label_events(dat, BirdID = "CaptureID", TripID = "TripID", eventCol = "forage")
dat |
data.frame of with a minimum of three columns with birdID, tripID from the MakeTrip function and a event column |
BirdID |
a unique ID for each bird |
TripID |
a unique ID for each trip nested within each bird. I.e. birdA has trips 1,2,3; BirdB has trips 1,2,3,4 |
eventCol |
a column with values indicating the presence of an event. Must be in the format 0= no event, 1= event |
A new data frame with all original data plus two new columns: event_bird with numbered events 1:n_vents by bird, and event_trip with numbered events 1:n_events per trip @importFrom dplyr bind_rows
Abram B. Fleishman abram@conservationmetrics.com
Rachael Orben Rachael.Orben@oregonstate.edu
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.