Jump to content
Ornithology Exchange (brought to you by the Ornithological Council)

TWGeos preprocessLight error


Recommended Posts

Hello,

I'm just starting out with analyzing my geolocator data for my Master's thesis. I'm running into some issues when I try to use the preprocessLight function in the TWGeos package and keep running into an error. I'm not exactly sure what the error message means or how I might go about fixing it. I think it has to do with the format of my data, but don't know where to start. Any help would be appreciated. Thanks!

Anna 

 

My dataset:

 

> head(d.lig)
                 Date Light
2 2016-05-26 03:00:21    44
3 2016-05-26 03:02:21    24
4 2016-05-26 03:04:21    24
5 2016-05-26 03:06:21    24
6 2016-05-26 03:08:21    24
7 2016-05-26 03:10:21    24
> str(d.lig)
'data.frame': 300000 obs. of  2 variables:
 $ Date : POSIXct, format: "2016-05-26 03:00:21" "2016-05-26 03:02:21" "2016-05-26 03:04:21" ...
 $ Light: int  44 24 24 24 24 24 24 12 8 10 ...
 
 
The code I run:
 
threshold
 
twl
                       threshold = threshold,
                       offset = 18, 
                       lmax = 12, 
                       zlim = c(0, 12), 
                       dark.min = 240,
                       gr.Device = "default")
 
 
The error message:
 
Error in seq.default(as.numeric(tmin) + dt/2, as.numeric(tmax) - dt/2,  : 
  'from' must be of length 1
 
 
Link to comment
Share on other sites

  • 1 year later...

Hello,

I encountered the same error in one of my geolocator files. What worked for me was to subset the raw data to make sure the dates don't span more than 1 year. My original data file spanned from 6/15/16 to  8/5/17, and I think having >1 year of raw data is what causes that error to pop up. I subsetted my raw data so it only went from 6/15/16 to 6/14/17 and then the preprocessLight function worked.

In my case I only needed the 1 year, so I didn't lose data that I wanted. I suppose if you wanted to cover the whole span that you have and it's more than 1 year, you might have to do it in two chunks (separate your raw data into two dataframes).

I realize this reply is a year after your original post, but I hope this helps in case this has still been a problem. Or at least it can help other folks looking this error up as I did at first just recently.

Best,

Evelien

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...