What is the input and the output? If it's to go from the first to the second, you just need to tell R that the encoding is "latin1":
xx <- c("S\xe1banas de hospital",
"\xc1cido valproico",
"Servicios hospitalarios de emergencia o quir\xfargico")
# displayed incorrectly
xx
#> [1] "S\xe1banas de hospital"
#> [2] "\xc1cido valproico"
#> [3] "Servicios hospitalarios de emergencia o quir\xfargico"
# because R doesn't know what encoding was used (was it Spanish? Japanese? Hebrew?)
Encoding(xx)
#> [1] "unknown" "unknown" "unknown"
# tell R which encoding you used
Encoding(xx) <- "latin1"
Encoding(xx)
#> [1] "latin1" "latin1" "latin1"
# now R knows how to display it
xx
#> [1] "Sábanas de hospital"
#> [2] "Ácido valproico"
#> [3] "Servicios hospitalarios de emergencia o quirúrgico"