tag:blogger.com,1999:blog-4890093519663715581.post6488250667931114364..comments2023-10-22T08:30:53.073-07:00Comments on Species In Space: The new R version of ENMTools is in the works! Here's how to build an enmtools.species object.Dan Warrenhttp://www.blogger.com/profile/07528161395964087899noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-4890093519663715581.post-75142689527563293702020-02-09T18:09:51.251-08:002020-02-09T18:09:51.251-08:00That's weird, it should be able to handle that...That's weird, it should be able to handle that. I'll look into it.Dan Warrenhttps://www.blogger.com/profile/07528161395964087899noreply@blogger.comtag:blogger.com,1999:blog-4890093519663715581.post-10022564397612589072020-02-07T13:05:54.723-08:002020-02-07T13:05:54.723-08:00I think it is sorted. It looks like putting the La...I think it is sorted. It looks like putting the Latitude values before the Longitude values caused my issues. NA Cairnshttps://www.blogger.com/profile/00727976228050374652noreply@blogger.comtag:blogger.com,1999:blog-4890093519663715581.post-36277058110621461602020-02-07T10:59:37.594-08:002020-02-07T10:59:37.594-08:00I clipped the environmental layers and that point ...I clipped the environmental layers and that point is well outside of the study area. I think the intersection was driven by the fact I was using one of my environmental layers as my mask which I've rectified (no longer getting that error)but I'm still not getting any background points but no error at all. <br /><br />env20<-raster("mn30_100.asc")<br />env1<-raster("na_chelsa_bio10_1.tif100clip.asc")<br />env2<-raster("na_chelsa_bio10_2.tif100clip.asc")<br />env3<-raster("na_chelsa_bio10_3.tif100clip.asc")<br />env4<-raster("na_chelsa_bio10_4.tif100clip.asc")<br />env5<-raster("na_chelsa_bio10_5.tif100clip.asc")<br />env6<-raster("na_chelsa_bio10_6.tif100clip.asc")<br />env7<-raster("na_chelsa_bio10_7.tif100clip.asc")<br />env8<-raster("na_chelsa_bio10_8.tif100clip.asc")<br />env9<-raster("na_chelsa_bio10_9.tif100clip.asc")<br />env10<-raster("na_chelsa_bio10_10.tif100clip.asc")<br />env11<-raster("na_chelsa_bio10_11.tif100clip.asc")<br />env12<-raster("na_chelsa_bio10_12.tif100clip.asc")<br />env13<-raster("na_chelsa_bio10_13.tif100clip.asc")<br />env14<-raster("na_chelsa_bio10_14.tif100clip.asc")<br />env15<-raster("na_chelsa_bio10_15.tif100clip.asc")<br />env16<-raster("na_chelsa_bio10_16.tif100clip.asc")<br />env17<-raster("na_chelsa_bio10_17.tif100clip.asc")<br />env18<-raster("na_chelsa_bio10_18.tif100clip.asc")<br />env19<-raster("na_chelsa_bio10_19.tif100clip.asc")<br /><br />env= c(env20+env1+env2+env3+<br /> env4+env5+env6+env7+env8+<br /> env9+env10+env11+env12+env13+<br /> env14+env15+env16+env17+env18+env19)<br /><br />#Add taxa<br />PcruWEST = enmtools.species()<br />PcruWEST$species.name = "PcruWEST"<br />PcruWEST$presence.points = read.csv("WEST_Occ.csv")<br />PcruWEST$presence.points<br />#background.points.buffer(points, radius(in m), n, mask(could add the 100 km buffer clip but the input layers have already been clipped))<br />#If you need to load a raster<br />mask<-raster("./WEST_ENM.asc")<br />PcruWEST$range=mask<br />PcruWEST$background.points = background.points.buffer(PcruWEST$presence.points, 1000, 1000, mask)<br />PcruWEST$background.points<br />PcruWEST<br /><br />> PcruWEST<br /><br /><br />Range raster: <br />class : RasterLayer <br />dimensions : 1516, 1338, 2028408 (nrow, ncol, ncell)<br />resolution : 0.008333333, 0.008333333 (x, y)<br />extent : -97.45014, -86.30014, 28.48319, 41.11653 (xmin, xmax, ymin, ymax)<br />crs : NA <br />source : /home/nick/PhD/Chapter3_niche/Identity_test/WEST_ENM.asc <br />names : WEST_ENM <br /><br /><br /><br />Presence points (first ten only): <br /><br />| Latitude| Longitude|<br />|--------:|---------:|<br />| 40.17635| -92.64996|<br />| 39.00611| -90.56444|<br />| 38.97013| -92.20568|<br />| 38.75396| -92.20121|<br />| 38.70809| -94.61945|<br />| 38.62674| -90.30794|<br />| 38.47334| -90.82132|<br />| 38.41859| -94.79507|<br />| 38.21999| -94.66727|<br />| 38.14752| -91.03752|<br /><br /><br />Background points (first ten only): <br /><br />| Latitude| Longitude|<br />|--------:|---------:|<br /><br /><br />Species name: PcruWEST<br /><br />> PcruWEST$background.points<br />[1] Latitude Longitude<br /><0 rows> (or 0-length row.names) NA Cairnshttps://www.blogger.com/profile/00727976228050374652noreply@blogger.comtag:blogger.com,1999:blog-4890093519663715581.post-75434499275531574312020-01-27T14:06:12.647-08:002020-01-27T14:06:12.647-08:00If you extract the environmental values at that po...If you extract the environmental values at that point, do you get anything? It could just be a bad point.Dan Warrenhttps://www.blogger.com/profile/07528161395964087899noreply@blogger.comtag:blogger.com,1999:blog-4890093519663715581.post-55509779613580455552020-01-27T13:57:23.884-08:002020-01-27T13:57:23.884-08:00Is there a way to upload my inputs?
Is there a way to upload my inputs?<br />NA Cairnshttps://www.blogger.com/profile/00727976228050374652noreply@blogger.comtag:blogger.com,1999:blog-4890093519663715581.post-85593648105442840652020-01-22T09:52:14.693-08:002020-01-22T09:52:14.693-08:00I'm running into an issue which appears to be ...I'm running into an issue which appears to be related to my use of the background.points.buffer() function. I'm pretty sure I set up my species as suggested in the vignette provided here but I consistently get a error about self intersecting points: <br /><br />PcruWEST = enmtools.species()<br />PcruWEST$species.name = "PcruWEST"<br />PcruWEST$presence.points = read.csv("WEST_Occ.csv")<br />mask<-raster("mn30_100.asc")<br />PcruWEST$background.points = background.points.buffer(PcruWEST$presence.points, 20000, 1000, mask)<br /><br />Error in rgeos::gUnaryUnion(ci@polygons) : <br /> TopologyException: Input geom 0 is invalid: Self-intersection at or near point -118.5263168301187 -89.984997726323087 at -118.5263168301187 -89.984997726323087<br /><br /><br />The error cite the same location each time. I can add the range in but still get an rgeos error. If I shrink my buffer to say 1000m I don't get an error but also I don't get the mask defined or any background points.<br /><br /><br />Range raster: <br />class : Raster<br />Layer dimensions : 1516, 1338, 2028408 (nrow, ncol, ncell) resolution : 0.008333333, 0.008333333 (x, y) <br />extent : -97.45014, -86.30014, 28.48319, 41.11653 (xmin, xmax, ymin, ymax) <br />crs : NA <br />source : /home/nick/PhD/Chapter3_niche/Identity_test/mn30_100.asc <br />names : layer <br />Presence points (first ten only): <br /> Latitude| Longitude| <br />|--------:|---------:| <br />| 36.12014| -94.88807| <br />| 37.03224| -94.64201| <br />| 35.96949| -94.80963| <br />| 34.61530| -94.63110| <br />| 35.69509| -94.82553| <br />| 35.72999| -94.90363| <br />| 35.73489| -94.53750|<br />| 34.71500| -94.68023| <br />| 34.68991| -94.30057| <br />| 34.61858| -94.77128| <br /><br />Background points (first ten only): <br />| Latitude| Longitude|<br /> |--------:|---------:| <br /><br />Species name: PcruWEST<br /><br /><br />Any idea where this error has come from? Happy to share my inputs if that helps?<br /><br />Thank you for your help and providing this venue.<br />Best,<br />NickNA Cairnshttps://www.blogger.com/profile/00727976228050374652noreply@blogger.comtag:blogger.com,1999:blog-4890093519663715581.post-72890072537333412652020-01-22T09:50:11.239-08:002020-01-22T09:50:11.239-08:00This comment has been removed by the author.NA Cairnshttps://www.blogger.com/profile/00727976228050374652noreply@blogger.comtag:blogger.com,1999:blog-4890093519663715581.post-1477562527427004452020-01-22T09:47:12.979-08:002020-01-22T09:47:12.979-08:00This comment has been removed by the author.NA Cairnshttps://www.blogger.com/profile/00727976228050374652noreply@blogger.comtag:blogger.com,1999:blog-4890093519663715581.post-33501415771770772152017-11-08T04:32:44.922-08:002017-11-08T04:32:44.922-08:00The env in this case was a stack of four environme...The env in this case was a stack of four environmental PC axes.Dan Warrenhttps://www.blogger.com/profile/07528161395964087899noreply@blogger.comtag:blogger.com,1999:blog-4890093519663715581.post-7893959504487381452017-11-03T17:27:51.510-07:002017-11-03T17:27:51.510-07:00What is the "env" that you used?What is the "env" that you used?Unknownhttps://www.blogger.com/profile/07208413471835334874noreply@blogger.comtag:blogger.com,1999:blog-4890093519663715581.post-90027758560458048142017-07-23T06:37:29.952-07:002017-07-23T06:37:29.952-07:00This comment has been removed by the author.Anonymoushttps://www.blogger.com/profile/04572520386514482272noreply@blogger.comtag:blogger.com,1999:blog-4890093519663715581.post-41897186639373238492016-07-28T11:01:54.934-07:002016-07-28T11:01:54.934-07:00This comment has been removed by the author.João de Deus Vidalhttps://www.blogger.com/profile/12615807667937924625noreply@blogger.com