Skip to main content

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)

yarn1 <- yarn[which(yarn$spinner=='1'),]
yarn2 <- yarn[which(yarn$spinner=='2'),]
yarn3 <- yarn[which(yarn$spinner=='3'),]
...
yarnn <- yarn[which(yarn$spinner=='n'),]
i can't figure out how directly itegrate wildcards variable names. had through r archives, have had no luck.

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

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support