widetolong {forestHES} | R Documentation |
A R function for converting to wide data to long data
Description
Converting wide data, such as species matrix, and attributes matrix to long data,such as the treedata and herbdata.
Usage
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
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
[Package forestHES version 1.0-1 Index]