matcoc: A function to create a matrix for the use of "cooccur"...

Description Usage Arguments Value Author(s) Examples

View source: R/matcoc.R

Description

This is a function of the package "cooccurExtra". The main idea of this function is creating a matrix for the use of "cooccur" function. The input object can be a data frame for the use of "coocana" or an output of "coocana". Either way the function will return a matrix for the use of "cooccur" function.

Usage

1
matcoc(OMat, ID.Col = "es", species = NA)

Arguments

OMat

A data frame, which contains species and ingradients information from different regions (for the use of "coocana" function). Or a output object of "coocana" function.

ID.Col

Charater string, gives the name of a column in the data frame for the use of identifier. With a default value "es".

species

A list of charaters with names of the needed species. Cannot be empty when the "OMat" is a data frame, otherwise the output will be "NULL".

Value

Returns a matrix in the form for the usage of "cooccur" function.

Author(s)

Yingjia Jot He

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  # create a vector of charaters with all the needed species' names
  Four.Needed <- c("alpheus", "theora.lubrica",
                   "austrovenus.stutchburyi", "macomona.liliana")

  # ask for the model generated by "coocana" (with splits)
  data(modelca)
  # the input object is a model build up with "coocana"
  matcoc(OMat = modelca)[, 1:5]
  # the input object is a model build up with "coocana" with less species
  matcoc(OMat = modelca, species = Four.Needed[-1])[, 1:5]

  # ask for the data frame to be analized
  data(macrofauna)
  # the input "OMat" is a data frame for "coocana" function
  matcoc(OMat = macrofauna, species = Four.Needed)[, 1:5]

JotSoSerious/cooccurExtra documentation built on Oct. 30, 2019, 8:03 p.m.