214 questions
3
votes
1
answer
65
views
Kaggle Notebook with R kernel shows error when trying to display the list columns of dataframes
In a kaggle notebook, when writing
library(tidyverse)
starwars
I receive the following error:
ERROR while rich displaying an object: Error in (function (..., row.names = NULL, check.rows = FALSE, ...
0
votes
0
answers
25
views
RNotebook make plots in a for loop
i have problems with the plots in my RNotebook. Because i print them in a for-loop they appear collected at the end of the RNotebook html and not and not at the point in the code run where I would ...
1
vote
1
answer
2k
views
Error: object ‘isFALSE’ is not exported by 'namespace:xfun' when running anything in a .Rmd file
# The following is fictional enrollment data for different majors in a liberal arts college
enrollment <- c(100, 250, 45, 95, 400)
major <- c("Political Science", "Math", &...
2
votes
1
answer
282
views
How to trigger an Azure Machine Learning Studio notebook from a Databricks notebook?
I have a notebook in Azure Machine Learning Studio Workspace, and I have also created a compute cluster in the workspace. Now, I want to trigger this notebook from a Databricks notebook.
I have ...
0
votes
1
answer
909
views
Using tabs in Quarto and R
I want to add tabs in Quarto. I will have 8 tabs, so i decide to make aloop in order to generate sections of text and print a dotplot under each tab.
I try the following code. The code must print ...
1
vote
0
answers
209
views
R Notebook is saving but I receive an unexpected symbol error without any resolution
I am receiving an error when saving my R Notebook (.Rmd) file in R Studio. The notebook seems to be saving correctly but I can't figure out what is causing the error and if there is an impact of the ...
0
votes
0
answers
100
views
How do I hide the code in all r notebook chunk?
I have an r notebook, and I want all coding chunks to be hidden while their output is still displayed. I know I can add echo=F in the beginning of every chunk, but can I do it globally?
Thanks in ...
0
votes
1
answer
54
views
Rmarkdown ll Issue at knitting
i was working on a report but my data is on a private network so at retrieving the data to my rmd file usually takes to long to knit. Looking out on Internet i found that you can actually add cache=...
0
votes
1
answer
107
views
Knitting R notebooks with iframe tags instead of embed?
Since last year (at least), Safari has been very unreliable in rendering PDFs plots in R Markdown HTML notebooks. The notebook HTML files are interpreted with an empty gray box where the PDF plot ...
1
vote
1
answer
98
views
R notebook produce blank outputs before desired ones
I wrote a R code to display multiple images in one:
library(tidyverse)
library(fable)
myfit <- tsibbledata::global_economy |>
filter(Code %in% c("CAF", "AUT")) %>%
...
0
votes
1
answer
168
views
Generating Dropdown menu for ggplotly heatmaps
Is it possible to create a chart for R Notebook that switches between multiple ggplotly heatmaps by using a dropdown menu?
There is a related post here and here that I have found hard to adapt for the ...
0
votes
1
answer
70
views
R notebook not displaying dataframe correctly
My code is nut running as expected in Kaggle's notebook. It works fine in Rstudio. I have a list, it consists of 12 csv files brought in via read.csv. I use a for loop on the list and apply complete....
0
votes
1
answer
931
views
How to view more than 10 rows for a table in RStudio Notebook
I'm using RStudio's R Notebook and would like to view 12 rows in my table, rather than have it limited to 10. I know you can click through to see the last two but I'd like to show all 12.
I have tried:...
0
votes
0
answers
551
views
Error when rendering notebook: unexpected symbol
I have an R Notebook script with the setup chunk defined below. I keep getting this error:
Error in source("~/Documents/testing.Rmd") :
~/Documents/testing.Rmd:11:9: unexpected symbol
10:...
1
vote
1
answer
419
views
R Shiny brush zoom a dynamically sized image
I have been looking at advanced interactive plots in Shiny and I am struggling with how to accomplish a brush and double click zoom on an image, as opposed to a plot. To further complicate matters, I ...
0
votes
0
answers
26
views
rnotebook latex issue
Apologies in advance because I do not know how to communicate this question via code.
I have an R Notebook document with some latex (maybe not formally latex, but it's mathematical notation). ...
1
vote
1
answer
51
views
Loop over an entire r-notebook
I was just wondering if it is possible to loop over a r-notebook from an external r file?
My dataset contains a group variable "group" and I should generate a report for each of the 32 ...
2
votes
0
answers
85
views
R Error: "attempt to use zero-length variable name" when using "Preview on save"
It seems there is a problem on "Preview on Save" option in RStudio 2022.07.1 Build 554.
The code below is saved as "tmp1.Rmd". I can run chunks, and I CAN use Preview button (it ...
1
vote
0
answers
345
views
R Notebook: do not get figure captions despite having set "fig_caption: TRUE"
I add "fig_caption: TRUE" to the default R Notebook example:
---
title: "R Notebook"
output: html_notebook
fig_caption: TRUE
---
This is an [R Markdown](http://rmarkdown.rstudio....
2
votes
0
answers
184
views
What determines the default column width for dataframes in Rmarkdown documents?
I know there are a few packages out there for customizing the look of the output tables for rmarkdown documents, like knitr and flextable. I'm considering using those, but I'm curious, if you don't ...
3
votes
2
answers
291
views
newline or line breaks in rnotebook inline chunks
How to make newlines in inline chunks ? Rendering a word document
---
title: "R Notebook"
output: word_document
---
Cat `r cat("not \n working")`
writeLines `r writeLines("...
4
votes
1
answer
1k
views
Can I apply styling to inline code in an R Notebook?
When you use inline code in an R Markdown document, the code is evaluated and the output is incorporated into the text. For example,
The sum of 2 and 2 is `r 2+2`.
This will generate the following ...
1
vote
0
answers
162
views
How to format a table in RStudio Notebook output
I am using an RStudio R Notebook in the visual editor and would like to format the default table output for a tibble.
tibble(letters, number=1:26*1000*rnorm(1))
For me it looks like this:
E.g. I ...
0
votes
1
answer
29
views
In the TOC for the generated PDF of an R Notebook, section numbering and long heading text are garbled together. How can I fix it?
I have an R notebook which is knitted to PDF. For log headings, the section numbering and the text kinda print on top of each other. The only solution so far which I do not appreciate is to switch the ...
1
vote
1
answer
989
views
How to save .nb.html notebook file in another directory than the one with the .rmd file?
Context: I have a R project with disctinct folders for scripts, outputs and data. To match this logic, I would like to have .rmd files in the ./scripts/ folder while saving the .nb.html file in the ./...
1
vote
0
answers
227
views
Preview on save does't work RStudio, but Preview works fine
On RStudio 2022.02.0 open new R notebook, change nothing, check 'Preview on Save', save document, and I get the following console output:
source("~/Desktop/file.Rmd")
Error in source("~/...
-1
votes
1
answer
63
views
Why do I keep getting an error when trying to import my file?
I'm trying to read csv file using R notebook and keep getting this error:
Error: 'Examples/data/starbucks.csv' does not exist in current
working directory ('C:/Users/c227466/Desktop')
I'm not sure ...
0
votes
1
answer
1k
views
SQL chunks in R - Multiple statements and temp tables
I'm trying to run a SQL script inside an R notebook chunk. However, the final SELECT returns no results if it is preceded by multiple SQL statements (that don't generate result sets) within the same ...
1
vote
0
answers
374
views
Is there something like fig.width and fig.height in r notebooks without the margins?
In r notebooks or markdown documents, if one specifies fig.width or fig.height for generating an image with ggplot, the size of the box containing the actual data is heavily influenced by the size of ...
1
vote
0
answers
162
views
writing .Rmd files in Geany IDE
I've been using Geany under Linux to write R scripts for years. Now I want to use R Notebook and R Markdown.
So, what should I do to make Geany recognize .Rmd files used by R? Is it possible?
I did ...
5
votes
1
answer
1k
views
How to increase the width of the table output in RStudio Notebook visual markdown editor
I'm trying to use a notebook in RStudio for an interactive demonstration for students. I like the visual markdown editor, but I'm struggling to format the output.
I can't figure out why the width of ...
2
votes
1
answer
384
views
R Notebook: TOC is not kept on the left when knitting to html
I have the following R notebook:
---
title: "test"
author: "by me"
date: 'last updated: Jan 23, 2022'
output:
html_notebook:
toc: yes
toc_float: yes
number_sections: ...
0
votes
1
answer
459
views
R Notebook how to prevent messages when loading packages [duplicate]
I have created the following R Notebook in RStudio:
---
title: "test"
author: "by me"
date: 'last updated: Jan 23, 2022'
output:
html_notebook:
toc: yes
toc_float: yes
...
7
votes
3
answers
2k
views
How to get console output and plot side by side in a R Notebook?
In a R Notebook there is a function that makes many plots and print summary statistics in the console.
I would like to get the plot and the console output (i.e. summary statistics) side by side on the ...
0
votes
0
answers
129
views
Do I need to import a file every time I use R Notebooks?
I have a question for the community.
Am I required to have a line to import a file whenever I knit an R Notebook file? The dataframe I'd like to use is already in memory as part of my global ...
1
vote
1
answer
733
views
r notebook html output has incorrect order and strange error
I am having a strange issue with an R notebook file. I believe the error may have started when I converted to a markdown file and then back to notebook. In my R script, I have no issues and everything ...
5
votes
1
answer
3k
views
How to convert a Kaggle R notebook to pdf or html?
I have a R notebook in Kaggle that I would like to convert to pdf or html. All the solutions I have found in the forums seem to be python oriented.
Is there any way to get that? Is there any third-...
2
votes
1
answer
935
views
R: renv within R notebook-scoped (Rmd) workflows
I am looking for a way to make my R notebook-centric workflow be more reproducible and subsequently more easily containerized with Docker. For my medium-sized data analysis projects, I work with a ...
1
vote
1
answer
2k
views
RStudio R Markdown Notebook: Change colour of "chunk background highlight" option in Source panel (not Knitted document)
For R Markdown Notebooks, in RStudio > Tools > Global Options... > R Markdown > Advanced :
There is the option to Enable chunk background highlight. This is useful to distinguish between ...
1
vote
2
answers
1k
views
How to make options(width = 60) persist across code chunks in R Markdown used as notebook in RStudio?
I have an R Markdown file that I want to use as a notebook inside RStudio by interactively executing individual (!) code chunks and seeing their results, e.g., prints, tables, plots, displayed under ...
0
votes
0
answers
203
views
Reading in an Excel file with multiple tabs in R
I've browsed and browsed but cant seem to find a solution on here that fits my case. I have an Excel file with 4 tabs. Each tab is formatted exactly the same- 2 columns and 12 rows (including headers)....
-1
votes
1
answer
168
views
"function not found" preventing knitting to HTML
I wanted to make an R notebook containing a map, but I can't knit it to HTML. I am getting the following error:
Error: could not find function "plot_my_connection"
I tried to find a ...
0
votes
2
answers
289
views
Creating an R markdown/notebook template file: can I define code chunks to be folded when the `.rmd` file is opened in Rstudio?
I'm creating a template file for R markdown / R notebook. There are several code chunks that I wish will remain folded when the .rmd is being opened. Is this possible?
Example
Let's say that we have ...
0
votes
1
answer
46
views
R notebook: Rmd and html do not match
I have a .Rmd
---
title: "R Notebook"
output: html_notebook
---
```{r}
dplyr::glimpse(cars)
```
When I execute the chunk, I get the expected output:
However when previewing the notebook I ...
6
votes
2
answers
2k
views
Run selected Rmd chunks in a single command
I'm experimenting with Rmd Notebooks, and I'm stuck on something that seems like it should be possible but I cannot figure out a solution at all.
Basically, I would like a functional way to run ...
1
vote
0
answers
385
views
Rmarkdown: add a title and a plot for each subgroup
I would like to create a Rnotebook that contains for each group in my data:
A subsection header with the group name
A plot containing the data for that group. (obs the alternative of adding the group ...
1
vote
2
answers
323
views
Can people without R installed run an R Notebook file successfully?
I have an R Notebook that I am building to provide an analysis for somebody, and I am wondering if I should choose another option as I don't know if she will be able to run the Notebook without having ...
1
vote
0
answers
21
views
R notebook loose images after a few days opened in Rstudio
I'm using Rstudio notebook to create nice Rmarkdown reports generated in html. Rstudio is opened during days on the same notebook, and sometimes all images disappear except those recently generated.
...
0
votes
0
answers
143
views
Suppress ulam() messages in R notebook
I have the following code:
m1 <- ulam(
alist(
Y ~ dnorm( mu , sigma ) ,
mu <- a + b*( p ) ,
a ~ dnorm( 0 , 0.5 ) ,
b ~ dlnorm( 0 ,0.1 ) ,
sigma ~ dexp(...
3
votes
1
answer
675
views
collapsed TOC in R Notebook
I can't seem to get collapsed: FALSE in r-markdown's html_notebook.
With the below YAML I do not get at collapsed TOC.
---
title: "R Notebook TEST"
output:
html_notebook:
toc: yes
...