[ESS] Print spark histograms from skimr package in Emacs ESS on Windows

Vinh Nguyen v|nhd|zzo @end|ng |rom gm@||@com
Wed Jan 24 16:52:59 CET 2018


On Wed, Jan 24, 2018 at 7:17 AM, Vitalie Spinu <spinuvit using gmail.com> wrote:
>
>
>  (set-buffer-process-coding-system 'windows-1252 'windows-1252)
>
> Try 'utf-8 or variants displayed by M-x list-coding-systems. If this works, you
> can either set in ess-R-post-run-hook or in process-coding-system-alist.
>

Hmm, I evaluated in the ESS R buffer
 (set-buffer-process-coding-system 'utf-8 'utf-8)

which returned t, but I still get: the following output:

> library(skimr); skim(cars)
Skim summary statistics
 n obs: 50
 n variables: 2

Variable type: numeric
  variable missing complete  n  mean    sd min p25 median p75 max
1     dist       0       50 50 42.98 25.77   2  26     36  56 120
2    speed       0       50 50 15.4   5.29   4  12     15  19  25
                                                              hist
1 <U+2583><U+2587><U+2587><U+2585><U+2582><U+2582><U+2581><U+2581>
2 <U+2581><U+2582><U+2583><U+2587><U+2585><U+2585><U+2583><U+2583>


If I set to Chinese locale, I get:
> Sys.setlocale("LC_CTYPE", "Chinese") # properly print skim on Windows
[1] "Chinese (Simplified)_People's Republic of China.936"
> library(skimr); skim(cars)
Skim summary statistics
 n obs: 50
 n variables: 2

Variable type: numeric
  variable missing complete  n  mean    sd min p25 median p75 max     hist
1     dist       0       50 50 42.98 25.77   2  26     36  56 120  z ~
~ | y y x x
2    speed       0       50 50 15.4   5.29   4  12     15  19  25  x y
z ~ | | z z

(emacs displays \250 instead of a space under that "hist" column).

Note that I also have LC_CTYPE=en_US.utf-8 in my environment, which
gives the following warning in R (both in Emacs ESS and in regular R
GUI console):

Using the Intel MKL for parallel mathematical computing (using 4 cores).
Default CRAN mirror snapshot taken on 2017-10-15.
See: https://mran.microsoft.com/.
During startup - Warning message:
Setting LC_CTYPE=en_US.utf-8 failed

Happy to test further if anyone




More information about the ESS-help mailing list