Jump to content
Ornithology Exchange
  • 0
egow

Error message with lightImage and preprocessLight

Question

I'm trying to calibrate from a light image from a Bas tag. I get an error when I call: lightImage(d.lux, offset = offset) and twlpreprocessLight(d.lux, threshold, offset, lmax = 64, map=TRUE)

 

This is the error I get: 

 

Error in if (as.numeric(tmin) > as.numeric(date[1])) tmin

  missing value where TRUE/FALSE needed
 
I'm not sure why I'm getting this error. I have about 23 .lig files that give me this error. The others seem to work. When I look at the .lig files I don't see any differences between the ones that are working and the ones that are not. 
 
Anyway to fix this? I'm not able to process the geol data without this working. 
 
Thanks in advance. 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hi Egow,

 

I believe I received the same error whenever I was trying to process my .lig files. I think the error occurs because the preprocesslight function is looking for tagdata that only has a column for Date and Light, but the .lig files give you four columns. I was able to remedy the situation by using:

Lig<-readLig("file.lig")
Bird<-Lig[,c(-1,-3)]

This way the .lig file that you are using for the preprocess light function only has the Date and Light column that is required. 

 

I'm not sure if you are having the same problem that i was having but this worked for me.

 

Hope this helps,

Devin

Share this post


Link to post
Share on other sites
  • 0

Hi,

 

It could indeed be that there are too many columns but most likely the columns have the same name. They need to be "Date" and "Light" (with capital 1st letter).

 

Another issue could be, that the time format is not right. Best to see check str(Lig) and head(Lig) to see whether it all makes sense.

 

ALSO, there is a package that is based on BAStag but has some further developments and bug fixes (e.g. TwGeos - github.com/slisovski/TwGeos).

 

Cheers,

Simeon

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×