From 4a80f0d58b48000d982b660ee45f69d5e0017a24 Mon Sep 17 00:00:00 2001 From: lrberge Date: Wed, 12 Jun 2024 08:29:43 +0200 Subject: [PATCH] fix bug cran check --- R/etable.R | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/R/etable.R b/R/etable.R index 8f16c789..dfc0c1c6 100644 --- a/R/etable.R +++ b/R/etable.R @@ -2857,23 +2857,23 @@ results2formattedList = function(dots, vcov = NULL, ssc = getFixest_ssc(), stage # Now the aliases fitstat_dict_new = c() - fun_rename = function(x, isTex) { + fun_rename_stats = function(x, isTex) { if(!grepl("::", x, fixed = TRUE)) return(fitstat_dict[x]) xx = strsplit(x, "::")[[1]] - res = paste0(fitstat_dict[xx[1]], ", ", dict_apply(xx[2], dict)) - - if(isTex) { - # LB: we should NOT escape before applying the dictionnary - res = escape_latex(res) + var = dict_apply(xx[2], dict) + if(isTex){ + var = escape_latex(var) } + + res = paste0(fitstat_dict[xx[1]], ", ", var) res } for(v in all_names_new){ - fitstat_dict_new[v] = fun_rename(v, isTex) + fitstat_dict_new[v] = fun_rename_stats(v, isTex) } fitstat_list = fitstat_list_new