Create a column with the classification day or night
This post is to create a column day or night.
For the exercises, test data is from masked boobies.
To access
the data you have to install the package sula:
devtools::install_github(“MiriamLL/sula”)
#devtools::install_github("MiriamLL/sula")
library(sula)
GPS01<-(GPS_01)
Identify column with time date data
GPS01$dt <- as.POSIXct(strptime(GPS01$tStamp, "%Y-%m-%d %H:%M:%S"))
Once is in time and date format, you can extract just the hours
GPS01$hour <- as.numeric(substr(GPS01$dt, 12, 13))
Create a classification base on the time of sunset and sunrise.
Now you can quantify how much your animals were out at night
# A tibble: 1 × 2
day night
<int> <int>
1 645 393
I hope this might help you
Classify activities at night in penguins