Я смог решить ее для n-столбцов и добавить вывод кода в латексе.
X1 = c(4.70e1, 4.72e1, 4.76e1, 1.565)
X2 = c(4.67e1, 4.69e1, 4.77e1, 2.05e20)
X3 = c(1.67e1, 8.69e1, 2.77e1, 8.05e20)
tab.out = data.frame(X1, X2, X3)
tab.out$min<-apply(tab.out, 1, min)
for(i in names(tab.out)){
tab.out[[paste(i, 'test', sep="")]] = if_else(tab.out[[i]] == tab.out$min,
paste0(tab.out[[i]], "\\textsuperscript{*}"),
paste0(tab.out[[i]]))
}
row.nam = c("AIC(n)", "HQ(n)", "SC(n)", "FPE(n)")
tab.out = data.frame(row.nam, tab.out)
tab.out = tab.out %>%
select(row.nam, X1test, X2test, X3test)
# row.nam X1test X2test X3test
#1 AIC(n) 47 46.7 16.7\\textsuperscript{*}
#2 HQ(n) 47.2 46.9\\textsuperscript{*} 86.9
#3 SC(n) 47.6 47.7 27.7\\textsuperscript{*}
#4 FPE(n) 1.565\\textsuperscript{*} 2.05e+20 8.05e+20
Вывод в латексе:
colnames(tab.out) = c("Parameters", "Lag 1", "Lag 2", "Lag 3") #$m^r_t$
print(xtable::xtable(tab.out,
header = F,
caption = "asdasdasdasd",
label="table:tb1",
align="llccc"),
hline.after = c(-1,0),
include.rownames=FALSE,
include.colnames = TRUE,
add.to.row = list(pos = list(nrow(tab.out)),
command = paste("\\hline \n",
"\\multicolumn{4}{l}{\\footnotesize{$^{*}$Indicates the selected order of lag}} \\\\",
"\\multicolumn{4}{l}{\\footnotesize{\\textit{Elaboration: The authors}}}",
sep = "")), comment=FALSE,
sanitize.text.function = function(x){x})