简体   繁体   中英

How can I make Rmarkdown formatting of chunks comply with break lines?

If I have a chunk like

niris <- iris %>%
  select(starts_with("Sepal"))

The knitr output of the chunk is

niris <- iris %>% select(starts_with("Sepal"))

But I would like it complies with the break lines of my code so it is printed in html as I print in code. I was looking at R Markdown reference guide and at Yihui web and trying multiple options from Results and Code decoration and I couldn't get my goal.

Do you know how should I do?

Thank you!

You didn't provide a reproducible example, so I can only guess. You probably turned on the tidy option (ie, you used the chunk option tidy = TRUE ). If you did that, either set tidy = FALSE or just leave out tidy = TRUE since tidy = FALSE is the default.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM