Jump to content
Ornithology Exchange
Hendrik

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

Recommended Posts

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

Share this post


Link to post
Share on other sites

 Hi Hendrik,

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

  Eldar

Share this post


Link to post
Share on other sites

  Issue solved with FLightR>=0.4.7

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

×
×
  • Create New...