# \dontshow{
## for R_DEFAULT_PACKAGES=NULL
library(stats, pos = "package:base", verbose = FALSE)
# }
n <- 3L
x <- matrix(0, n, n, dimnames = list(NULL, LETTERS[seq_len(n)]))
y <- seq_len(n)
tsx <- ts(x)
tsy <- ts(y)
`~` <- identity
for (k in 0L:2L) {
cat(sprintf("k = %d:\n\n\n", k))
withAutoprint({
try(colnames(cbind ( x, y, deparse.level = k)))
try(colnames(cbind ( tsx, tsy, deparse.level = k)))
try(colnames(cbind.ts( tsx, tsy, deparse.level = k)))
try(colnames(cbind (~ x, ~ y, deparse.level = k)))
try(colnames(cbind (~tsx, ~tsy, deparse.level = k)))
try(colnames(cbind.ts(~tsx, ~tsy, deparse.level = k)))
})
cat("\n\n")
}
rm(`~`)
Run the code above in your browser using DataLab