numericPart | R Documentation |
The function numericPart()
converts a data.frame
to a
matrix
, by dropping columns which contain non-numeric data.
The function factorPart
grabs the state information by
selecting only columns which are factors.
numericPart(table)
factorPart(table)
table |
A |
The primary purpose is to split a conditional probability distribution in data frame format (with a set of factor rows identifying the states of the parent variables) to a table of just the numbers, and a data frame of just the factors so that they can be tackled separately.
A matrix containing just the numeric (or factor) columns of the data frame.
Russell Almond
data.frame
, matrix
,
data.matrix
name <-c("Shahrazad", "Marguerite")
height <- c(34, 36)
weight <- c(28, 26)
twins <- data.frame(name=as.factor(name),height=height, weight=weight)
numericPart(twins)
factorPart(twins)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.