# NOT RUN {
# Valid scenarios ----
# X is a valid data.frame
x <- taste[, 2:7]
what.is.x(x)
# X is a valid indicator
x <- indicator(taste[, 2:7])
what.is.x(x)
# X is a valid list of data.frames with names
x <- list(nif = taste[, 2:3], hurma = taste[, 4:5])
what.is.x(x)
# X is a valid list of indicators
x <- list(nif = indicator(taste[, 2:3]), hurma = indicator(taste[, 4:5]))
what.is.x(x)
# Invalid scenarios ----
# X is a matrix - but not numeric
x <- as.matrix(taste[, 2:7])
what.is.x(x)
# X is a of data.frames list but does not have names
x <- list(taste[, 1:3], taste[, 4:5])
what.is.x(x)
# X is a list of indicators but does not have names
x <- list(indicator(taste[, 2:3]), indicator(taste[, 4:5]))
what.is.x(x)
# X is a data.frame and contains NA
x <- taste[, 2:7]
x[1,1] <- NA
what.is.x(x)
# X is a list of indicators and contains NA
x <- list(nif = indicator(taste[, 2:3]), hurma = indicator(taste[, 4:5]))
x[[1]][1,1] <- NA
what.is.x(x)
# X contains elements that are neither a matrix nor a data.frame
x <- list(nif = 1:10, taste[, 1:3], taste[, 4:7])
what.is.x(x)
# X contains both indicators and matrixes
x <- list(nif = taste[, 2:3], hurma = indicator(taste[, 5:6]))
what.is.x(x)
# }
Run the code above in your browser using DataLab