numericPart {CPTtools} | 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)
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 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=I(name),height=height, weight=weight) numericPart(twins)