Closed Kyoshido closed 2 years ago
Because of this command risk <- data.table(risk) the matrix is always converted into the data.table So then the check of numeric values any(!is.numeric(risk)) always fails. So I repaired it.
risk <- data.table(risk)
any(!is.numeric(risk))
Doesn't work
any(!is.numeric(risk)) [1] TRUE is.numeric(risk) [1] FALSE
Individualy numeric is ok
is.numeric(risk$V1) [1] TRUE is.numeric(risk$V2) [1] TRUE
My solution
unlist(lapply(risk, is.numeric)) V1 V2 TRUE TRUE any(!unlist(lapply(risk, is.numeric))) [1] FALSE
@Kyoshido thx Jiří for spotting this;
Because of this command
risk <- data.table(risk)
the matrix is always converted into the data.table So then the check of numeric valuesany(!is.numeric(risk))
always fails. So I repaired it.Doesn't work
Individualy numeric is ok
My solution