greenswayab / birds Goto Github PK
View Code? Open in Web Editor NEW:mag_right: :bird: A set of tools for Biodiversity Informatics in R
Home Page: https://greenswayab.github.io/BIRDS/
License: GNU General Public License v3.0
:mag_right: :bird: A set of tools for Biodiversity Informatics in R
Home Page: https://greenswayab.github.io/BIRDS/
License: GNU General Public License v3.0
Now they only accept birds_spdf. It should also accept other types of BIRDS-classes
Description
When using a grid which has attributes it results in an error when running summariseBirds()
with spillOver = "unique"
.
The reason lies in the function includeUniqueSpillover()
, overlayBirds.R, line 68. Where obs[,"grid"]
should be a vector but instead is a data.frame when the input grid has attributes.
To Reproduce
Link to grid.
Link to data.
data <- read.csv("path/to/data.csv")
grid <- rgdal::readOGR("path/grid/with/attributes/grid.shp")
ob <- BIRDS::organiseBirds(data)
BIRDS::summariseBirds(ob, grid, "unique")
Describe the bug
"Falco peregrinus, 1771" gets to "Falco"
Expected behavior
should be "Falco peregrinus"
Description
When running removeObs()
on certain datasets it seems to get stuck and not returning any results.
The terminal returns “Chunks to big, next…” two times then it seems to get stuck in an infinite loop
To Reproduce
Link to sample data
data <- read.csv("path/to/data.csv")
ob <- BIRDS::organiseBirds(data)
ev <- BIRDS::exploreVisits(ob)
ro <- BIRDS::removeObs(ob, ev,criteria = "SLL",percent = 75,stepChunk = 0.05)
Expected behavior
The function should terminate.
In reverse dependency checks, there appear to be more problems with current sp from github - rsbivand/sp and R-Forge rgdal. The underlying problem seems to stem from CRS(proj4string(x)), testing that proj4string() values are equal, and so on. Be aware that proj4string() values are retained only for out-of-date PROJ/GDAL versions, and that other mechanisms are used replacing the use of Proj4 strings with WKT2_2019 strings for PROJ >= 6 and GDAL >= 3 (already in the CRAN Windows binaries of sf and rgdal). You also use constructions like points@proj4string
which should always be slot(points, "proj4string"). This is certainly not resolved. There are multiple errors when running soon to be released sp/rgdal with current PROJ/GDAL both on released BIRDS, and possibly more problems with BIRDS master.
Originally posted by @rsbivand in #9 (comment)
possibility to add overlay layer.
include an exclude argument in summarizeBirds() that remove different parts of the results to save up memory
Filter or weight the visits by SLL
Describe the bug
Sometimes when reloading summarise birds it trows the following error when I run focalSpReport:
Error in as.POSIXlt.numeric(zoo::index(x)) : 'origin' must be supplied
It doens't happens always.
To Reproduce
Steps to reproduce the behavior:
Likely yearsAll <- sort(unique(lubridate::year(x$temporal)))
Reported by Charles
Decription
When a grid is added to organizeBirds(x=data, grid=grid)
it results in an error "identicalCRS(x, y) is not TRUE".
The error comes from the function getGridIDs
(line 139) in organizeBIRDS. In sp::over()
the inputs don't have the same CRS, even thou they should have.
To Reproduce
grid <- rgdal::readOGR(dsn="path/to/.shp")
grid <- sp::spTransform(grid, CRSobj = CRS("+init=epsg:4326"))
ob <- BIRDS::organizeBirds(x = BIRDS::bombusObs, dataCRS = "+init=epsg:4326", grid = grid)
Expected behavior
There shouldn’t be an error.
Description
When running the spatialVisits()
it can result in error with certain data.
The error is:
Error in .local(x, y, returnList, fn, ...) :
identicalCRS(x, y) is not TRUE
In addition: Warning messages:
1: In proj4string(spdf) : CRS object has comment, which is lost in output
2: In spTransform(xSP, CRSobj, ...) :
NULL source CRS comment, falling back to PROJ string
3: In showSRID(uprojargs, format = "PROJ", multiline = "NO") :
Discarded datum WGS_1984 in CRS definition,
but +towgs84= values preserved
To Reproduce
Link to data.
data <- read.csv("path/to/data.csv")
ob <- organiseBirds(data)
visitStats <- exploreVisits(ob)
spV<-spatialVisits(visitStats)
possibility to remove individual observations that are outliers from too wide visits.
Describe the bug
using a polygon with data.frame (e.g. reading a shape file) as grid produce errors in SummariseBirds, actually in includeUniqueSpillover(). This function Assumes that grid only has IDs in the data.frame an nothing else.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
should interpret the grid in its various forms
add possibility to calculate Gini index for different exported results
Description
When running the summarizeBirds()
it can result in error with certain data in combination with spillOver = "unique"
.
The error is:
Error in matrix(unlist(dataRes), nrow = length(dataRes), byrow = TRUE) :
'data' must be of a vector type, was 'NULL'
The error can occur in different grid types. That seems not to be relevant.
To Reproduce
Link to data.
data <- read.csv("path/to/data.csv")
ob <- organiseBirds(data)
bboxMat <- as.matrix(ob$spdf@bbox)
bboxMat <- matrix(c(bboxMat[1,1], bboxMat[2,1],bboxMat[1,1],
bboxMat[2,2],bboxMat[1,2], bboxMat[2,2],
bboxMat[1,2], bboxMat[2,1],bboxMat[1,1],
bboxMat[2,1]), ncol = 2, nrow = 5, byrow = TRUE)
bbPol <- SpatialPolygons(list(
Polygons(list(Polygon(bboxMat)), 1)
))
proj4string(bbPol) <- CRS("+init=epsg:4326")
grid <- makeDggrid(bbPol, 100)
sb <- summarizeBirds(ob, grid, "unique")
Description
When setting other than the default ”day”
for the variable timeInVisits
in organizeBirds ()
the following function exploreVisits ()
returns with an error.
To Reproduce
library(BIRDS)
ob <- organizeBirds(bombusObs, timeInVisits = "year")
e <- exploreVisits(ob, attr(ob, "visitCol"))
Expected behavior
There should not be an error.
https://data-blog.gbif.org/post/exploring-es50-for-gbif/
https://obis.org/indicators/documentation/
ES50 (Hulbert index)
The expected number of marine species in a random sample of 50 individuals (records) is an indicator on marine biodiversity richness.
The ES50 is defined in OBIS as the sum(esi) over all species of the following per species calculation:
when n - ni >= 50 (with n as the total number of records in the cell and ni the total number of records for the ith-species)
esi = 1 - exp(lngamma(n-ni+1) + lngamma(n-50+1) - lngamma(n-ni-50+1) - lngamma(n+1))
when n >= 50
esi = 1
else
esi = NULL
Warning: ES50 assumes that individuals are randomly distributed, the sample size is sufficiently large, the samples are taxonomically similar, and that all of the samples have been taken in the same manner.
the function shotgun::minCircle() is not reliable for extreme cases with few points or with outliers. We stick to max distance from centroid.
Change all dependencies of sp to sf. And make examples accordingly.
the function makeGrid became better for regional-local scales, but it does not work for continental to intercontinental scales.
It has to do with poly <- st_transform(poly, crs = st_crs(getUTMproj(poly)))
to choose planar coordinates.
A solution is to let the user choose a planar CRS, else pick a UTM.
calculating survey completness based on accumulation curve of #species vs visits
similar to method in La Sorte et al. 2009 Ecography (https://onlinelibrary.wiley.com/doi/full/10.1111/ecog.04632)
calculation of completeness index for temporal and spatial units
The way outliers were calculated based on a boxplot of the distnaces to the ceintroid made sets of too few points where there are e.g. 3 unique locations be considered as 1 outlier even if the distances between the points wasnt unreasonable long.
Describe the solution you'd like
The solution is to think about the pertenence of the observations to clusters based on the median distance between observations not to a centroid. I use the DBSCAN algorithm to search for groups of at least three point within the median distance between the points. Else they are too spread or there are too few points to be considered a cluster.
Then issue #18 can be reopened.
should be rename visits everywhere to call them checklists (chklst)? Comment please
The function organiseBirds will not organise an sf object.
Error is:
"Error in organiseBirds(dat, sppCol = "vetenskapligt_namn", idCols = c("lokal", :
The column names defined for the coordinates could not be found in the data set"
I think the reason is that at line 520
the function calls:
if (any(class(x) == "data.frame"))
an sf object gives a response of
"sf" "data.frame"
so is assumed to not be spatial by default as the code is now
possible solution would be
all( any( class(x)%in%"sf"), any( class(x) %in% "data.frame"))
Charlie
Is there any coordinate negative on the reference polygon then makeGrid() will fail.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.