sequential.submatrix: Extract subsampling matrices for a series of subsampling...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/sequential.submatrix.R

Description

This function applies submatrix sequencially to all specified sampling schemes and taxonomic groups.

Usage

1
2
3
4
5
sequential.submatrix(dataset, sampl.columns, sampl.intervals = NULL,
window.sizes = NULL, gap.sizes = NULL, start.columns = 1, 
all.combinations = TRUE, group.column = NULL, 
include.all.together = TRUE, remove.zeros = TRUE,
keep.nonsampl.columns = TRUE, n.subsampl.columns = NULL)

Arguments

dataset

name of the matrix or dataframe to analyze

sampl.columns

numbers of the consecutive columns with the (daily) sampling data, e.g. 4:180

sampl.intervals

a vector of the intervals at which to extract sampling data, e.g. 5 to take one every five samples

window.sizes

the size (in sampling time units, e.g. days) of the sampling periods

gap.sizes

the size of the gaps between sampling periods

start.columns

vector of start columns, see submatrix

all.combinations

logical, whether to use all window x gap size combinations (the default, TRUE) or just the number corresponding to the length of window.sizes and gap sizes (in which case window.sizes and gap.sizes must have the same length)

group.column

name or index number of the column containing the taxa or groups to analyse separately, e.g. 3 or "Family"; if NULL, all records will be used together

include.all.together

logical, whether to get subsampling matrices also for the complete data (including all groups together)

remove.zeros

logical, whether to remove rows where all extracted samples have zero observations

keep.nonsampl.columns

logical, whether to include also the non-sampling columns of dataset in the resulting submatrices)

n.subsampl.columns

number of subsampl.columns

Value

A list of submatrices

Author(s)

A. Marcia Barbosa

See Also

submatrix, subset

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
data(roadkills)

submats1 <- sequential.submatrix(dataset = roadkills, 
sampl.columns = 4:ncol(roadkills), sampl.intervals = c(1, 3), 
group.column = "taxon", include.all.together = TRUE,
remove.zeros = TRUE, keep.nonsampl.columns = TRUE, 
n.subsampl.columns = 85)

names(submats1)
head(submats1[[1]])

submats2 <- sequential.submatrix(dataset = roadkills, 
sampl.columns = 4:ncol(roadkills), window.sizes = c(1,3,5), 
gap.sizes = 1:3, start.columns = 1, all.combinations = TRUE,
group.column = "taxon", include.all.together = TRUE, 
remove.zeros = TRUE, keep.nonsampl.columns = TRUE, 
n.subsampl.columns = 85)

names(submats2)
head(submats2[[1]])

DeadCanMove documentation built on May 2, 2019, 6:48 p.m.