dsp: dsp

Description Usage Arguments Value Examples

Description

Density of species (Dsp) function

Usage

1
dsp(data, species, distance)

Arguments

data

a data frame

species

data frame column specifying the species of the observation

distance

distance from random sampling point to nearest individual of a species

Value

input data frame with Dsp (density of species) column added on

Examples

1
2
3
4
5
6
7
8
#The dsp function works on class data.frame
df1 <- data.frame(sp = c("a", "b", "b", "a", "b", "a"),
                  dis = c(3, 6, 4, 7, 3, 8))
dsp(df1, sp, dis)

#dsp also works on class numeric
y <- c(4, 7, 9, 10)
dsp(distance = y)

mncube/qeb99r documentation built on Dec. 21, 2021, 8:07 p.m.