widetolong: A R function for converting to wide data to long data

Description Usage Arguments Value Author(s) Examples

Description

Converting wide data, such as species matrix, and attributes matrix to long data,such as the treedata and herbdata.

Usage

1
widetolong(widedata, leftlab = "left", uplab = "up", innerlab = "inner")

Arguments

widedata

Data similar to the species matrix, and attributes matrix, etc.

leftlab

Row labels of wide data

uplab

Column labels of wide data

innerlab

Attributes labels of inner data of wide data

Value

Long data,such as treedata,herbdata, etc.

Author(s)

Zongzheng Chai

Examples

1
2
3
4
5
6
7
herb.spematrix<-longtowide(longdata=herbdata,left="plot.id",up="spe.id",inner="abundance")
herb.spedata<-widetolong(herb.spematrix,
                              leftlab="plot.id",uplab="spe.id",innerlab="abundance")
herb.spedata
##After removed zero in innerdata
rd0herb.spedata<-herb.spedata[-which(herb.spedata$abundance==0),]
rd0herb.spedata

Zongzheng/forestHES documentation built on May 10, 2019, 1:59 a.m.