6

I am using R notebook to preview the file. Even though all the code is in one chunk, a line gets separated into two. Would you please tell me how I can resolve this?

As you can see all the code is in one chunk. enter image description here

However, when I run this chunk, it gets separated into two.

enter image description here

I am not sure if it matters but here is the code I am running.

library(MASS)
par(mfrow=c(3,1)) 

hist(galaxies, breaks=500)
hist(galaxies, breaks=100)
hist(galaxies, breaks=50)

Also here are the versions of R and RStudio. I an new to R so I am not sure what is causing this. If you need any other information, please let me know. Thanks

R version 3.3.2 (2016-10-31)
Rstudio version 1.0.136

alistaire
  • 42,459
  • 4
  • 77
  • 117
E.K.
  • 4,179
  • 8
  • 30
  • 50
  • I tried quickly and couldn't reproduce the error, but this could be my error. Perhaps set the knitr chunk option `collapse` to TRUE? (i.e., ```{r collapse=TRUE} ). – Tad Dallas Jan 31 '17 at 02:36
  • 1
    Interesting, if you render it to HTML, it's fine, but if you preview it as an R Notebook, it splits. Looks like a bug. – alistaire Jan 31 '17 at 02:57
  • @alistaire Yes that is my guess as well but not sure which package/feature might be causing this. – E.K. Jan 31 '17 at 14:32
  • It's something with `rmarkdown::html_notebook`. If there's no similar issue open, you could file a bug report on GitHub. – alistaire Jan 31 '17 at 19:06
  • Do you have any news on this topic. I'm dealing with the same problem too and found your post. Did you report that bug or not ? – F.N Mar 17 '17 at 17:19
  • I have not yet so please feel free to report the bug. Thanks – E.K. Mar 17 '17 at 18:50
  • 3
    I sent them an email some days now but i got no answer yet. If you find out anything please inform us. – F.N Mar 23 '17 at 11:37

0 Answers0