library(dplyr) ## initial dataframe df <- data.frame( test.type = c("p", "p", "p", "p", "np", "np"), var.equal = c(TRUE, FALSE, TRUE, FALSE, TRUE, FALSE), paired = c(TRUE, TRUE, FALSE, FALSE, TRUE, FALSE) ) ## add column test.description mutate(df, test.description = case_when( test.type == "p" & !var.equal & !paired ~ "Games-Howell test", test.type == "p" ~ "Student's t-test", test.type == "np" & var.equal & paired ~ "Durbin-Conover test", TRUE ~ "Unknown combination" ) )if ( test_expression1) { statement1 } else if ( test_expression2) { statement2 } else if ( test_expression3) { statement3 } else { statement4 }x <- 0 if (x < 0) { print("Negative number") } else if (x > 0) { print("Positive number") } else print("Zero")if (condition1) { expr1 } else if (condition2) { expr2 } else if (condition3) { expr3 } else { expr4 }B<-FALSE x<-2 if (B==TRUE){ x<-x+1 y<-10 }else{ x<-x-1 y<-5 } x [1] 1 y [1] 5