Learn R Programming

froggeR (version 0.5.0)

write_ignore: Create an enhanced .gitignore file

Description

This function creates a .gitignore file with enhanced security measures designed to help prevent accidental data leaks. The template includes comprehensive rules for common data file types and sensitive information.

Usage

write_ignore(path = here::here(), .initialize_proj = FALSE)

Value

A .gitignore file with enhanced security rules. The file includes:

* R data files (.RData, .rda, .rds)

* Common data formats (CSV, Excel, text)

* System and temporary files

* IDE-specific files

Arguments

path

Character string. Path to the project directory.

.initialize_proj

Logical. TRUE only if starting a froggeR::quarto_project().

Details

If a .gitignore file already exists, the user will be prompted before any overwriting occurs. The template provides substantial security enhancements over basic .gitignore files.

WARNING: Always consult your organization's data security team before using git with any sensitive or protected health information (PHI). This template helps prevent accidental data exposure but should not be considered a complete security solution.

Examples

Run this code
# Create a temporary directory for testing
tmp_dir <- tempdir()

# Write the .gitignore file
write_ignore(path = tmp_dir)

# Confirm the file was created (optional, for user confirmation)
file.exists(file.path(tmp_dir, ".gitignore"))

# Clean up: Remove the created file
unlink(file.path(tmp_dir, ".gitignore"))

Run the code above in your browser using DataLab