AustralianAntarcticDivision / SOmap

Southern Ocean round maps
https://australianantarcticdivision.github.io/SOmap/
24 stars 6 forks source link

Error in default line #101

Closed DorienA closed 2 years ago

DorienA commented 2 years ago

Dear, I get an error when trying to create a basemap using the SOmap package.

I loaded the package using 'remotes' and it all worked fine. install.packages("remotes") remotes::install_github("AustralianAntarcticDivision/SOmap")

I've asked a colleague of mine to try the script as well and she got the same error.

basemap <- SOmap(trim = ceiling(max(Cobesa$decimalLatitude))+1, bathy_legend = T, graticules = T,

  • fronts_col = front_col, fronts = T, border_width = 0.8, land_col = "grey44", ice_col = "grey44")

Error in seq.default(from = -90, to = trim - 1, by = 15) : 'to' must be a finite number

The error is not in the command line we used, we think it is in the pipeline somewhere.

In February I ran the exact same script and it all worked fine. Maybe it's an update in a package, but we don't know how to solve this problem.

Can you help me out? :)

Thank you in advance. Dorien Aerts

raymondben commented 2 years ago

Hi @DorienA - would you mind pasting the output of max(Cobesa$decimalLatitude) please? I suspect it's NA - in which case try basemap <- SOmap(trim = ceiling(max(Cobesa$decimalLatitude, na.rm = TRUE))+1, .... Otherwise I'll look more closely tomorrow.

DorienA commented 2 years ago

Cobesa$decimalLatitude [1] -62.117 -62.117 -62.117 -62.117 -62.117 -62.117 -62.117 -62.117 -62.121 -62.117 -62.117 -62.117 -62.162 -64.854 -64.321 [16] -64.843 -64.843 -65.328 -64.548 -64.021 -62.158 -66.618 -66.602 -66.667 -63.622 -66.680 -66.667 -66.665 -63.984 NA [31] NA NA NA NA NA NA NA NA NA NA NA

So it's NA where the data stops. But I've used this file before and didn't get this error

raymondben commented 2 years ago

Does

basemap <- SOmap(trim = ceiling(max(Cobesa$decimalLatitude, na.rm = TRUE))+1, bathy_legend = T, graticules = T,
                 fronts_col = front_col, fronts = T, border_width = 0.8, land_col = "grey44", ice_col = "grey44")

fix it?

DorienA commented 2 years ago

Hi,

Yes it did fix it, but when I tried to actually plot the occurrences, I got the same problem, tried it with 'na.rm = TRUE' but didn't work. I ended up subsetting my dataset to remove all the NA's. This solved the problem. :)

Thank you for your help