hadley / r4ds

R for data science: a book
http://r4ds.hadley.nz
Other
4.59k stars 4.22k forks source link

An emoji is broken and printed on a paperback book. #1612

Open youngwoos opened 11 months ago

youngwoos commented 11 months ago

@hadley Hi, I'm a translator working on your excellent book R for Data Science (2e) into Korean.

You may already know this, but while working on the translation, I found a broken emoji printout in the paperback book. They are printed on pages 243 and 244 of the paperback book. In the e-book PDF file, they are printed on pages 245 and 246.

Thank you for a great book. Working on the translation made me understand R better.

Many thanks.

image
monkeywithacupcake commented 10 months ago

This is strange.

When I run the same lines in my console, I get the emoji. image

And it also shows up in the html when I knit the following excerpt from the book (as.Rmd)


---
title: "Untitled"
output: html_document
date: "2024-01-08"
---

### Other special characters

As well as `\"`, `\'`, and `\\`, there are a handful of other special characters that may come in handy. The most common are `\n`, a new line, and `\t`, tab. You'll also sometimes see strings containing Unicode escapes that start with `\u` or `\U`. This is a way of writing non-English characters that work on all systems. You can see the complete list of other special characters in `?Quotes`.

```{r}
x <- c("one\ntwo", "one\ttwo", "\u00b5", "\U0001f604")
x
stringr::str_view(x)
hadley commented 10 months ago

That's because O'Reilly manually did the emoji translation; they must have missed that one.

youngwoos commented 9 months ago

I would have guessed it was an O'Reilly issue. Hopefully it will be corrected in the next printing. Thanks.