originize_selection {origin}R Documentation

Wrapper function to be used as an RStudio addin

Description

Wrapper function to be used as an RStudio addin

Usage

originize_selection(
  context = rstudioapi::getSourceEditorContext(),
  pkgs = getOption("origin.pkgs", .packages()),
  overwrite = getOption("origin.overwrite"),
  ask_before_applying_changes = getOption("origin.ask_before_applying_changes"),
  check_conflicts = getOption("origin.check_conflicts"),
  check_base_conflicts = getOption("origin.check_base_conflicts"),
  add_base_packages = getOption("origin.add_base_packages"),
  excluded_functions = getOption("origin.excluded_functions"),
  verbose = getOption("origin.verbose"),
  use_markers = getOption("origin.use_markers_for_logging"),
  path_to_local_functions = getOption("origin.path_to_local_functions"),
  check_local_conflicts = getOption("origin.check_local_conflicts")
)

Arguments

context

information of marked editor section in RStudio

pkgs

a character vector with package names. Defaults to the result of .packages but only if the option 'origin.pkgs' is not specified.

overwrite

if TRUE the file will be saved and overwritten. Otherwise, only the logging is triggered. Note that, depending on 'ask_before_applying_changes', the user is ask whether the result is as desired.

ask_before_applying_changes

if TRUE, the user has to approve changes made by origin prior to applying them. Note that this mutes all checks, i.e. large number of files, local functions mask exported functions, and the presence and order of function conflicts.

check_conflicts

if TRUE, possible namespace conflicts between functions exported by packages listed in pkgs are checked. See details.

check_base_conflicts

if TRUE; native R functions are also included in checking for conflicts. See details.

add_base_packages

a boolean. If TRUE, base R functions are handled like all other packages and added via '::'

excluded_functions

a list. Either an unnamed list of function names as strings. These functions are excluded from all packages and never considered in origin. Or a named list with character vectors, Then the name of the list element refers to a package and the given functions are only excluded from this package. A very explicit way to handle namespace conflicts or highlighting popular infix functions like '%>%' or ':='.

verbose

if TRUE, origin provides a logging output about its results.

use_markers

a boolean. If TRUE, the markers tab inn RStudio is used to track changes and show issues. FALSE prints the same information in the console.

path_to_local_functions

Path to search for local functions that mask all exported functions from originizing. If NULL, defaults to the current RStudio Project root.

check_local_conflicts

if TRUE, it is checked whether locally defined functions inside of the project mask exported functions packages listed in pkgs. It avoids mistakenly adding pkg:: to a custom local function.

Value

No return value, called for side effects


[Package origin version 1.1.2 Index]