[EMAIL PROTECTED] writes:
> This is what I would do:
>
> cc <- NULL
> for(i in 1:ncol(x)) cc <- c(cc, paste("X", i, sep=''))
> colnames(x) <- cc
>
> where x is your matrix.
R is a vectorized language:
colnames(x) <- paste("X", 1:ncol(x), sep='')
will do.
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help