script.open: Open R Script, R Markdown script, or SQL Script in RStudio

View source: R/script.open.R

script.openR Documentation

Open R Script, R Markdown script, or SQL Script in RStudio

Description

This function is used to open an R script, R markdown script, or SQL script in RStudio.

Usage

script.open(path, line = 1, col = 1, cursor = TRUE, run = FALSE,
            echo = TRUE, max.length = 999, spaced = TRUE, check = TRUE)

Arguments

path

a character string indicating the path of the script.

line

a numeric value indicating the line in the script to navigate to.

col

a numeric value indicating the column in the script to navigate to.

cursor

logical: if TRUE (default), the cursor moves to the requested location after opening the document.

run

logical: if TRUE, the code is executed after the document is opened

echo

logical: if TRUE, each expression is printed after parsing, before evaluation.

max.length

a numeric value indicating the maximal number of characters output for the deparse of a single expression.

spaced

logical: if TRUE, empty line is printed before each expression.

check

logical: if TRUE, argument specification is checked.

Details

The function documentOpen() in the package rstudioapi is used to open an R script.

Author(s)

Takuya Yanagida takuya.yanagida@univie.ac.at

References

Ushey, K., Allaire, J., Wickham, H., & Ritchie, G. (2022). rstudioapi: Safely access the RStudio API. R package version 0.14. https://CRAN.R-project.org/package=rstudioapi

See Also

script.close, script.new, script.save, setsource

Examples

## Not run: 

# Open  R script file
script.open("script.R")

# Open  R script file and run the code
script.open("script.R", run = TRUE)

## End(Not run)

misty documentation built on Nov. 15, 2023, 1:06 a.m.

Related to script.open in misty...