Replace current file with snippets with the other file.
install_snippets_from_package(
package,
type = "auto-detect-all",
subdir = "",
backup = TRUE
)
install_snippets_from_dir(
from_dir = ".",
type = get_default_snippet_types(),
backup = TRUE
)
(character) The name of an R package.
(character)
A character vector of snippet types. Currently allowed values are
"r"
, "markdown"
, "c_cpp"
, "css"
, "html"
, "java"
,
"javascript"
, "python"
, "sql"
, "stan
", "tex"
.
May be unambiguously truncated.
Defaults to "r"
.
(character) The sub-directory with replacement file(s).
(logical) Indication if a back-up copy should be created.
(character) The directory with replacement file.
if (FALSE) {
# Replace your R and Markdown snippets with those in package "snippets":
install_snippets_from_package("snippets")
install_snippets_from_package("snippets", type = "r")
install_snippets_from_package("snippets", type = "markdown")
# Check if back-up copies exist:
list_snippet_file_backups(type = "r")
list_snippet_file_backups(type = "markdown")
remove_snippet_backup_duplicates()
}