Skip to content

Commit

Permalink
Merge pull request #732 from ropensci/utf8
Browse files Browse the repository at this point in the history
Utf8 handling for Windows
  • Loading branch information
michaelquinn32 authored Jan 2, 2023
2 parents 14114ff + 0710d6a commit 2b9c328
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# skimr 2.2.0

* Update handling of spark graphs for Windows when UTF-8 is supported.

# skimr 2.1.5

* Updated to work with newer version of purrr
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' Fix unicode histograms on Windows
#'
#' This functions changes your session's locale to address issues with printing
#' histograms on Windows.
#' histograms on Windows on versions of R below 4.2.1.
#'
#' There are known issues with printing the spark-histogram characters when
#' printing a data frame, appearing like this: "<U+2582><U+2585><U+2587>".
#' This longstanding problem originates in the low-level code for printing
#' dataframes.
#' dataframes. This was addressed in R version 4.2.1.
#'
#' @seealso [skim_without_charts()]
#' @export
Expand Down
6 changes: 4 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,17 @@ line charts in various contexts, some of which are described below.

### Support for spark histograms

There are known issues with printing the spark-histogram characters when
With versions of R before 4.2.1, there are known issues with
printing the spark-histogram characters when
printing a data frame. For example, `"▂▅▇"` is printed as
`"<U+2582><U+2585><U+2587>"`. This longstanding problem [originates in
the low-level
code](https://stat.ethz.ch/pipermail/r-devel/2015-May/071250.html)
for printing dataframes.
While some cases have been addressed, there are, for example, reports of this
issue in Emacs ESS. While this is a deep issue, there is [ongoing
work to address it in base R](https://blog.r-project.org/2020/05/02/utf-8-support-on-windows/).
work to address it in base R](https://blog.r-project.org/2020/05/02/utf-8-support-on-windows/).
We recommend upgrading to at least R 4.2.1 to address this issue.

This means that while `skimr` can render the histograms to the console and in
RMarkdown documents, it cannot in other circumstances. This includes:
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,16 @@ and line charts in various contexts, some of which are described below.

### Support for spark histograms

There are known issues with printing the spark-histogram characters when
printing a data frame. For example, `"▂▅▇"` is printed as
`"<U+2582><U+2585><U+2587>"`. This longstanding problem [originates in
the low-level
With versions of R before 4.2.1, there are known issues with printing
the spark-histogram characters when printing a data frame. For example,
`"▂▅▇"` is printed as `"<U+2582><U+2585><U+2587>"`. This longstanding
problem [originates in the low-level
code](https://stat.ethz.ch/pipermail/r-devel/2015-May/071250.html) for
printing dataframes. While some cases have been addressed, there are,
for example, reports of this issue in Emacs ESS. While this is a deep
issue, there is [ongoing work to address it in base
R](https://blog.r-project.org/2020/05/02/utf-8-support-on-windows/).
R](https://blog.r-project.org/2020/05/02/utf-8-support-on-windows/). We
recommend upgrading to at least R 4.2.1 to address this issue.

This means that while `skimr` can render the histograms to the console
and in RMarkdown documents, it cannot in other circumstances. This
Expand Down

0 comments on commit 2b9c328

Please sign in to comment.