search for: func_up_0_down

Displaying 1 result from an estimated 1 matches for "func_up_0_down".

2009 Oct 29
1
operation with if/else on a dataframe
...of columns of interest might change (So I can change these parameters depending on the order of the columns in any different table) Fold.change <- 3 #(because in this table, Fold.Change value is the third column and so on...) P.Value <- 4 Count1 <- 5 Count2 <- 6 The function is: func_UP_0_DOWN <- function(x) { if (x[Fold.Change] >= 1.5 & x[P.Value] <= 0.05 & x[Count1] >= 2) { return ("UP")} else { if (x[Fold.Change] <= -1.5 & x[P.Value] <= 0.05 & x[Count2] >= 2) { return ("DOWN")} else { return(0)} } } and then I hav...