reformat: A function to reorder the columns of a data table/matrix/data...

Description Usage Arguments Value Examples

View source: R/reformat.R

Description

A function to reorder the columns of a data table/matrix/data frame and to change factor variables to numeric.

Usage

1
reformat(data, capturelists)

Arguments

data

The data table/matrix/data frame which is to be checked.

capturelists

The vector of column names or locations for the capture history list columns.

Value

data With reordered columns so that the capture history columns are followed by the rest.

Examples

1
2
3
4
5
data = matrix(sample(c(0,1), 2000, replace = TRUE), ncol = 2)
x = matrix(rnorm(nrow(data)*3, 2, 1), nrow = nrow(data))

data = cbind(x, data)
result<- reformat(data = data, capturelists = c(4,5))

drpop documentation built on Oct. 11, 2021, 9:06 a.m.