Hi, I was curious about the freq and freqsd variable in my detection data. I believe this is offset from the nominal frequency, and is mainly used for categorizing true or false detections, but I was making plots of it vs signal strength and curious if it could be used for other purposes as well. If anyone knows the units (I don’t think it’s mHz?), could you let me know? Also, I was curious if anyone has a way to keep milliseconds in the timestamps, or if you know if that just isn’t recorded? I’m trying lubridate, which I think doesn’t have milliseconds anymore, and Posixlt, which does, but isn’t working… Thanks! -Gabe
Hi Gabe, the frequency offset is represented in kHz.
The ts is recorded with sufficient precision for milliseconds. It’s essentially everything after the decimal, e.g. 1445858389.9062
It’s preserved when converting the format with lubridate, but isn’t displayed by default. You can force the display by specifying the formatting.
ts <- 1445858389.9062
d <- lubridate::as_datetime(ts)
formatted <- format(d, "%Y-%m-%d %H:%M:%OS3") # For 3 decimal places
print(formatted)
2 Likes
Thank you so much! That worked great!!!
In my code to create a species dataset it looked like this (the line breaks don’t look right, but close):
dataset<-tbl.alltags.onlygood %>%
filter(speciesID ==100270) %>% #change to species of interest
collect() %>%
as.data.frame() %>%
mutate(time=format(as_datetime(ts), "%Y-%m-%d %H:%M:%OS3")) %>%
mutate(pstime = with_tz(time, tzone = "America/Los_Angeles")) %>%
mutate(year = year(time), # extract year from time
doy = yday(time)) %>% # extract numeric day of year from time
filter(!is.na(recvDeployLat))