[R] 1st script
memilanuk
memilanuk at gmail.com
Mon Mar 23 08:40:47 CET 2015
On 03/22/2015 10:58 PM, PIKAL Petr wrote:
> use list and numeric indexing. As you did not provide reproducibe example here is possible way.
>
> dat <- data.frame(w=abs(rnorm(10)), LC09=round(runif(10)*10), LC10=round(runif(10)*10))
> lll <- vector("list", 2)
> k=0
> for(i in 2:3) {
> k=k+1
> lll[[k]] <- rep(dat$w, dat[,i])
> }
> names(lll)<-names(dat[,2:3])
> boxplot(lll)
>
I don't suppose you have a commented version of that...? What may be
blindingly obvious to you is... not so much for me.
Is this what you need for a reproducible example?
Sample of case_weights.csv:
Weight,LC09,LC10,LP14b1,LP14b2
171.0,0,0,0,0
171.1,0,0,3,0
171.2,0,0,19,0
171.3,0,0,44,0
171.4,0,0,52,0
171.5,0,0,56,1
171.6,0,0,42,1
171.7,0,0,17,5
171.8,0,0,15,29
171.9,0,0,2,46
172.0,0,0,0,37
172.1,0,0,0,39
172.2,0,0,0,33
172.3,0,0,0,48
172.4,0,0,0,26
172.5,0,0,0,48
172.6,0,0,0,31
172.7,0,0,0,47
172.8,0,0,0,17
172.9,0,0,0,19
173.0,0,0,0,7
173.1,0,0,0,10
173.2,0,0,0,12
173.3,0,0,0,17
173.4,0,0,0,10
173.5,0,0,0,6
173.6,0,0,0,6
173.7,0,0,0,2
173.8,0,0,0,1
176.3,3,0,0,0
176.4,1,0,0,0
176.5,0,0,0,0
176.6,4,0,0,0
176.7,2,0,0,0
176.8,6,0,0,0
176.9,4,0,0,0
177.0,9,0,0,0
177.1,16,0,0,0
177.2,24,0,0,0
177.3,27,0,0,0
177.4,43,0,0,0
177.5,40,0,0,0
177.6,56,0,0,0
177.7,41,0,0,0
177.8,58,0,0,0
177.9,55,0,0,0
178.0,48,0,0,0
178.1,37,0,0,0
178.2,23,0,0,0
178.3,30,0,0,0
178.4,14,0,0,0
178.5,16,0,0,0
178.6,9,0,0,0
178.7,11,0,0,0
178.8,9,0,0,0
178.9,7,0,0,0
Thanks,
Monte
--
Shiny! Let's be bad guys.
Reach me @ memilanuk (at) gmail dot com
More information about the R-help
mailing list