# NOT RUN {
## 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)
## Check if a node is root
is.root("C1", dag)
# }
Run the code above in your browser using DataLab