R programming, row-wise data frame calculation with custom script (for every i) to solve “bridge game”
问题 I have a data frame which specifies "bridge games" (every row is one independent game), see a minimal example with 4 games below: start <- list(c("10","15","5"), c("5") ,c("11","6"),c("6","11")) end <- list(c("7","17","11"), c("10"), c("8","12"),c("8","12")) ascending <- c("+","-","+","-") position <- c(11,6,9,8) desired_output <- c(5,5,"disqualified",3) bridge_game <- data.frame(start = I(start), end = I(end), ascending = ascending, position = position, desired_output = desired_output)