Re: [R] Vector Product question

2008-05-25 Thread Dimitris Rizopoulos
try this: x <- c(3, 3, 1) y <- c("x","h","y") paste(rep(y, x), unlist(sapply(x, seq_len)), sep = "") I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)1

[R] Vector Product question

2008-05-25 Thread Rory Winston
Hi Ive looked around but I cant figure out how to do this without a for loop. I have a vector of neural net weights from coef.nnet(), which looks like c(3,3,1). I also have a list of weight prefixes, which are c("x","h","y"). I would like to obtain a vector that looks like c("x1","x2","x3","h