Jump to content


Photo

Error Messages using functions i) map.FLightR.ggmap and ii) plot_util_distr


  • Please log in to reply
3 replies to this topic

#1 Hendrik

Hendrik
  • General Members
  • 14 posts
  • Auckland,
  • New Zealand

Posted 13 March 2017 - 03:45 PM

Dear Eldar,

 

I am sorry for the double post, but I think this got lost in the end of a previous post that was already answered.

 

I receive two error messages when using the functions map.FLightR.ggmap and  plot_util_distr:

 

1. map.FLightR.ggmap

 

 

map.FLightR.ggmap(Result)
Error: longitude of center must be between -180 and 180 degrees. note ggmap uses lon/lat, not lat/lon.
In addition: Warning message:
In min(Result$Results$Quantiles$Medianlon[twilights.index][Result$Results$Quantiles$Medianlon[twilights.index] >  :
  no non-missing arguments to min; returning Inf

 

 

Interestingly this only happens when either using certain grid boundaries for the spatial extent or if the bird under investigation uses certain areas, I am not quite sure what the pattern is.

 

So far I could trigger the error as soon as I extended the right boundary above lon -160 e.g.,

 

Grid<-make.grid(left=160, bottom=-80, right=-140, top=-10,
                distance.from.land.allowed.to.use=c(-Inf, Inf),
                distance.from.land.allowed.to.stay=c(-Inf, Inf))

 

will trigger it while

 

Grid<-make.grid(left=160, bottom=-80, right=-160, top=-10,
                distance.from.land.allowed.to.use=c(-Inf, Inf),
                distance.from.land.allowed.to.stay=c(-Inf, Inf))

 

does not produce an error.

UPDATE: It actually seems  to occur when a position with longitude >-160 (e.g., -140) is plotted! However, it also occurs sometimes if e.g., longitude >-140 is used.

 

 

My feel is that this is also a ggmap related issue and may once again have to do with the dateline.

 

2. running plot_util_distr error

 

I don't think it is related as it is a sp error, but I get an error message when running plot_util_distr:

 

plot_util_distr(Result,
+                 dates=data.frame(as.POSIXct('2016-03-03'), as.POSIXct('2016-08-07')),
+                 add.scale.bar=TRUE, percentiles=0.5)
function will plot 308 twilights
Error in sp::CRS(aeqd) : major axis or radius = 0 or not given

 

 

I am very thankful about your comments on this.

 

All the best and keep up the great work Eldar!,

 

Hendrik



#2 Eldar

Eldar
  • General Members
  • 35 posts
  • Netherlands,
  • Netherlands

Posted 14 March 2017 - 03:37 AM

 Hi Hendrik,

 Looks like dateline issue. Could you send me your results file (via email) and I will have a look.

  Eldar



#3 Eldar

Eldar
  • General Members
  • 35 posts
  • Netherlands,
  • Netherlands

Posted 17 March 2017 - 04:07 AM

  Issue solved with FLightR>=0.4.7



#4 Hendrik

Hendrik
  • General Members
  • 14 posts
  • Auckland,
  • New Zealand

Posted 19 March 2017 - 08:41 PM

Thanks Eldar,

 

 

map.FLightR.ggmap works fine for me now. The plot_util_distr only caused me trouble on my macOS machine, turned out it works fine on windows.

 

Thank you very much for your help Eldar, very much appreciated!

 

Hendrik






0 user(s) are reading this topic

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