Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

generateSiberCommunity

A utility function to simulate a single community comprised of groups


Description

This function simulates data for a single community by sampling from a normal distribution with different means for each group within some specified boundaries.

Usage

generateSiberCommunity(
  n.groups = 3,
  community.id = 1,
  n.obs = 30,
  mu.range = c(-1, 1, -1, 1),
  wishSigmaScale = 1
)

Arguments

n.groups

the an integer specifying the number of groups to simulate. Defaults to 3.

community.id

an integer identifying the community's ID number. Defaults to 1.

n.obs

the number of observations to draw per group.

mu.range

a vector of length 4, specifying the mix and max x and y values to sample means from. Group means are sampled from a uniform distribution within this range. The first two entries are the min and max of the x-axis, and the second two the min and max of the y-axis. Defaults to c(-1, 1, -1, 1).

wishSigmaScale

is a simple multiplier for the call to rWishart which scales the diagonal sigma matrix using wishSigmaScale * diag(2) that is ultimately passed on to generateSiberGroup.

Value

A data.frame object comprising a column of x and y data, a group identifying column and a community identifying column, all of which are numeric.


SIBER

Stable Isotope Bayesian Ellipses in R

v2.1.6
GPL (>= 2)
Authors
Andrew Jackson and Andrew Parnell
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.