rnotebook

R Notebook - code chunk gets separated in preview

谁说我不能喝 提交于 2019-12-05 14:22:18
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. However, when I run this chunk, it gets separated into two. 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.

R notebook: opts_chunk has no effect

我只是一个虾纸丫 提交于 2019-12-05 06:43:26
I'm working on my first R notebook which works pretty well, except for one issue. I'd like to be the numbers that I output inline with `r realbignumber` to have commas as separator and max 2 decimal points: 123,456,789.12 In order to achieve this, I added a chunk at the beginning of my document, which contains... ```{r setup} knitr::opts_chunk$set(echo = FALSE, warning=FALSE, cache = TRUE, message = FALSE) knitr::opts_chunk$set(inline = function(x){if(!is.numeric(x)){x}else{prettyNum(round(x,1), big.mark = ",")}}) options(scipen=999) ``` The suppression of scientific numbers works like a charm

Difference between R MarkDown and R NoteBook

给你一囗甜甜゛ 提交于 2019-12-03 00:30:21
问题 I am trying to understand at a high level what the differences between R Markdown and R NoteBook . I know they are interrelated but I would like to figure out how they are related. My understanding is this: I know R Notebooks are really R Markdown documents but I am confused about the terminologies. RStudio new file option has both R Markdown and R NoteBook and selecting either of them opens an R Markdown file but with minor differences. So just trying to figure out why are there two options

R Notebook HTML Format - add hyperlinks to paged table

雨燕双飞 提交于 2019-12-02 04:59:52
I wish to knit an html file from an R Notebook that contains paged tables with hyperlinks. Hyperlinks can be inserted using knitr::kable , but I can't find a way to generate a paged table with this function. Paged tables are the default notebook output, but I can't find a way of inserting functional hyperlinks . Many thanks for your help. --- title: "Paged notebook table with hyperlinks" output: html_notebook: code_folding: "hide" --- ```{r rows.print=3} wiki.url <- "https://en.wikipedia.org/wiki/" df1 <- data.frame(Month=month.name, URL=paste0("[", month.name, "](", wiki.url, month.name, ")")