gdauby / ConR

ConR
https://gdauby.github.io/ConR/
13 stars 3 forks source link

removed from Cran? #37

Open justybob opened 10 months ago

justybob commented 10 months ago

I typically use ConR every fall for a yearly analysis. Unfortunately, when reloading my script, it appears ConR has been removed from CRAN? I get error messages about rtools and ConR are not compatible with the 4.3 version of R. Will there be an update?

gdauby commented 10 months ago

Hello yes, the new version is on his way but still only on github. You can download it from github Please find the information here : https://github.com/gdauby/ConR

However this is a massive update. Some of your code will be probably broken (some functions do not exist anymore, including the function IUCN.eval, new functions have been added). Please do not hesitate to ask here if you have any doubt on how to convert your code.

justybob commented 10 months ago

@gdauby thanks!! I was able to load and use some functions. Retracing my code and using your vignette ConR for beginner (https://gdauby.github.io/ConR/articles/articles/ConR_beg.html), I am having an issue with the plotting function within R and the shapefile polygon results. This occurs with my data and the 'datset.ex. ' Forgive me if I'm missing something obvious, the plotting code has changed, or if this is no longer a function. Here is an examples with my dataset:

EOO.computing(clarkella) |===============================================================================================================| 100%Linking to GEOS 3.11.2, GDAL 3.7.2, PROJ 9.3.0; sf_use_s2() is TRUE

            tax    eoo issue_eoo

1 Andrena clarkella 352430 NA

EOO.computing(clarkella, export_shp = T) |===============================================================================================================| 100% $results tax eoo issue_eoo 1 Andrena clarkella 352430 NA

$spatial Simple feature collection with 1 feature and 1 field Geometry type: POLYGON Dimension: XY Bounding box: xmin: -159.0037 ymin: 57.8353 xmax: -144.4028 ymax: 67.1002 Geodetic CRS: WGS 84 tax geometry 1 Andrena clarkella POLYGON ((-144.4943 61.6315...

EOO.results <- EOO.computing(clarkella, export_shp = T) |===============================================================================================================| 100% plot(EOO.results$spatial.polygon_1, col="grey") Error in plot.window(...) : need finite 'xlim' values In addition: Warning messages: 1: In min(x) : no non-missing arguments to min; returning Inf 2: In max(x) : no non-missing arguments to max; returning -Inf 3: In min(x) : no non-missing arguments to min; returning Inf 4: In max(x) : no non-missing arguments to max; returning -Inf

I can successfully write the shapefiles to a directory folder. When I import the shapefile into ArcGIS Pro, the shapefile has the expected alphal hull, however the polygon is a donut instead of a solid polygon. Thanks for your help and writing a great program. It's a very helpful tool to conduct my job in conservation rankings.

gdauby commented 10 months ago

Can you make sure you are working with the version 2.1 ? help(package="ConR")

If so, the vignette online concerns the version 1.3 and is thus not appropriate for that version.

If you do not have the version 2.1, please install it using : devtools::install_github("gdauby/ConR")

Then here is a reproducible example for what you want to do:

library(ConR)

dataset <- dummy_dist()

eoo_res <- EOO.computing(XY = dataset, export_shp = T)

plot(eoo_res$spatial, col = "grey")
fontikar commented 7 months ago

Hi @gdauby thanks for creating such a useful package! :wave: I have been using IUCN.eval to generate alpha hulls from point occurrence data which is then used for endemism analysis.

I noticed this function no longer works and has been removed from the most updated version of ConR. Can you kindly please point me to another function that might have alpha hull generation capabilities?

My old workflow lives here if you are curious 🐌

Thanks again and looking forward to your advice! 🙏

gdauby commented 6 months ago

Hello

Below on example with EOO.computing function. Is it what you want to do ?

There might be a bug in the output tough. The spatial output seems odd. I'll try to find time to check this out.

dataset <- dummy_dist(nsp = 1, max_occ = 30)

alphas <- EOO.computing(XY = dataset, method.range = "alpha", export_shp = TRUE, alpha = 3)

plot(alphas$spatial)

alphas <- EOO.computing(XY = dataset, method.range = "alpha", export_shp = TRUE, mode = "planar", alpha = 300, buff.alpha = 30)

plot(alphas$spatial)
fontikar commented 6 months ago

Hi @gdauby thanks for a quick reply! Let me try this out and get back to you :)

gdauby commented 6 months ago

There is currently a bug in the abovementioned function EOO.computing as the polygon created is not filled. I am working on it.