vendredi 19 février 2016

programming "NEW IN R "

I'm trying to perform a calculation and I need your help. My first step makes a sequence with normal distribution with 420 numbers, then I make a sequence of numbers that call MCI with 42 numbers, then the next calculation has an if condition. In this part I want to compare the first vector list of MCI with the first number of values of the normal distribution. then the whole process repeats itself with the second number to complete until the end. For example: rp (28, 27, 26...)

bwg (expression.) > rp # this rp is always the 28 to end the first sequence of 42 numbers, and then compare it with 27 second sequence.

max <- 30
K <- 0.0118
Xm <- 21
SD <- 0.851636356306513 
mean.b <- 28

rp <- rnorm(420, mean = mean.b, sd = SD)
BW <- 0.0223*rp^0.8944 
mci <- seq(200, 270, 1.7)
bwg <- ifelse((max*(1-exp(-K*(MCi-(BW*Xm))))) > rp, yes = rp, no = (max*(1-exp(-K*(MCi-(BW*Xm))))))

Aucun commentaire:

Enregistrer un commentaire