# NOT RUN {
res <- evaluate_partition_unsup(
partition = factor(rep(c(1,2,3), each = 50)),
partition.ref = factor(rep(c(1,2,3), times = c(100, 25, 25))))
## With missing data
res2 <- evaluate_partition_unsup(
partition = factor(rep(c(1,2,3), each = 50)),
partition.ref = factor(rep(c(1,2,3), times = c(100, 25, 25))),
is.missing = sample(c(TRUE, FALSE), 150, replace = TRUE, prob = c(.2,.8)))
## With missing and censored data
missing.indicator <- sample(c(TRUE, FALSE), 150,
replace = TRUE, prob = c(.2,.8))
Censor.indicator <- data.frame(
X1 = runif(150, 1, 5),
X2 = runif(150, 6, 8),
X3 = runif(150, 3, 9))
Censor.indicator$X1[missing.indicator] <- NA
Censor.indicator$X1[
sample(c(TRUE, FALSE), 150,replace = TRUE, prob = c(.1,.9))] <- NA
Censor.indicator$X2[
sample(c(TRUE, FALSE), 150,replace = TRUE, prob = c(.3,.7))] <- NA
Censor.indicator$X3[
sample(c(TRUE, FALSE), 150,replace = TRUE, prob = c(.05,.95))] <- NA
res3 <- evaluate_partition_unsup(
partition = factor(rep(c(1,2,3), each = 50)),
partition.ref = factor(rep(c(1,2,3), times = c(100, 25, 25))),
is.missing = missing.indicator,
is.cens = Censor.indicator)
## With missing and censored data and unclassifed observations
res4 <- evaluate_partition_unsup(
partition = factor(rep(c(1,2, NA,3), times = c(50, 40, 20, 40))),
partition.ref = factor(rep(c(1,2,3), times = c(100, 25, 25))),
is.missing = missing.indicator,
is.cens = Censor.indicator)
# }
Run the code above in your browser using DataLab