Skip to contents

Reports about a package

Usage

package_report(
  package_name,
  package_version,
  package = NULL,
  template_path = system.file("report/pkg_template.qmd", package = "riskreports"),
  output_format = "all",
  params = list(),
  ...
)

Arguments

package_name

Package name.

package_version

Package version number.

package

Path where to find a package source to retrieve name and version number.

template_path

Path to a custom quarto template file

output_format

Output format for the report. Default is "all".

params

A list of execute parameters passed to the template

...

Additional arguments passed to quarto::quarto_render()

Value

A path to the reports generated, called by its side effects.

Examples

pr <- package_report(
  package_name = "dplyr",
  package_version = "1.1.4",
  params = list(
    assessment_path = system.file("assessments/dplyr.rds", package = "riskreports"),
    image = "rhub/ref-image")
)
#> Warning: Please install the latest (devel) version of Quarto
#> 
#> 
#> processing file: validation_report_dplyr_v1.1.4.qmd
#> 1/37                          
#> 2/37 [setup]                  
#> 3/37                          
#> 4/37 [loading]                
#> 5/37                          
#> 6/37 [image]                  
#> 7/37                          
#> 8/37 [read-riskmetric]        
#> 9/37                          
#> 10/37 [general-riskmetric]     
#> 11/37                          
#> 12/37 [dependencies-riskmetric]
#> 13/37                          
#> 14/37 [dependencies]           
#> 15/37                          
#> 16/37 [namespace]              
#> 17/37                          
#> [1] 1
#> attr(,"class")
#> [1] "pkg_metric_has_news" "pkg_metric"          "integer"            
#> attr(,"label")
#> [1] "number of discovered NEWS files"
#> [1] "MIT + file LICENSE"
#> attr(,".recording")
#> attr(,".recording")$expr
#> {
#>     x$license
#> }
#> 
#> attr(,".recording")$attributes
#> NULL
#> 
#> attr(,".recording")$visible
#> [1] TRUE
#> 
#> attr(,".recording")$traceback
#> NULL
#> 
#> attr(,".recording")$output
#> character(0)
#> 
#> attr(,"class")
#> [1] "pkg_metric_license"  "pkg_metric"          "with_eval_recording"
#> [4] "character"          
#> attr(,"label")
#> [1] "software is released with an acceptable license"
#> 18/37 [execution_info]         
#> 19/37                          
#> 20/37 [session_info]           
#> 21/37                          
#> 22/37 [platform]               
#> 23/37                          
#> 24/37 [capabilities]           
#> 25/37                          
#> 26/37 [external-software]      
#> 27/37                          
#> 28/37 [graphic-software]       
#> 29/37                          
#> 30/37 [machine]                
#> 31/37                          
#> 32/37 [RNGKind]                
#> 33/37                          
#> 34/37 [computing]              
#> 35/37                          
#> 36/37 [options]                
#> 37/37                          
#> output file: validation_report_dplyr_v1.1.4.knit.md
#> 
#> pandoc 
#>   to: html
#>   output-file: validation_report_dplyr_v1.1.4.html
#>   standalone: true
#>   embed-resources: true
#>   section-divs: true
#>   html-math-method: mathjax
#>   wrap: none
#>   default-image-extension: png
#>   toc: true
#>   
#> metadata
#>   document-css: false
#>   link-citations: true
#>   lang: en
#>   title: Validation Report - `r paste0(params$package_name, '@', params$package_version)`
#>   date-format: ddd MMM DD hh:mm:ss A YYYY
#>   
#> 
#> 
#> processing file: validation_report_dplyr_v1.1.4.qmd
#> 1/37                          
#> 2/37 [setup]                  
#> 3/37                          
#> 4/37 [loading]                
#> 5/37                          
#> 6/37 [image]                  
#> 7/37                          
#> 8/37 [read-riskmetric]        
#> 9/37                          
#> 10/37 [general-riskmetric]     
#> 11/37                          
#> 12/37 [dependencies-riskmetric]
#> 13/37                          
#> 14/37 [dependencies]           
#> 15/37                          
#> 16/37 [namespace]              
#> 17/37                          
#> [1] 1
#> attr(,"class")
#> [1] "pkg_metric_has_news" "pkg_metric"          "integer"            
#> attr(,"label")
#> [1] "number of discovered NEWS files"
#> [1] "MIT + file LICENSE"
#> attr(,".recording")
#> attr(,".recording")$expr
#> {
#>     x$license
#> }
#> 
#> attr(,".recording")$attributes
#> NULL
#> 
#> attr(,".recording")$visible
#> [1] TRUE
#> 
#> attr(,".recording")$traceback
#> NULL
#> 
#> attr(,".recording")$output
#> character(0)
#> 
#> attr(,"class")
#> [1] "pkg_metric_license"  "pkg_metric"          "with_eval_recording"
#> [4] "character"          
#> attr(,"label")
#> [1] "software is released with an acceptable license"
#> 18/37 [execution_info]         
#> 19/37                          
#> 20/37 [session_info]           
#> 21/37                          
#> 22/37 [platform]               
#> 23/37                          
#> 24/37 [capabilities]           
#> 25/37                          
#> 26/37 [external-software]      
#> 27/37                          
#> 28/37 [graphic-software]       
#> 29/37                          
#> 30/37 [machine]                
#> 31/37                          
#> 32/37 [RNGKind]                
#> 33/37                          
#> 34/37 [computing]              
#> 35/37                          
#> 36/37 [options]                
#> 37/37                          
#> output file: validation_report_dplyr_v1.1.4.knit.md
#> 
#> pandoc 
#>   to: >-
#>     commonmark+autolink_bare_uris+emoji+footnotes+gfm_auto_identifiers+pipe_tables+strikeout+task_lists+tex_math_dollars
#>   output-file: validation_report_dplyr_v1.1.4.md
#>   standalone: true
#>   default-image-extension: png
#>   html-math-method: webtex
#>   
#> metadata
#>   title: Validation Report - `r paste0(params$package_name, '@', params$package_version)`
#>   date-format: ddd MMM DD hh:mm:ss A YYYY
#>   
#> Output created: validation_report_dplyr_v1.1.4.html
#> 
#> 
pr
#> [1] "/home/runner/work/riskreports/riskreports/docs/reference/validation_report_dplyr_v1.1.4.html"
#> [2] "/home/runner/work/riskreports/riskreports/docs/reference/validation_report_dplyr_v1.1.4.md"  
file.remove(pr)
#> [1] TRUE TRUE