Re: [R] Adding name to nth row

2010-05-14 Thread Jim Lemon
On 05/14/2010 06:35 AM, ecvet...@uwaterloo.ca wrote: Hello, I have a data frame with many rows, and I want to create a column with a name only at every 12th row, starting from 97 to 278. Hi ecvetano, The string of names is not too hard: blank11<-rep("",11) one_to_fifteen<-c("one","two","three

Re: [R] Adding name to nth row

2010-05-13 Thread Erik Iverson
We need a self-contained, reproducible example of what you have, and what you want. Is this close? tmp <- data.frame(a = rnorm(278)) tmp$newcol <- "" tmp[seq(97,278, by = 12), "newcol"] <- "A Name" ecvet...@uwaterloo.ca wrote: Hello, I have a data frame with many rows, and I want to create

[R] Adding name to nth row

2010-05-13 Thread ecvetano
Hello, I have a data frame with many rows, and I want to create a column with a name only at every 12th row, starting from 97 to 278. Thanks in advance! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do rea