mardi 2 avril 2019

If in a data.frame

I would like to choose a value between two columns in the same row following values in other columns.

My function would be like: if values inside shapiro1, shapiro2 and F_test are less than 0.05 choose value in t_test else choose wilcox's value. Does it seem possible to you to make a function like this and apply on a larger columns?

structure(list(modalities = structure(1:3, .Label = c("BS1", 
"HW1", "PG"), class = "factor"), shapiro1 = c(0.0130672654432492, 
0.305460485386201, 0.148320635833262), shapiro2 = c(0.920315823302857, 
0.1354174735521, 0.148320635833262), F_test = c(0.20353475323665, 
0.00172897172228584, 1), t_test = c(2.88264982135322e-06, 5.75374264225996e-05, 
NaN), wilcox = c(0.00909069801592506, 0.00902991076269246, NaN
)), class = "data.frame", row.names = c(NA, -3L))

Aucun commentaire:

Enregistrer un commentaire