eco.split: Splitting an ecogen object by group

Description Usage Arguments Author(s) Examples

Description

The function splits an ecogen object into the groups defined in the slot S. If asList is TRUE, a list with the objects is created , that can be assigned to a name with regular rules, using the operator "<-". Otherwise, the function creates in the workspace an ecogen object for each group with the following nomenclature: <name of ecogen object>.<name of the group>.

Usage

1
2
3
4
5
6
7
8
eco.split(
  eco,
  hier,
  name = NULL,
  overwrite = FALSE,
  missing = c("0", "NA", "MEAN"),
  asList = TRUE
)

Arguments

eco

Object of class "ecogen".

hier

The name of the S slot column with labels assigning individuals to groups.

name

Name used for the output objects. Default is the name of the input,followed by a suffix (see Description).

overwrite

Overwrite files with the same name of the output if already present in workspace when asList = FALSE? Default FALSE.

missing

Missing data argument This can take three values ("0", "NA" or "MEAN"), as described in ecogen. #' Missing elements are treated as zeros in the default option.

asList

Return a list with the objects instead of creating objects in workspace? Default = TRUE

Author(s)

Leandro Roser learoser@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
data(eco3)
eco3


# list of objects
x <- eco.split(eco3, "structure", asList = TRUE)


# rebinding
eco.bind <- eco.rbind(x)


# note that different subsets can also be created
S1.3 <- eco.rbind(x[[1]], x[[3]])


# split and create objects with prefix "eco3"
eco.split(eco3,"structure", asList = FALSE)


# split and create objects with prefix "newObjects"
eco.split(eco3,"structure", "newObjects", asList = FALSE) 




## End(Not run)

EcoGenetics documentation built on July 8, 2020, 5:46 p.m.