I have a dataframe on which I want to do a descriptive analysis and present it in a document.
For this, I use the librarysummarytools
The code is as follows (in Rmarkdown):
library(readxl)
datos_def <- read_excel("datos_def_excel")
datos_modelo <- subset(datos_def, select = c("SAP", "sexo", "edad"))
datos_modelo$SAP <- factor(datos_modelo$SAP,labels = c("Buena salud","Mala salud"))
datos_modelo$sexo <- factor(datos_modelo$sexo,labels = c("Mujer","Hombre"))
library(summarytools)
view(dfSummary(datos_modelo)) # genera la tabla en formato html
and the generated table is as follows:
Basically I want all the words that are in English to be converted to Spanish. I understand that if it can be done, it should be changed manually word by word. I explain:
For example:
In the Stats/Values column of the age variable I want to change the word "Mean" to "Media"
Change the column title "Graph" to "Graphic"
"Distinc values" for "Distinct values"
"[Numeric]" to "[Numeric]"
Column headings don't bother me as much as I can pass the generated file from html to docx and change it from within Word. But since I have many more variables than those that appear in this question, it would be much more feasible to be able to change them from Rstudio, especially I am interested in changing the words in the Stats/Values columns.