Learn R Programming

treeplyr (version 0.1.10)

forceNumeric: Function for checking whether a treedata object contains only numeric columns and for forcing data columns into numeric format

Description

This function can be used to check if a treedata object contains numeric columns and, if desired, drop all non-numeric columns.

Usage

forceNumeric(tdObject, return.numeric = TRUE)

Arguments

tdObject

A treedata object

return.numeric

If TRUE, then a treedata object with all numeric columns will be returned; non-numeric columns will be removed.

Value

If return.numeric, then an object of class "treedata" with only numeric columns.

Examples

Run this code
# NOT RUN {
data(anolis)
td <- make.treedata(anolis$phy, anolis$dat)
tdnumeric <- forceNumeric(td)
# }

Run the code above in your browser using DataLab