set.seed(11335577)
pos <- sample(x = 1:150, size = 60, replace = FALSE)
ir.A <- iris[pos, c(1:3, 5)]
ir.B <- iris[-pos, c(1:2, 4:5)]
intersect(colnames(ir.A), colnames(ir.B)) # shared Xs
# Xs without Species (factor)
out.1 <- rho.bounds(data.rec=ir.A, data.don=ir.B,
match.vars=c("Sepal.Length", "Sepal.Width"),
y.rec="Petal.Length", z.don="Petal.Width")
out.1
# Xs with Species (factor)
out.2 <- rho.bounds(data.rec=ir.A, data.don=ir.B,
match.vars=c("Sepal.Length", "Sepal.Width", "Species"),
y.rec="Petal.Length", z.don="Petal.Width")
out.2
Run the code above in your browser using DataLab