MyNixOS website logo
Description

River Network Distance Computation and Applications.

Reads river network shape files and computes network distances. Also included are a variety of computation and graphical tools designed for fisheries telemetry research, such as minimum home range, kernel density estimation, and clustering analysis using empirical k-functions with a bootstrap envelope. Tools are also provided for editing the river networks, meaning there is no reliance on external software.

riverdist

CRAN_Status_Badge

River Network Distance Computation and Applications

The 'riverdist' package is intended as a free and readily-available resource for distance calculation along a river network. This package was written with fisheries research in mind, but could be applied to other fields. The 'riverdist' package builds upon the functionality of the 'sf' package, which provide the utility of reading GIS shapefiles into the R environment. What 'riverdist' adds is the ability to treat a linear feature as a connected network, and to calculate travel routes and travel distances along that network.

Note that the current version of 'riverdist' (>= 0.16.0) is no longer built on 'sp' and 'rgdal' and is not backward-compatible. A legacy version that uses 'sp' / 'rgdal' ('riverdist' 0.15.5) can be installed via

remove.package("riverdist") if needed devtools::install_github("mbtyers/riverdist@legacy")

Commonly-used functions

  • line2network() imports a river shapefile, and calculates topologies to create a connected river network.

  • cleanup() calls a sequence of editing functions on the resulting river network to facilitate performance. The editing functions are also available by themselves.

  • plot() when used with a river network object produces a simple map of the network, with segments labeled and differentiated by color or line type.

  • xy2segvert() converts a set of X-Y coordinates to river network coordinates by "snapping" each point to the nearest river vertex. pointshp2segvert() does the same, with the input being a point shapefile.

  • riverdistance(), riverdirection(), and upstream() return the network distance, the travel direction (upstream or downstream), and the directional (upstream) distance between two river locations, respectively. Options are included for different handling of locations that are flow-connected or flow-separate, as well as net directional distance when locations are flow-separate.

Several automated analyses are built in. In most cases, there is a direction or directional distance equivalent.

  • homerange() returns the minimum observed home range for each individual in a data set.
  • riverdistanceseq() and riverdistanceseqbysurvey() return different forms of matrices of pairwise network distances between observations of each individual in a dataset.
  • riverdistancemat() returns a matrix of network distances between all observations in a dataset.
  • riverdistancetofrom() returns a matrix of network distances between two datasets.
  • mouthdistbysurvey() returns a matrix of distances between each observation and the mouth of the river network, with rows corresponding to unique individual, and columns corresponding to unique survey.

Summaries and plots are also available at the dataset level, in addition to individuals, which is likely to be much more useful to analysis.

  • makeriverdensity() calculates a kernel density object which can be plotted with plot() to create a kernel density map. Depending on the usage of makeriverdensity(), this may be a sequence of maps.
  • kfunc() provides plotting of empirical k-functions for each survey event, giving evidence of clustering or dispersal behavior.
  • plotseq() produces a plot of a distance sequence such as that returned from mouthdistbysurvey() providing plots of overall distance or upriver position for each survey event.
  • matbysurveylist() produces a list of matrices of distances or upstream distances between all survey events, for each individual. This can be plotted using plotmatbysurveylist(), creating a summary plot for all individuals.

Installation

Version 0.16.0 of the 'riverdist' package is available on CRAN.

The development version is currently available on Github, and can be installed in R with the following code:

devtools::install_github("mbtyers/riverdist")

Metadata

Version

0.16.3

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows