r.data.frame | R Documentation |
The function r.data.frame()
initializes a data frame with as many columns as nodes in the MoTBF-network. It also asings each column its data type, i.e., numeric or character. In the case of character columns, the states of the variable are extracted from the "bn"
argument and included as levels.
r.data.frame(bn, dag)
bn |
A list of lists obtained from the function MoTBFs_Learning. |
dag |
An object of class |
An object of class "data.frame"
, which contains the data type of each column and has no rows.
## Create a dataset # Continuous variables x <- rnorm(100) y <- rnorm(100) # Discrete variable z <- sample(letters[1:2],size = 100, replace = TRUE) data <- data.frame(C1 = x, C2 = y, D1 = z, stringsAsFactors = FALSE) ## Get DAG dag <- LearningHC(data) ## Learn a BN bn <- MoTBFs_Learning(dag, data, POTENTIAL_TYPE = "MTE") ## Initialize a data.frame containing 3 columns (x, y and z) with their attributes. r.data.frame(bn, dag)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.