chronosphere v.0.2.1 on GitHub, with new variables

As we work on the package, incremental updates are posted on its GitHub repository. You can install the latest with

install.packages("https://github.com/adamkocsis/chronosphere/raw/master/_archive/source/chronosphere_0.2.1-59.tar.gz", repos=NULL, type="source")

chronosphere 0.2.1 (2020-01-27) currently offers the following new features:

1. The nums(), colnums() and rownums() functions

These shorthand functions are intended to be used for subsetting based on names attributes, when they represent numerical entries. For instance nums() is just shorthand for as.numeric(names()).

For example, if you want to select DEMs that are older than 10Ma is easier to read and write with:

data(dems)
dems[nums(dems)>10]
## class         : RasterArray 
## RasterLayer properties: 
## - dimensions  : 181, 361  (nrow, ncol)
## - resolution  : 1, 1  (x, y)
## - extent      : -180.5, 180.5, -90.5, 90.5  (xmin, xmax, ymin, ymax)
## - coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 
## Array properties: 
## - dimensions   : 7  (vector)
## - num. layers    : 7
## - proxy:
##        15       20       25       30       35       40       45 
## "dem_15" "dem_20" "dem_25" "dem_30" "dem_35" "dem_40" "dem_45"

2. Support for vector polygon data

This allows users to download two new variables from Natural Earth using dat="NaturalEarth".

The variable var="land" downloads and attaches land polygon data that includes continents and larger islands.

land <- fetch("NaturalEarth", "land")
## OGR data source with driver: ESRI Shapefile 
## Source: "/tmp/Rtmpo2K9Ua/land_4-1-0/ne_10m_land.shx", layer: "ne_10m_land"
## with 10 features
## It has 3 fields
## If you use the data in publications, please cite its
## reference, as well as that of the 'chronosphere' package.
## - If you wish to cite the map data, simply use: Made with Natural Earth. Free vector and raster map data @ naturalearthdata.com.
plot(land, col=gradinv(1))

The second variable var="minorislands" does the same for smaller islands.

mi <- fetch("NaturalEarth", "minorislands")
## OGR data source with driver: ESRI Shapefile 
## Source: "/tmp/Rtmpo2K9Ua/minorislands_4-1-0/ne_10m_minor_islands.shx", layer: "ne_10m_minor_islands"
## with 2795 features
## It has 3 fields
## Integer64 fields read as strings:  scalerank
## If you use the data in publications, please cite its
## reference, as well as that of the 'chronosphere' package.
## - If you wish to cite the map data, simply use: Made with Natural Earth. Free vector and raster map data @ naturalearthdata.com.
plot(land, col=gradinv(1), xlim=c(19.9, 28.1), ylim=c(35.68,39.23))
# smaller islands in red
plot(mi, col=gradinv(5)[4], add=TRUE, border=NA)

This is a beta version. Much of the functionality is not yet available/perfect and data access is restricted to publicly available datasets only. Issues and bugreports should go to the GitHub repo issue tracker. We appreciate any feedback.

Avatar
Ádám T. Kocsis
Postdoc

A postdoctoral research fellow, with interests in global scale biogeographical and ecological processes, programming, philosophy and music.

Next
Previous