Thread: wildcards in user names R stats.
hi folks,
have question regarding wildcards in r, simplify following code using control structures? i.e statement (i in 1:n)
i can't figure out how directly itegrate wildcards variable names. had through r archives, have had no luck.yarn1 <- yarn[which(yarn$spinner=='1'),]
yarn2 <- yarn[which(yarn$spinner=='2'),]
yarn3 <- yarn[which(yarn$spinner=='3'),]
...
yarnn <- yarn[which(yarn$spinner=='n'),]
can point me in direction of solution, or has solution?
in advance,
alan
you can want assign command:
code:for (i in 1:n){ assign(paste('yarn',i,sep=''), yarn[yarn$spinner==i,]) }
Forum The Ubuntu Forum Community Other Discussion and Support Education & Science wildcards in user names R stats.
Ubuntu
Comments
Post a Comment