forceNumeric: Function for checking whether a treedata object contains only...

View source: R/treeplyr_functions.R

forceNumericR Documentation

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

data(anolis)
td <- make.treedata(anolis$phy, anolis$dat)
tdnumeric <- forceNumeric(td)

uyedaj/treeplyr documentation built on March 9, 2023, 6:37 p.m.