kamapu / vegtable

Handling vegetation-plot data sets
http://kamapu.github.io/vegtable/
7 stars 0 forks source link

cran-status-badge runiverse-status-badge cran-downloads-total cran-downloads-month
R-CMD-check cran-checks codecov
cran-doi zenodo-doi

The aim of vegtable is to provide a way for handling databases stored in Turboveg. This package incorporates many concepts and some functions included in the package vegdata but defining an homonymous S4 class containing all elements of a database in just one object. The package vegtable also contains several methods for this object class.

Species lists in vegtable objects are handled by the package taxlist, thus I will recommend to take a look on it.

This package has been developed as a tool handling data stored in SWEA-Dataveg. Further development is running in the context of the project GlobE-wetlands.

An important source of inspiration for vegtable have been the enthusiastic discussions during several versions of the Meetings on Vegetation Databases.

Updating to the last version of vegtable

The very first step is to install the package devtools and dependencies. Then you just need to execute following commands in your R-session:

library(devtools)
install_github("kamapu/vegtable")

Some examples

The current version of vegtable includes an example data, which corresponds to a subset from SWEA-Dataveg. This data set contains plot observations done in Kenya imported from 5 sources.

library(vegtable)
#> Loading required package: taxlist
#> 
#> Attaching package: 'taxlist'
#> The following objects are masked from 'package:base':
#> 
#>     levels, levels<-, print
data(Kenya_veg)

# validate and explore
validObject(Kenya_veg)
#> [1] TRUE
summary(Kenya_veg)
#> ## Metadata 
#>    db_name: Sweadataveg
#>    sp_list: Easplist
#>    dictionary: Swea
#>    object size: 9501 Kb 
#>    validity: TRUE 
#> 
#> ## Content 
#>    number of plots: 1946 
#>    plots with records: 1946 
#>    variables in header: 34 
#>    number of relations: 3 
#> 
#> ## Taxonomic List 
#>    taxon names: 3164 
#>    taxon concepts: 2392 
#>    validity: TRUE

Among others, the object contains plot observations done in the Aberdare National Park (Kenya) by Schmitt (1991). We can make a subset including the plots classified by the mentioned author into the Juniperus procera-Podocarpus latifolius community (IDs 780 to 798).

JPcomm <- subset(Kenya_veg, ReleveID %in% c(780:798))
summary(JPcomm)
#> ## Metadata 
#>    db_name: Sweadataveg
#>    sp_list: Easplist
#>    dictionary: Swea
#>    object size: 717.4 Kb 
#>    validity: TRUE 
#> 
#> ## Content 
#>    number of plots: 19 
#>    plots with records: 19 
#>    variables in header: 17 
#>    number of relations: 3 
#> 
#> ## Taxonomic List 
#>    taxon names: 3164 
#>    taxon concepts: 2392 
#>    validity: TRUE

If you have geo-referenced plot observations, you can use the coordinates to produce a map of the distribution of your plots by using the package leaflet.

library(leaflet)
leaflet(JPcomm@header) %>%
  addTiles() %>%
  addCircleMarkers(
    lng = ~LONGITUDE, lat = ~LATITUDE, color = "red",
    opacity = 0.3, radius = 1
  )

Further readings