# Requiere flextable, officer y officedown cargados format_scientific_column <- function(ft, col_name, font_size = 11) { datos <- ft$body$dataset[[col_name]] for(i in seq_along(datos)) { valor <- datos[i] if(!is.na(valor) && grepl("x10\\^", valor)) { partes <- strsplit(valor, "x10\\^")[[1]] mantisa <- partes[1] exponente <- partes[2] ft <- compose( ft, i = i, j = col_name, value = as_paragraph( as_chunk(mantisa, props = fp_text(font.size = font_size)), as_chunk("x10", props = fp_text(font.size = font_size)), as_chunk(exponente, props = fp_text(font.size = font_size, vertical.align = "superscript")) ) ) } } return(ft) }