1

I have a matrix with 14 samples and I want randomly make sub-matrix with 5 samples like 20 times and make a graph each time!

I have tried for loop but didn't work so do you have any Idea?

#-select random samples
r1 <- sample(counts, 5)

#-add tolal count
r1$total <- cbind(rowSums(r1))
olaps <- count(r1, "total")
olaps <- olaps[-1,]
x = colnames(r1[1:5])
plot(olaps,type='b')

What I want at end 20 martrix r1 to r20 and their graphed, preferably in a multi-plot!

Derp
  • 11
  • 1
  • 3
    Please share your data and your attempt at a `for` loop. Check out this link on how to produce a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) if you are unsure of how to share your data – astrofunkswag Jan 12 '19 at 19:07

0 Answers0