rnotebook

R Notebook - code chunk gets separated in preview

帅比萌擦擦* 提交于 2019-12-22 09:37:27
问题 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

Warning messages keep appearing in RStudio notebooks in chunks unrelated to the warnings

假装没事ソ 提交于 2019-12-20 11:13:22
问题 I am starting to use RStudio notebooks, and I am still trying to understand how some of the things work. I do not understand why some produced warning messages are kept and appear when executing code that is completely unrelated to the message. For instance, I have a document with several chunks, where the last of them produces the warning > warnings() Warning messages: 1: Unknown or uninitialised column: 'perc.goal.met.period'. 2: Unknown or uninitialised column: 'perc.goal.met.period'. 3:

R Notebook HTML Format - add hyperlinks to paged table

流过昼夜 提交于 2019-12-20 04:22:38
问题 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

Strange (distortred) output in RStudio notebook in R 3.5.1

久未见 提交于 2019-12-13 03:57:04
问题 I noticed strange behavior in RStudio notebook in R 3.5.1. I can reproduce the behavior by using this code: list() head(iris) At first, an empty list should be printed. Then, if any data frame is printed in either the same or another code chunk, its values get enclosed with additional symbols (some are indicated with arrows) as in this print screen. In R 3.5.1: This behavior might be related to this issue with R lists. It is present in notebooks and disappears if the code is run a console or

R Notebook/Markdown does not save chunk plots using “fig.path = ” chunk option

♀尐吖头ヾ 提交于 2019-12-12 22:19:38
问题 I'm running an analysis in an R Notebook and I would like all plots created in R chunks to be saved as individual PDF files in addition to appearing in the .nb.html notebook output. The problem The problem I'm having is that, when the notebook is run, it does not save plots to the dir specified in the chunk option fig.path = "figures/" either when specified in the individual chunk header: #```{r fig.path = "figures/"} plot(x, y) #``` or when specified with the global chunk options: #```{r

RStudio notebook does not show data.frames when I compile

吃可爱长大的小学妹 提交于 2019-12-11 04:32:49
问题 I have a temporary windows 7 laptop (32 bit) on which I have R 3.3.2 and RStudio 1.0.44. I am using RStudio notebook, and it works fine when I execute code in its window. However, as I compile to html (pressing Preview), the data.frames disappear (there is a chunk with no output). Everything else (vectors or figures) are shown. It seems to be linked to the new cute printing format for data.frames that the notebook exploits. Indeed, if I use R-markdown (switching to output: html_document ),

RMarkdown cannot knit: html_dependency not found

走远了吗. 提交于 2019-12-08 04:53:03
问题 I am trying to create an html file using RMarkdown (using the sample .Rmd in RStudio). When I click Knit , I am getting the following message: Error: path for html_dependency not found: Execution halted. I have tried uninstalling and reinstalling both R and RStudio, as well as all of the packages required for markdown. I am running the most current version of RStudio (1.1.383), and R (3.4.2), and all of my packages are up to date. This is not my first time using RStudio or markdown, but I

RMarkdown cannot knit: html_dependency not found

守給你的承諾、 提交于 2019-12-07 15:46:28
I am trying to create an html file using RMarkdown (using the sample .Rmd in RStudio). When I click Knit , I am getting the following message: Error: path for html_dependency not found: Execution halted. I have tried uninstalling and reinstalling both R and RStudio, as well as all of the packages required for markdown. I am running the most current version of RStudio (1.1.383), and R (3.4.2), and all of my packages are up to date. This is not my first time using RStudio or markdown, but I have yet to get markdown work on this computer. I have not made any changes to the default markdown file.

R notebook: opts_chunk has no effect

╄→尐↘猪︶ㄣ 提交于 2019-12-07 02:48:13
问题 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

how to change number of columns and rows showing in R studio notebook dataframe

随声附和 提交于 2019-12-06 21:34:51
问题 When I run my R studio notebook, the dataframe/tables are defaulted to 10 rows. How can I display 20 rows? As well, if I have many columns, I have to click the "next" button on the top right to see the other columns. How can I display all the columns at the same time? The browser definitely has enough space to view a bigger table, but could this be another possible solution to view all the columns together: shrink the font in each column? If so, how can I do this? This is different from the