A strange behavior:
data(iris)
library(condformat)
#library(knitr)
df <- iris[c(1:5,70:75, 120:125),]
cd <- condformat(df)
cd <- rule_text_bold(cd, 2, df[,2] == apply(df[,2:3], 1, FUN=min))
cd <- rule_text_bold(cd, 3, df[,3] == apply(df[,2:3], 1, FUN=min))
cd
Produces the correct output with the minimum of rows 2 and 3 in bold.
But when I switch to a for loop:
data(iris)
library(condformat)
#library(knitr)
df <- iris[c(1:5,70:75, 120:125),]
cd <- condformat(df)
for (j in 2:3){
cd <- rule_text_bold(cd, j, df[,j] == apply(df[,2:3], 1, FUN=min))
}
cd
It breaks. Only one of the columns is highlighted. Why? I need to do this for large tables and need the loop!