sim_entity: A procedure to simulate entities

Description Usage Arguments Value Examples

View source: R/diversity.R

Description

Simulates an entity with values of abundance for some categories.

Usage

1
2
sim_entity(n_categ, category_prefix = "", values = "log-normal",
  size = -1, mean = 0, sd = 1)

Arguments

n_categ

number of categories

category_prefix

a prefix to be used as part of the category label

values

values of abundance. This argument can be both, a distribution name or a vector of integers. The distribution is used to simulate individuals that are aggregated in frequencies or values of abundance. In the second case, an integer or a vector of integers of possible values of abundance to be used randomly. Default value is 'log-normal'

size

number of individuals. Default value is 7 times n_categ.

mean

parameter for normal or log-normal distribution. Default value is 0.

sd

parameter for normal or log-normal distribution. Default value is 1.

Value

A data frame with two columns: category and value of abundance.

Examples

1
2
3
4
sim_entity(n_categ=50,  category_prefix='ctg', values=1) #equal value
#random numbers for values of abundance
sim_entity(n_categ=50,  category_prefix='ctg', values=sample(1:100, replace=TRUE))
sim_entity(n_categ=50,  category_prefix='ctg', values='log-normal') #equal value

diverse documentation built on May 2, 2019, 2:10 a.m.

Related to sim_entity in diverse...