[R] Adding name to nth row
eriki at ccbr.umn.edu
Thu May 13 22:55:00 CEST 2010
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"
ecvetano at uwaterloo.ca wrote:
> 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 at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help