Skip to content

Sorry to disturb you (problems to run "plotModel" under RStudio "Source as Local Job") #783

@NMarkgraf

Description

@NMarkgraf

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions