# pDLA: R function to compute the probability of detecting... In iSDM: Invasive Species Distribution Modelling

## Description

R function to compute the probability of detecting dispersal-limited absences

## Usage

 `1` ```pDLA(occData,envData, longlat=TRUE,nf=5,occNative=NULL,envNative=NULL) ```

## Arguments

 `occData` A SpatialPointsDataFrame as defined in package sp containing species data (a single species) in binary format (ones for presences, zeros for absences) `envData` An abject containing your explanatory variables. Either a SpatialPixelsDataFrame or SpatialGridDataFrame as defined in package sp or a RasterStack or RasterBrick as defined in package raster. Note that this object can contain a mixture of variables type (quantitative, factor and ordered). `longlat` A logic indicating whether point coordinates are projected (longitude-latitude decimal degrees) or not (for plane) (default=TRUE) `nf` If envData contains any factor and ordered variables, the Hill and Smith method will be used to perform an ordination of explanatory variables. nf corresponds in this case to the number of kept axes for the caluluation of mahalanobis distances. `occNative` (optional) a SpatialPoint object containing the occurrences from the native range `envNative` (optional) an object of the same class as envData containing the explanatory variables from the native range

## Details

This function campute the probability of detecting dispersal-limited absences within a network of presence-absence data. It's based on the idea that absences data that are environmentally close but geographically distant to presences data are more likely to be dispersal-limited absences. This function allows combining presence data from both the native and the invaded range, note that in this case the set of presence from the native range will only be added to the set of presences from the invaded range when calculating distances between absences and presences in the environnental space as it does not make sens to add presence data from the native range when calculating these distances within the geographical space.

## Value

Returns a SpatialPointsDataFrame containing the probability values

## References

Tarek Hattab, Carol Ximena Garzon Lopez, Michael Ewald, Sandra Skowronek, Raf Aerts, Helene Horen, Boris Brasseur, Emilie Gallet-Moron, Fabien Spicher, Guillaume Decocq, Hannes Feilhauer, Olivier Honnay, Pieter Kempeneers, Sebastian Schmidtlein, Ben Somers, Ruben Van De Kerchove, Duccio Rocchini and Jonathan Lenoir (2017). A unified framework to model the potential and realized distributions of invasive species within the invaded range. Diversity and Distributions. DOI: 10.1111/ddi.12566

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62``` ```## Not run: library(raster) library(sp) library(virtualspecies) library(colorRamps) envData<-getData('worldclim', var='bio', res=10) envData<-crop(envData,extent(-8,15,38,55)) #Generate virtual species responses with formatfunctions my.parameters <- formatFunctions(bio1 = c(fun = "dnorm", mean = 140, sd = 40), bio5 = c(fun = "dnorm",mean = 230, sd = 70), bio6 = c(fun = "dnorm",mean = 10, sd = 40)) #Generate a virtual species distributions with responses to environmental variables potential.dist <- generateSpFromFun(envData[[c(1,5,6)]], my.parameters) #Limit a virtual species distribution to a defined area. #It will thus generate a species which is not at the equilibrium with its environment realized.dist<-limitDistribution(x=potential.dist\$suitab.raster, area=extent(-8,15,38,48)) #Generate a random presence absence dataset from the realized distribution # using a probability threshold of 0.5 Presence<-coordinates(realized.dist\$occupied.area )[sample(which(values(realized.dist\$occupied.area)>0.5),300),] Absence<-coordinates(realized.dist\$occupied.area )[sample(which(values(realized.dist\$occupied.area)<0.5),300),] occData<-as.data.frame(rbind(cbind(Presence,SP=rep(1,300)),cbind(Absence,SP=rep(0,300)))) coordinates(occData)<-~x+y proj4string(occData)<-proj4string(envData) # Calculat the probability of detecting dispersal-limited absences probability<-pDLA(occData=occData,envData=envData[[c(1,5,6)]],longlat=TRUE) # Display the results par(mfrow=c(1,2),mar=c(2,2.5,2,2.5)) plot(realized.dist\$occupied.area,main="Realized distribution") plot(occData,col=ifelse(occData\$SP==1,2,1),add=TRUE,pch=19,cex=0.8) plot(potential.dist\$suitab.raster,main="Potential distribution") scatterCol<-function(x){ x<-(x-min(x))/(max(x)-min(x)) colorFunction <- colorRamp(matlab.like(100)) zMatrix <- colorFunction(x) zColors <- rgb(zMatrix[,1], zMatrix[,2], zMatrix[,3], maxColorValue=255) return(zColors)} points(probability,pch=21, col=1,bg=scatterCol(probability@data[,"PDLA"]),cex=1) # Example based on occurrences from both the invaded and the native range envData<-getData('worldclim', var='bio', res=10) envNative<-crop(envData,extent(-90,-70,20,40)) envData<-crop(envData,extent(-8,15,38,55)) native.dist <- generateSpFromFun(envNative[[c(1,5,6)]], my.parameters) occNative<-as.data.frame(coordinates(native.dist\$suitab.raster) [sample(which(values(native.dist\$suitab.raster)>0.5),100),]) coordinates(occNative)<-~x+y proj4string(occNative)<-proj4string(envData) plot(native.dist,main=" Native range distribution") plot(occNative,add=TRUE,pch=19,cex=0.8) probability<-pDLA(occData=occData,envData=envData[[c(1,5,6)]],longlat=TRUE, occNative=occNative,envNative=envNative[[c(1,5,6)]]) ## End(Not run) ```
{"ft_lang_label":"__label__en","ft_lang_prob":0.55378294,"math_prob":0.9599131,"size":5562,"snap":"2023-40-2023-50","text_gpt3_token_len":1544,"char_repetition_ratio":0.10741274,"word_repetition_ratio":0.015822785,"special_character_ratio":0.2599784,"punctuation_ratio":0.160697,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98759466,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-12-08T06:12:09Z\",\"WARC-Record-ID\":\"<urn:uuid:853ac5a8-87b5-4866-93fd-e09c3fef8a29>\",\"Content-Length\":\"52038\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1ea06c58-71ec-40b1-b6db-0ebd90b0ff72>\",\"WARC-Concurrent-To\":\"<urn:uuid:f7eb37b8-445f-4dd3-b81d-77be427be7d7>\",\"WARC-IP-Address\":\"51.81.83.12\",\"WARC-Target-URI\":\"https://rdrr.io/cran/iSDM/man/pDLA.html\",\"WARC-Payload-Digest\":\"sha1:6QNY7NVJMMXMKZTP3ZFZIGHVSB6COZAG\",\"WARC-Block-Digest\":\"sha1:L7VFRJVH53THMSP5P25HY7A7DYZGCVF2\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-50/CC-MAIN-2023-50_segments_1700679100724.48_warc_CC-MAIN-20231208045320-20231208075320-00565.warc.gz\"}"}