Deal with Dependencies
Overview
Manage dependencies during package development. This can retrieve all dependencies that are used in ".R" files in the "R/" directory, in ".Rmd" files in "vignettes/" directory and in 'roxygen2' documentation of functions. There is a function to update the "DESCRIPTION" file of your package with 'CRAN' packages or any other remote package. All functions to retrieve dependencies of ".R" scripts and ".Rmd" or ".qmd" files can be used independently of a package development.
Bug fixes
att_amend_desc()no longer writes nearly every dependency out of DESCRIPTION when the package carries aDepends:entry other thanRthat the code scan no longer finds. The guard around that branch tested the *column* count of a data frame, so it held even with no row kept, and the branch then took the complement of an empty selection withx[-which(...), ], which in R keeps nothing rather than everything. On a package with eleven declared dependencies, two survived. The only visible trace was a message readingPackage(s) is(are) in category 'Depends'with an empty list. The guard now counts rows, and the complement is taken by negating the logical test, which is correct on an empty frame instead of correct by accident (#146).
Show all changes in 1.2.0Hide the rest of the changes in 1.2.0
att_from_rscript()(and thereforeatt_amend_desc()) no longer reports a variable name as a package name.requireNamespace(),loadNamespace()and thensargument ofgetFromNamespace()take a character string, so a bare symbol there can only be a variable holding the name, never the name itself; the same goes forlibrary()andrequire()when the call passescharacter.only = TRUE. A guard such asfor (pkg in c("callr", "jsonlite")) requireNamespace(pkg, quietly = TRUE)used to add a package literally calledpkgtoDESCRIPTION, which then stopped everyrenv/pakinstall on a package that cannot exist. A symbol is still read as the package name forlibrary(),require()anduse(), which compute on the unevaluated argument (#143).- Named arguments of a dependency-introducing call are now matched the way R matches them, by exact name first and then by a prefix unambiguous among the formals, instead of by string equality. An abbreviated but perfectly legal spelling of the flag,
library(pkgvar, char = TRUE), went unrecognised and added a package named after the variable; and an abbreviated package argument,library(pack = "jsonlite"), was missed altogether. The formals are read from the running R rather than written down here, and a formal placed after...is matched by its exact name only, which is R's own rule (#143). att_amend_desc()no longer lets anEnhancesversion constraint override theImportsone for the same package. The rule that picks a version when a package is pinned under two types ordered the type as text, and"Enhances"sorts before"Imports", soEnhances: pkg (>= 9.9.9)replacedImports: pkg (>= 2.0.0)and wrote a bound nobody had set for that type, which can make a package uninstallable. The precedence is now named explicitly, strongest first: Imports, Depends, LinkingTo, Suggests, Enhances.att_amend_desc()no longer counts a removal twice, nor names the package twice, when DESCRIPTION lists it under two dependency types. The list read by the comparison holds one row per (type, package) pair, so a package pinned under bothImportsandSuggestsproduced[-] 2 package(s) removed: pkgA, pkgAfor a single removal.
New features
att_amend_desc()never drops a version constraint set by hand in DESCRIPTION. A package that no scanned source mentions used to be removed and its constraint to go with it, and a package listed inpkg_ignoreused to be removed too, althoughpkg_ignoremeans "do not infer this from code" and not "delete what I wrote". Such an entry is now kept as declared, with its type and its version, and reported so the decision is visible. Wideningdir.rmakes it a detected dependency again; removing its constraint lets it go. A **bare** entry, with no version, is still removed: there is nothing to lose, andpkg_ignorestays usable for cleaning a wrong entry out. AnImportskept this way while no code uses it drawsAll declared Imports should be usedfrom R CMD check, which reports a real defect of the package being amended that dropping the pin used to conceal (#139).
Maintenance
- The test suite reads lockfiles with
renv::lockfile_read()instead of reaching into renv withgetFromNamespace("lockfile", "renv"), which stopped working when renv 1.2.4 changed that internal.renvmoves fromSuggests: renv (>= 0.8.4)torenv (>= 1.0.0), the version that introduced the public lockfile functions.
From NEWS.md in the release
Install
Health
- OK13 OK2026-10-17
- WARNING12 OK, 1 WARNING2026-10-01
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 20 (4 internal)includes a package overview page
- Examples that run
- 81%13 run in a plain check · 3 never run
- Exported functions with examples
- 84%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 86%
- Median days to close, 50 most recently updated closed issues
- 40
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
11 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/thinkr-open/attachment on 2026-10-22.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-09-30 · The repository has a site deploy workflow
pkgdown site last built 2026-09-30
Show all practicesHide 2 practices
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen 2026-04-19Pull request: opened by its own account
- Claude Codefirst seen 2026-04-24Seen in the repository: CLAUDE.mdNamed in .Rbuildignore: .claude, CLAUDE.mdNamed in .gitignore: .claude
Dependencies
Installing attachment adds 45 packages (24 with compiled code, 32 MB of source tarballs). Heaviest: stringi 11 MB, bslib 5.6 MB, sass 2.9 MB.
Code & Tests
People & History
Previously maintained by Sébastien Rochette (0.2.0 to 0.4.2) and Vincent Guyader (0.0.9 to 0.1.0).
Pick two releases to compare their code metrics.
- 1.2.0Latest
- 1.1.02026-04-25 · diff ↗
- 1.0.02026-04-25 · diff ↗
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 0.4.52025-03-14 · diff ↗
- 0.4.42025-02-08 · diff ↗
- 0.4.3
- 0.4.22024-07-01 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 0.4.12024-01-22 · diff ↗
- 0.4.02023-05-31 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 0.3.12023-01-27 · diff ↗
- unarchivedReturned to CRAN2022-09-19
- 0.3.0
Show 12 earlier eventsHide 12 earlier events
Package metadata
- First published
- 2019-05-05
- Total releases
- 18 / 7 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 3.4
- Download size
- 223 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("attachment")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.