Jump to content


Photo

LightImage function error

FLightR Geolocator LightImage

Best Answer Eldar , 17 October 2017 - 02:05 AM

  Hi Louise,

 Check the last value in your file:

tail(d.lux)

it is likelyt that there is NA value somehow.

 If not send me and Simeon your file and the code you have before the error.

   Eldar

Go to the full post


  • Please log in to reply
2 replies to this topic

#1 Louise de Raad

Louise de Raad
  • General Members
  • 13 posts
  • Inverness,
  • United Kingdom

Posted 16 October 2017 - 05:55 AM

I have run the LightImage function as part of the FLightR script many times without any issues, but recently it "stopped working". I have updated various packages, R studio and R versions, but I don't see why I'm now getting the error I do.

 

> d.lux$Light<- log(d.lux$Light)
> head(d.lux)
Date Light
1 2013-04-20 15:14:01 6.302619
2 2013-04-20 15:19:01 5.159055
3 2013-04-20 15:24:01 5.257495
4 2013-04-20 15:29:01 5.594711
5 2013-04-20 15:34:01 5.181784
6 2013-04-20 15:39:01 4.663439

> lightImage(tagdata = d.lux,
+ offset = offset,
+ zlim = c(0, 12), # y axis
+ dt = 300) # recording interval in seconds (300 if every 5min)
Error in if (as.numeric(tmax) < as.numeric(date[length(date)])) tmax <- tmax + :
missing value where TRUE/FALSE needed

 

> sessionInfo()
R version 3.4.2 (2017-09-28)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] grid stats graphics grDevices utils datasets methods
[8] base

other attached packages:
[1] maptools_0.9-2 sp_1.2-5 MASS_7.3-47 SGAT_0.1.3
[5] TwGeos_0.0-1 GeoLight_2.0.0 maps_3.2.0 FLightR_0.4.6
[9] BAStag_0.1.3

loaded via a namespace (and not attached):
[1] Rcpp_0.12.13 lattice_0.20-35 changepoint_2.2.2 zoo_1.8-0
[5] spam_2.1-1 coda_0.19-1 raster_2.5-8 tools_3.4.2
[9] foreign_0.8-69 fields_9.0 compiler_3.4.2 dotCall64_0.9-04  
>

 

Any thought? Many thanks, Louise



#2 Eldar

Eldar
  • General Members
  • 47 posts
  • Netherlands,
  • Netherlands

Posted 17 October 2017 - 02:05 AM   Best Answer

  Hi Louise,

 Check the last value in your file:

tail(d.lux)

it is likelyt that there is NA value somehow.

 If not send me and Simeon your file and the code you have before the error.

   Eldar



#3 Louise de Raad

Louise de Raad
  • General Members
  • 13 posts
  • Inverness,
  • United Kingdom

Posted 25 October 2017 - 01:32 AM

Hi Eldar, thanks for your tip. Indeed the .lux file was corrupted and had a range of NA values further down. The function worked ok for the other files.







Also tagged with one or more of these keywords: FLightR, Geolocator, LightImage

0 user(s) are reading this topic

0 members(s), 0 guests(s) and 0 anonymous member(s)