5
I’m trying to make a calculation, and I need your help. First I make a sequence with normal distribution with 420 numbers, then I make a sequence of numbers I call mci
with 42 numbers, then the next calculation has a condition if
.
In this part I need that in my condition always compare the first vector list of the mci
with the first number of values I generated from my normal distribution, then the whole process is repeated with the second number until the 420 is completed.
For example: For Rp = (28, 27, 26...), bwg = (account with mci[i]) > Rp
I want that rp
Always be 28 until you finish the first sequence of 42 numbers, and then compare with 27 of the second sequence of my vector.
Note that the condition always compares the same value of rp
, and I think the R is not doing this, comparing for example the value 26.912 with 0.435 where it should compare with the 0.429
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))))))
Downvote until you edit the question title.
– Guilherme SpinXO
Welcome to Stack Overflow! First, do not use caps lock in the title of your question, second, clarify with minimal words what you want to do in the title of the question, third, make it clear where the problem is, what you are trying to do and what went wrong.
– CypherPotato
Behold how to create a Minimum, Complete & Verifiable example
– rubStackOverflow