-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
Hi!
I run into trouble when I generate a R markdown via a R script using the RStudio feature "Source as a Local Job".
I got the following to peaces of code:
render.R:
library(rmarkdown)
rmarkdown::render(
input = "test.Rmd",
encoding = "UTF-8",
clean = FALSE
)
test.Rmd:
---
title: "test"
author: "Norman Markgraf"
date: "2/28/2021"
output: html_document
---
` ``{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(mosaic)
` ``
## May be a bug
` ``{r}
tips <- reshape2::tips
linmod <- lm(tip ~ total_bill + smoker + sex, data = tips)
plotModel(linmod)
` ``
(Spaces inserted for better display here!)
Running render.R als source works perfect. But if I try to run it as a "source as local job" it will stop with the following error:
Quitting from lines 16-21 (test.Rmd)
Fehler in eval(x$call$data, environment(x$call$formula)) :
Objekt 'tips' nicht gefunden
Ruft auf: sourceWithProgress ... plotModel.default -> plotModel -> parseModel -> eval -> eval
Ausführung angehalten
Does anybody have a clue why this error occurs? - Is it a mosaic or a Rstudio issue? - Any help would by welcome.
Thanks ins advance
Yours
Norman
Metadata
Metadata
Assignees
Labels
No labels