library (readxl) # read excel data
library (tidyverse) # Data handling
library (tmap) # nice maps
# library (unmarked) # occu analitics
# library (ggcorrplot) # corplot in ggplot
library (raster)
library (rasterVis)
library (knitr) #
library (kableExtra) # nice tables
library (sf) #sf
library (mapview)
library (stringr)
library (lubridate)
library (ggeffects)
library (caret)The original data set is a excel file manual vetted by Fabian and another file from automatic identification using Kaleidoscope
#Tabla Fabian
manual_vetting<- read_excel("C:/Users/diego.lizcano/Box Sync/CodigoR/Murcielagos/data/Datos_Cubarral_FH_v2.xlsx")
#View(Datos_Cubarral_FH)
source("C:/Users/diego.lizcano/Box Sync/CodigoR/Murcielagos/R/dg2dec.R")
# case of "degrees minutes seconds" (DMS) for latitude
# with character for Northern (N) and Southern (S) Hemispheres
# use regular expression metacharacter | to indicate logical operation "OR"
manual_vetting$Latitud <- gsub(" ", "", manual_vetting$Latitud) # remove spaces
manual_vetting$Longitud <- gsub(" ", "", manual_vetting$Longitud) # remove spaces
manual_vetting$Longitud <- paste(manual_vetting$Longitud, "W", sep="")
manual_vetting$Latitud <- paste(manual_vetting$Latitud, "N", sep="")
manual_vetting$lat<-dg2dec(varb=manual_vetting$Latitud, Dg="°", Min="′N")
manual_vetting$lon<-dg2dec(varb=manual_vetting$Longitud, Dg="°", Min="'", Sec="''E|W")