View source: R/register_config_file.R
check_not_registered_files | R Documentation |
If user start their package without 'fusen' or with version < 0.4, they need to create the config file, with already existing functions.
check_not_registered_files(
path = ".",
config_file,
guess = TRUE,
to_csv = TRUE,
open = FALSE
)
path |
Path to package to check for not registered files |
config_file |
Path to the configuration file |
guess |
Logical. Guess if the file was inflated by a specific flat file |
to_csv |
Logical. Whether to store along the config file, the outputs in a csv for the user to clean it manually |
open |
Logical. Whether to open the csv of unregistered files. |
Path to csv file if to_csv
is TRUE. dput()
of the dataframe otherwise.
register_all_to_config()
for automatically registering all files already present in the project,
inflate_all()
to inflate every flat files according to the configuration file.
## Not run:
# Run this on the current package in development
out_csv <- check_not_registered_files()
file.edit(out_csv)
## End(Not run)
# Or you can try on the reproducible example
dummypackage <- tempfile("clean")
dir.create(dummypackage)
# {fusen} steps
fill_description(pkg = dummypackage, fields = list(Title = "Dummy Package"))
dev_file <- suppressMessages(add_flat_template(pkg = dummypackage, overwrite = TRUE, open = FALSE))
flat_file <- dev_file[grepl("flat_", dev_file)]
# Inflate once
usethis::with_project(dummypackage, {
suppressMessages(
inflate(
pkg = dummypackage,
flat_file = flat_file,
vignette_name = "Get started",
check = FALSE,
open_vignette = FALSE
)
)
# Add a not registered file to the package
cat("# test R file\n", file = file.path(dummypackage, "R", "to_keep.R"))
# Use the function to check the list of files
out_csv <- check_not_registered_files(dummypackage)
out_csv
# Read the csv to see what is going on
content_csv <- read.csv(out_csv, stringsAsFactors = FALSE)
content_csv
# Keep it all or delete some files, and then register all remaining
out_config <- register_all_to_config()
out_config
# Open the out_config file to see what's going on
yaml::read_yaml(out_config)
})
unlink(dummypackage, recursive = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.