No, I am confounded, It does return the value of the expressions
within the respective braces, just like ifelse. Learn something every
day.
Jim
On Mon, Mar 22, 2021 at 9:35 PM Jim Lemon wrote:
>
> If he's setting PRE to the return value of "if", that is the logical
> value of the expression in t
If he's setting PRE to the return value of "if", that is the logical
value of the expression in the if statement as far as I know. I think
that the expression within the else clause would be evaluated but not
assigned to anything and since it is within the loop, would just be
lost.
PRE<-ifelse(mis
On 22/03/2021 1:59 a.m., Jim Lemon wrote:
Hi Goyani,
You are setting "PRE" to the return value of "if" which is one of TRUE
(1), FALSE(0) or NULL.
That's not true at all. The statement was
PRE<- if(missing(GAY)){
(GA/GA) * 100
} else {
(GA/GAY) * 100
}
so the result
Hi Goyani,
You are setting "PRE" to the return value of "if" which is one of TRUE
(1), FALSE(0) or NULL. Because GAY is always missing in your example,
"PRE" is always set to 1. Then you always want to pass 1 in the sample
list, and that will not assign anything to PRE. By correcting the "if"
claus
Hi Goyani,
In its present form, the function stalls because you haven't defined
pmat before trying to pass it to the function. gmat and wmat suffered
the same fate. Even if I define these matrices as I think you have,
"solve" fails because at least one is singular. First, put the
function in order
I created custom function according to my requirement which is given below:
*selection.index<- function(ID, phen_mat, gen_mat, weight_mat, GAY){ ID =
toString(ID) p<- as.matrix(phen_mat) g<- as.matrix(gen_mat) w<-
as.matrix(weight_mat) bmat<- solve(phen_mat) %*% gen_mat %*% weigh
6 matches
Mail list logo