Separate licensing for raw data, outputs, and documentation allows for appropriate intellectual property management across different components of your research project. This is especially useful when data has different licensing requirements than code, or when outputs need specific attribution.
This documentation provides a comprehensive guide to projr’s directory licensing system, enabling both automated and manual license management.
projr allows you to add license files to specific directories in your project:
raw-data,
cache)output,
docs, data)projr supports two distinct approaches to license management:
_projr.yml and regenerated during buildsBoth approaches can coexist, with YAML configuration taking precedence when specified.
projr includes templates for common open-source and proprietary licenses:
| License Type | Common Use Case |
|---|---|
| CC-BY (Creative Commons Attribution 4.0) | Research data and analysis outputs |
| CC0 (Creative Commons Zero) | Public domain dedication for data |
| Apache-2.0 | Code with patent protection |
| MIT | Permissive code licensing |
| Proprietary | Private or restricted-use content |
License type variations: Common variations are
automatically normalized: - "ccby", "cc-by" →
"CC-BY" - "apache", "Apache 2.0"
→ "Apache-2.0" - "mit" →
"MIT"
Use projr_yml_dir_license_set() to configure licenses in
_projr.yml:
library(projr)
# Simple format - just specify license type
projr_yml_dir_license_set("CC-BY", "output")
# Full format with custom authors and year
projr_yml_dir_license_set(
"MIT",
"raw-data",
authors = c("Jane Doe", "John Smith"),
year = 2024
)
# Set licenses for multiple directories
projr_yml_dir_license_set("Apache-2.0", "output")
projr_yml_dir_license_set("Apache-2.0", "docs")
projr_yml_dir_license_set("CC0", "raw-data")Licenses can be specified in simple or full format in
_projr.yml:
Simple format:
Full format:
When licenses are configured in YAML:
Pre-build phase (input directories): - LICENSE files
created/updated in raw-data and cache
directories - Occurs in all builds (both dev and
production) - Files always regenerated to match current
configuration - Ensures consistency with project metadata
Post-build phase (output directories): - LICENSE
files created in output, docs, and
data directories
- Occurs only in production builds (not dev builds) -
Files generated fresh for each build
Key point: LICENSE files are tracked in the manifest and versioned with your project, ensuring license information is preserved across versions.
Retrieve current configuration:
Remove configuration:
Update all configurations with current authors:
Use projr_license_create_manual() to create licenses
outside of the YAML configuration:
# Create MIT license in raw-data directory
projr_license_create_manual("MIT", "raw-data")
# Create CC-BY license in all raw data directories
projr_license_create_manual("CC-BY")
# Create with custom authors and year
projr_license_create_manual(
"Apache-2.0",
"raw-data",
authors = c("Jane Doe", "John Smith"),
year = 2024
)Key characteristics:
_projr.ymlUse YAML configuration when: - Licenses should stay synchronized with project metadata - You want automated updates when authors change - Standard license templates meet your needs
Use manual creation when: - You need custom license text or modifications - Author attribution is complex or frequently changing - You want manual control over license content
Check if YAML configuration exists:
vignette("environment") for build controlvignette("design") for
build process detailsvignette("concepts") for _projr.yml
structure