R Analysis (renv)
Currently, we only support analysis of r project which are using renv package manager.
2 min readUpdated Jul 9, 2026
Overview
Currently, we only support analysis of r project which are using renv package manager.
| Files | Direct Deps | Deep Deps | Edges | Classifies Dev & Test Deps | Container Scanning |
|---|---|---|---|---|---|
renv.lock | (included but not classified as direct) | ✅ | ✅ | ❌ | ✅ |
DESCRIPTION & renv.lock | ✅ | ✅ | ✅ | ❌ | ✅ |
Project Discovery
Find a file named DESCRIPTION, and optionally look for renv.lock in the same directory as DESCRIPTION. Discovery will not look for projects inside renv directory, if renv.lock or DESCRIPTION files are discovered.
Analysis
- Parse
DESCRIPTIONfile to identify direct dependencies - we look for packages inDepends,Imports,Suggests,Enhances,LinkingTo. - Parse
renv.lockfile to identify deep dependencies, and edges among them.
Limitations
- If only
DESCRIPTIONfile is accessible, FOSSA CLI will ignore version constraints, and will always default to latest version.
Example
- Create
DESCRIPTIONfile:
Type: project
Description: My project
Depends: tidyverse
- Create
main.Rfile:
R
# you may need to execute following: # if you do not have renv installed# >> install.packages("renv", repos = "http://cran.us.r-project.org") # initiate project# ref: https://rstudio.github.io/renv/reference/init.htmloptions(renv.config.install.verbose = TRUE)options(renv.config.install.transactional = FALSE)renv::init(bare = TRUE)renv::install("glue@1.2.0")renv::install() # some example codeSquare <- function(x) { return(x^2)}print(Square(4)) # create renv.lock# ref: https://rstudio.github.io/renv/reference/snapshot.htmlrenv::snapshot()- execute
rscript main.R - execute
fossa analyze --only-target renv --output(run analysis onlyrenv, but do not upload result to an endpoint)
Limitations
fossa-clicannot identify test or development dependencies, and by default includes all dependencies in the analysis.fossa-cliwill ignore version constraint ifrenv.lockfile is not present.fossa-clicannot analyze path dependencies.- Please refer to vendored dependencies for workaround.
FAQ
How do I only perform analysis for renv?
Explicitly specify an analysis target in .fossa.yml file. The example below excludes all other analysis targets:
YAML
# .fossa.yml version: 3targets: only: - type: renvFOSSA's analyzed dependencies are incorrect or missing a package.
Please file a ticket at FOSSA support portal.
Make sure to attach following for quick response from support or development team.
DESCRIPTIONfilerenv.lockfile (if any)- stdout of
renv::diagnostics()