Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add output in chunk chapter 5 #422

Open
JBSP-code opened this issue Apr 12, 2021 · 1 comment
Open

Add output in chunk chapter 5 #422

JBSP-code opened this issue Apr 12, 2021 · 1 comment
Assignees
Labels
v2 Second edition

Comments

@JBSP-code
Copy link

It maybe a bit pedantic but to be more consistent from the perspective of a reader, since all other chunks in the book automatically produce the outputs, you could change the first chunk in this part:

```{r, eval=TRUE}
lifeExp_by_continent <- gapminder2007 %>%
group_by(continent) %>%
summarize(median = median(lifeExp),
mean = mean(lifeExp))
```
```{r catxplot0, echo=FALSE, purl=FALSE}
lifeExp_by_continent %>%
kable(
digits = 3,
caption = "Life expectancy by continent",
booktabs = TRUE,
linesep = ""
)
```

by setting the option {r, eval=TRUE, results='hide'} and adding the object name lifeExp_by_continent onto the last line

 lifeExp_by_continent <- gapminder2007 %>% 
   group_by(continent) %>% 
   summarize(median = median(lifeExp),  
             mean = mean(lifeExp))
 lifeExp_by_continent 

such that the reader automatically gets the corresponding output when copying and running the code in R while the second chunk handles the output for the book.

@rudeboybert
Copy link
Member

Hey @theFippo thanks for the suggestions. We'll add this to our list of TODO's for v2

@rudeboybert rudeboybert added the v2 Second edition label Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 Second edition
Projects
None yet
Development

No branches or pull requests

2 participants