import: Import staged files into project

View source: R/import-code.R

importR Documentation

Import staged files into project

Description

[Stable]

This function is used by the "code libary" RStudio 'Addin' to bring external code into your project.

Usage

import(
  copy_table,
  overwrite = FALSE,
  silent = FALSE,
  skip = "\\.mod$",
  find_replace_dir_names = TRUE
)

Arguments

copy_table

A data frame or character. if data.frame should be output from stage(), if character path, result will be stage()d first.

overwrite

Logical (default = FALSE).

silent

Logical (default = FALSE).

skip

Character (default = "\\.mod$"). Pattern to skip. Model files will be imported directly into the project in order to avoid conflicts and will instead reside only in the staging area.

find_replace_dir_names

Logical (default = TRUE). Will attempt to find replace strings in scripts to reflect nm_default_dirs().

Value

Invisibly returns copy_table argument.

See Also

code_library(), stage()

Examples


## requires NMproject directory structure
## Not run: 

## both of these following operations are easier in the shiny code library
## RStudio 'Addin'.

ls_code_library("Models/ADVAN2.mod") %>%
  import() ## ends up in "staging/Models"

ls_code_library("Scripts/AUC.R") %>%
  import() ## ends up "scripts" directory

## End(Not run)


NMproject documentation built on Sept. 30, 2022, 1:06 a.m.