Thank you.
It runs but only vs appears as the title, no x and y label.
A reproducible example maybe:
X <-
mtcars[, c("mpg",
"cyl",
"disp",
"hp")]
x = data.matrix(X)
Y <-
mtcars[, c("drat",
"wt",
"qsec",
"vs", "am")]
y = data.matrix(X)
for (i in 1:ncol(y)) {
scatter.smooth(
x[, 1],
y[, i],
main = paste(colnames(y[, i]), "vs", colnames(x[, 1])),
xlab = paste(colnames(x[, 1])),
ylab = paste(colnames(y[, i]))
)
}
I have check the codes line by line, the colnames returns null values.