ropensci-archive / mapr Goto Github PK
View Code? Open in Web Editor NEW:warning: ARCHIVED :warning: Map species occurrence data
License: Other
:warning: ARCHIVED :warning: Map species occurrence data
License: Other
moved from ropensci/spocc#122
Related
Discussion with alex/matt
institutioncode :catalog number
(if i'm remembering correctly)library("mapr")
library("spocc")
spp <- c('Danaus plexippus', 'Accipiter striatus', 'Pinus contorta')
dat <- occ(query = spp, from = 'gbif', has_coords = TRUE, limit = 50)
dat <- fixnames(dat)
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
#> Warning: Unknown or uninitialised column: 'name'.
map_plot(dat, cex = 1, pch = 10)
#> Error in plot.xy(xy.coords(x, y), type = type, ...): formal argument "cex" matched by multiple actual arguments
Created on 2019-01-14 by the reprex package (v0.2.1)
devtools::session_info()
#> ─ Session info ──────────────────────────────────────────────────────────
#> setting value
#> version R version 3.4.4 (2018-03-15)
#> os Ubuntu 18.04.1 LTS
#> system x86_64, linux-gnu
#> ui X11
#> language en_US
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz Europe/Paris
#> date 2019-01-14
#>
#> ─ Packages ──────────────────────────────────────────────────────────────
#> package * version date lib source
#> assertthat 0.2.0 2017-04-11 [1] CRAN (R 3.4.4)
#> backports 1.1.3 2018-12-14 [1] CRAN (R 3.4.4)
#> bindr 0.1.1 2018-03-13 [1] CRAN (R 3.4.4)
#> bindrcpp 0.2.2 2018-03-29 [1] CRAN (R 3.4.4)
#> callr 3.1.1 2018-12-21 [1] CRAN (R 3.4.4)
#> cli 1.0.1 2018-09-25 [1] CRAN (R 3.4.4)
#> colorspace 1.4-0 2019-01-08 [1] R-Forge (R 3.4.4)
#> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.4.4)
#> crosstalk 1.0.0 2016-12-21 [1] CRAN (R 3.4.4)
#> crul 0.7.0 2019-01-04 [1] CRAN (R 3.4.4)
#> curl 3.2 2018-03-28 [1] CRAN (R 3.4.4)
#> data.table 1.11.8 2018-09-30 [1] CRAN (R 3.4.4)
#> desc 1.2.0 2018-05-01 [1] CRAN (R 3.4.4)
#> devtools 2.0.1 2018-10-26 [1] CRAN (R 3.4.4)
#> digest 0.6.18 2018-10-10 [1] CRAN (R 3.4.4)
#> dotCall64 1.0-0 2018-07-30 [1] CRAN (R 3.4.4)
#> dplyr 0.7.8 2018-11-10 [1] CRAN (R 3.4.4)
#> evaluate 0.12 2018-10-09 [1] CRAN (R 3.4.4)
#> fields 9.6 2018-01-29 [1] CRAN (R 3.4.4)
#> foreign 0.8-69 2017-06-21 [4] CRAN (R 3.4.2)
#> fs 1.2.6 2018-08-23 [1] CRAN (R 3.4.4)
#> geoaxe 0.1.0 2016-02-19 [1] CRAN (R 3.4.4)
#> ggplot2 3.1.0 2018-10-25 [1] CRAN (R 3.4.4)
#> glue 1.3.0.9000 2019-01-06 [1] Github (tidyverse/glue@3f7012c)
#> gtable 0.2.0 2016-02-26 [1] CRAN (R 3.4.4)
#> highr 0.7 2018-06-09 [1] CRAN (R 3.4.4)
#> htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.4.4)
#> htmlwidgets 1.3 2018-09-30 [1] CRAN (R 3.4.4)
#> httpcode 0.2.0 2016-11-14 [1] CRAN (R 3.4.4)
#> httpuv 1.4.5.1 2018-12-18 [1] CRAN (R 3.4.4)
#> httr 1.4.0 2018-12-11 [1] CRAN (R 3.4.4)
#> jsonlite 1.6 2018-12-07 [1] CRAN (R 3.4.4)
#> knitr 1.21 2018-12-10 [1] CRAN (R 3.4.4)
#> later 0.7.5 2018-09-18 [1] CRAN (R 3.4.4)
#> lattice 0.20-35 2017-03-25 [4] CRAN (R 3.4.2)
#> lazyeval 0.2.1 2017-10-29 [1] CRAN (R 3.4.4)
#> leaflet 2.0.2 2018-08-27 [1] CRAN (R 3.4.4)
#> lubridate 1.7.4 2018-04-11 [1] CRAN (R 3.4.4)
#> magrittr 1.5 2014-11-22 [1] CRAN (R 3.4.4)
#> mapproj 1.2.6 2018-03-29 [1] CRAN (R 3.4.4)
#> mapr * 0.4.0.9100 2019-01-14 [1] local
#> maps 3.3.0 2018-04-03 [1] CRAN (R 3.4.4)
#> maptools 0.9-4 2018-09-19 [1] CRAN (R 3.4.4)
#> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.4.4)
#> mime 0.6 2018-10-05 [1] CRAN (R 3.4.4)
#> munsell 0.5.0 2018-06-12 [1] CRAN (R 3.4.4)
#> oai 0.2.2 2016-11-24 [1] CRAN (R 3.4.4)
#> pillar 1.3.1 2018-12-15 [1] CRAN (R 3.4.4)
#> pkgbuild 1.0.2 2018-10-16 [1] CRAN (R 3.4.4)
#> pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.4.4)
#> pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.4.4)
#> plyr 1.8.4 2016-06-08 [1] CRAN (R 3.4.4)
#> prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.4.4)
#> processx 3.2.1 2018-12-05 [1] CRAN (R 3.4.4)
#> promises 1.0.1 2018-04-13 [1] CRAN (R 3.4.4)
#> ps 1.3.0 2018-12-21 [1] CRAN (R 3.4.4)
#> purrr 0.2.5 2018-05-29 [1] CRAN (R 3.4.4)
#> R6 2.3.0 2018-10-04 [1] CRAN (R 3.4.4)
#> rbison 0.7.0 2018-10-25 [1] CRAN (R 3.4.4)
#> RColorBrewer 1.1-2 2014-12-07 [1] CRAN (R 3.4.4)
#> Rcpp 1.0.0 2018-11-07 [1] CRAN (R 3.4.4)
#> rebird 1.0.0 2018-09-27 [1] CRAN (R 3.4.4)
#> remotes 2.0.2 2018-10-30 [1] CRAN (R 3.4.4)
#> rgbif 1.1.0 2018-10-19 [1] CRAN (R 3.4.4)
#> rgeos 0.4-2 2018-11-08 [1] CRAN (R 3.4.4)
#> ridigbio 0.3.5 2017-02-16 [1] CRAN (R 3.4.4)
#> rlang 0.3.1 2019-01-08 [1] CRAN (R 3.4.4)
#> rmarkdown 1.11 2018-12-08 [1] CRAN (R 3.4.4)
#> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.4.4)
#> rvertnet 0.7.0 2018-04-17 [1] CRAN (R 3.4.4)
#> rworldmap 1.3-6 2016-02-03 [1] CRAN (R 3.4.4)
#> scales 1.0.0 2018-08-09 [1] CRAN (R 3.4.4)
#> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.4.4)
#> shiny 1.2.0 2018-11-02 [1] CRAN (R 3.4.4)
#> sp 1.3-1 2018-06-05 [1] CRAN (R 3.4.4)
#> spam 2.2-1 2018-12-20 [1] CRAN (R 3.4.4)
#> spocc * 0.9.0 2018-11-15 [1] CRAN (R 3.4.4)
#> stringi 1.2.4 2018-07-20 [1] CRAN (R 3.4.4)
#> stringr 1.3.1 2018-05-10 [1] CRAN (R 3.4.4)
#> testthat 2.0.1 2018-10-13 [1] CRAN (R 3.4.4)
#> tibble 2.0.0 2019-01-04 [1] CRAN (R 3.4.4)
#> tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.4.4)
#> triebeard 0.3.0 2016-08-04 [1] CRAN (R 3.4.4)
#> urltools 1.7.1 2018-08-03 [1] CRAN (R 3.4.4)
#> usethis 1.4.0.9000 2019-01-03 [1] Github (r-lib/usethis@85bf30a)
#> whisker 0.3-2 2013-04-28 [1] CRAN (R 3.4.4)
#> withr 2.1.2 2018-03-15 [1] CRAN (R 3.4.4)
#> xfun 0.4 2018-10-23 [1] CRAN (R 3.4.4)
#> xml2 1.2.0 2018-01-24 [1] CRAN (R 3.4.4)
#> xtable 1.8-3 2018-08-29 [1] CRAN (R 3.4.4)
#> yaml 2.2.0 2018-07-25 [1] CRAN (R 3.4.4)
#>
#> [1] /home/maelle/R/x86_64-pc-linux-gnu-library/3.4
#> [2] /usr/local/lib/R/site-library
#> [3] /usr/lib/R/site-library
#> [4] /usr/lib/R/library
Moved from ropensci/spocc#92
perhaps this is possible:
if user gets data from GBIF + at least 1 other source, and that source feeds in, at least in part, to GBIF, then GBIF may include the dataset identifers from the source, and we can look for that to match on...
To reflect focus on just maps. Cleaning all in scrubr
now
shoot for June 2016 just to give people time to switch away to mapr
/scrubr
Already import sp
, so maybe should make some methods for spatial classes to make this more widely useful
We support gbif
class that comes from rgbif::occ_search
already but just not the output from rgbif::occ_data
<r> library(spocc)
<r> library(spoccutils)
Loading required package: ggplot2
Attaching package: ‘spoccutils’
The following objects are masked from ‘package:spocc’:
bbox2wkt, spocc_capwords, spocc_colClasses, wkt2bbox
Seems like most users would want metadata on tooltips, see about adding this by default - does so for gists already, nice
not sure where the slow point is
I hope to release a new version of ggmap in a week (August 7) to comply with some cran standards. You still have the possibility of using Google with the source = "google" argument to geocode.
You can load the new version with devtools::install_github("dkahle/ggmap")
from spocc
issue ropensci/spocc#44
From discussion on ropensci/spocc#43
I hope this isn't too lazy of me?
My use case is simple to describe:
In conservation biology a convex hull seems also to be known as the extent of occurrence (EOO) of a species (e.g. figure 1a here: http://www.int-res.com/articles/esr2008/6/n006p127.pdf ). This would be a popular use-case for mapr
& occurrence data I think.
Q2 is slightly subtler. The convex hull could be composed from say four occurrence records, each in a different country, but the simple convex hull could conceivably cover more than four different countries. I want to know ALL the different countries that are at least partially covered by the convex hull between the pts, not just the country of origin of the points/occurrences. Identity of the countries overlapped by the EOO is key too, not just a numerical count of how many.
inputs:
library("dismo")
#> Loading required package: raster
#> Loading required package: sp
g <- gbif('Batrachoseps', 'luciae', geo = TRUE, end = 300)
#> Loading required namespace: jsonlite
#> 1954 records found
#> 0-300 records downloaded
mapr::map_ggplot(g, "lon", "lat")
#> Error: The parameter 'point_color' has been replaced by 'color'
Created on 2019-01-14 by the reprex package (v0.2.1)
devtools::session_info()
#> ─ Session info ──────────────────────────────────────────────────────────
#> setting value
#> version R version 3.4.4 (2018-03-15)
#> os Ubuntu 18.04.1 LTS
#> system x86_64, linux-gnu
#> ui X11
#> language en_US
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz Europe/Paris
#> date 2019-01-14
#>
#> ─ Packages ──────────────────────────────────────────────────────────────
#> package * version date lib source
#> assertthat 0.2.0 2017-04-11 [1] CRAN (R 3.4.4)
#> backports 1.1.3 2018-12-14 [1] CRAN (R 3.4.4)
#> bindr 0.1.1 2018-03-13 [1] CRAN (R 3.4.4)
#> bindrcpp 0.2.2 2018-03-29 [1] CRAN (R 3.4.4)
#> callr 3.1.1 2018-12-21 [1] CRAN (R 3.4.4)
#> cli 1.0.1 2018-09-25 [1] CRAN (R 3.4.4)
#> codetools 0.2-15 2016-10-05 [4] CRAN (R 3.4.2)
#> colorspace 1.4-0 2019-01-08 [1] R-Forge (R 3.4.4)
#> crayon 1.3.4 2017-09-16 [1] CRAN (R 3.4.4)
#> crosstalk 1.0.0 2016-12-21 [1] CRAN (R 3.4.4)
#> desc 1.2.0 2018-05-01 [1] CRAN (R 3.4.4)
#> devtools 2.0.1 2018-10-26 [1] CRAN (R 3.4.4)
#> digest 0.6.18 2018-10-10 [1] CRAN (R 3.4.4)
#> dismo * 1.1-4 2017-01-09 [1] CRAN (R 3.4.4)
#> dotCall64 1.0-0 2018-07-30 [1] CRAN (R 3.4.4)
#> dplyr 0.7.8 2018-11-10 [1] CRAN (R 3.4.4)
#> evaluate 0.12 2018-10-09 [1] CRAN (R 3.4.4)
#> fields 9.6 2018-01-29 [1] CRAN (R 3.4.4)
#> foreign 0.8-69 2017-06-21 [4] CRAN (R 3.4.2)
#> fs 1.2.6 2018-08-23 [1] CRAN (R 3.4.4)
#> ggplot2 3.1.0 2018-10-25 [1] CRAN (R 3.4.4)
#> glue 1.3.0.9000 2019-01-06 [1] Github (tidyverse/glue@3f7012c)
#> gtable 0.2.0 2016-02-26 [1] CRAN (R 3.4.4)
#> highr 0.7 2018-06-09 [1] CRAN (R 3.4.4)
#> htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.4.4)
#> htmlwidgets 1.3 2018-09-30 [1] CRAN (R 3.4.4)
#> httpuv 1.4.5.1 2018-12-18 [1] CRAN (R 3.4.4)
#> jsonlite 1.6 2018-12-07 [1] CRAN (R 3.4.4)
#> knitr 1.21 2018-12-10 [1] CRAN (R 3.4.4)
#> later 0.7.5 2018-09-18 [1] CRAN (R 3.4.4)
#> lattice 0.20-35 2017-03-25 [4] CRAN (R 3.4.2)
#> lazyeval 0.2.1 2017-10-29 [1] CRAN (R 3.4.4)
#> leaflet 2.0.2 2018-08-27 [1] CRAN (R 3.4.4)
#> magrittr 1.5 2014-11-22 [1] CRAN (R 3.4.4)
#> mapr 0.4.0.9100 2019-01-14 [1] local
#> maps 3.3.0 2018-04-03 [1] CRAN (R 3.4.4)
#> maptools 0.9-4 2018-09-19 [1] CRAN (R 3.4.4)
#> memoise 1.1.0 2017-04-21 [1] CRAN (R 3.4.4)
#> mime 0.6 2018-10-05 [1] CRAN (R 3.4.4)
#> munsell 0.5.0 2018-06-12 [1] CRAN (R 3.4.4)
#> pillar 1.3.1 2018-12-15 [1] CRAN (R 3.4.4)
#> pkgbuild 1.0.2 2018-10-16 [1] CRAN (R 3.4.4)
#> pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.4.4)
#> pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.4.4)
#> plyr 1.8.4 2016-06-08 [1] CRAN (R 3.4.4)
#> prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.4.4)
#> processx 3.2.1 2018-12-05 [1] CRAN (R 3.4.4)
#> promises 1.0.1 2018-04-13 [1] CRAN (R 3.4.4)
#> ps 1.3.0 2018-12-21 [1] CRAN (R 3.4.4)
#> purrr 0.2.5 2018-05-29 [1] CRAN (R 3.4.4)
#> R6 2.3.0 2018-10-04 [1] CRAN (R 3.4.4)
#> raster * 2.8-4 2018-11-03 [1] CRAN (R 3.4.4)
#> Rcpp 1.0.0 2018-11-07 [1] CRAN (R 3.4.4)
#> remotes 2.0.2 2018-10-30 [1] CRAN (R 3.4.4)
#> rlang 0.3.1 2019-01-08 [1] CRAN (R 3.4.4)
#> rmarkdown 1.11 2018-12-08 [1] CRAN (R 3.4.4)
#> rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.4.4)
#> rworldmap 1.3-6 2016-02-03 [1] CRAN (R 3.4.4)
#> scales 1.0.0 2018-08-09 [1] CRAN (R 3.4.4)
#> sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.4.4)
#> shiny 1.2.0 2018-11-02 [1] CRAN (R 3.4.4)
#> sp * 1.3-1 2018-06-05 [1] CRAN (R 3.4.4)
#> spam 2.2-1 2018-12-20 [1] CRAN (R 3.4.4)
#> stringi 1.2.4 2018-07-20 [1] CRAN (R 3.4.4)
#> stringr 1.3.1 2018-05-10 [1] CRAN (R 3.4.4)
#> testthat 2.0.1 2018-10-13 [1] CRAN (R 3.4.4)
#> tibble 2.0.0 2019-01-04 [1] CRAN (R 3.4.4)
#> tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.4.4)
#> usethis 1.4.0.9000 2019-01-03 [1] Github (r-lib/usethis@85bf30a)
#> withr 2.1.2 2018-03-15 [1] CRAN (R 3.4.4)
#> xfun 0.4 2018-10-23 [1] CRAN (R 3.4.4)
#> xtable 1.8-3 2018-08-29 [1] CRAN (R 3.4.4)
#> yaml 2.2.0 2018-07-25 [1] CRAN (R 3.4.4)
#>
#> [1] /home/maelle/R/x86_64-pc-linux-gnu-library/3.4
#> [2] /usr/local/lib/R/site-library
#> [3] /usr/lib/R/site-library
#> [4] /usr/lib/R/library
on cran now, easier
moved from ropensci/spocc#8
summary:
Possibly provide functions for generating metadata for a dataset, including:
beginDate
, endDate
wkt
(wkt string), bbox
(just give both in case user is confused by wkt)classificationSystem
(url ref and name), taxonomicClassification
(data.frame maybe w/ cols: taxonRankName, taxonRankValue, commonName)duplicate something like what this pkg does
library(monographaR)
data(monographaR_examples)
mapDiversity(monographaR_examples$map_data, resolution = 1, plot = TRUE, plot.with.grid = TRUE, legend = TRUE, export = FALSE)
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.