summarytools icon indicating copy to clipboard operation
summarytools copied to clipboard

error when using dfSummary with shiny

Open vikasrawal opened this issue 2 years ago • 1 comments

I am trying to use dfSummary in a shiny app, but get the following error with some datasets. It seems the error has something to do with unicode character encoding:

print(dfSummary(dthh),method="render", headings = FALSE, bootstrap.css = FALSE)

The error I get is:

  • Error in gsub("\\\n", "\n", cell) : input string 1 is invalid In addition: Warning message: In gsub("\\\n", "\n", cell) : unable to translate 'Ao de la encuesta' to a wide string

This is a known problem with encoding/rendering of unicode characters. Various people in other fora have suggested either using useBytes=TRUE with gsub to fix this, or changing the locale settings. But neither seems to have any effect.

Would appreciate any help.

vikasrawal avatar Nov 14 '23 17:11 vikasrawal

Not sure why this has totally gone under my radar... If the problem still arises, pls provide a small reprex so I can look into it. Thx.

dcomtois avatar Apr 17 '25 15:04 dcomtois