pharmaR / riskmetric

Metrics to evaluate the risk of R packages
https://pharmar.github.io/riskmetric/
Other
159 stars 30 forks source link

Define a class for a cohort of R packages and its metrics #198

Open elong0527 opened 3 years ago

elong0527 commented 3 years ago

Following the discussion in #174, we need to discuss and create a prototype for a class that:

  1. can contain package metrics for a group of packages
  2. can contain cohort level assessments (to use riskmetric parlance)
  3. can contain cohort level reference information
elimillera commented 2 years ago

Arguments

pkgs - First argument is a character vector (or ellipsis?) that represents packages to be constructed into a cohort. This could also be a vector/list of existing package refs. dependancies - Should package dependancies for explicitly passed packages be listed in the cohort_ref? Allowable values would be the same as the dependancies argument in install.packages. lib.loc - A library to pull a list of installed packages from. repo - A repository to pull all available packages from. ... - Passed to methods

Qualities of a cohort_ref object

Unclassed object could be a tibble/list where each row relates to a single package and contains the pkg_refs, and cohort metrics

>cohort_ref("dplyr", "Tplyr")
# Cohort Ref 
  package            dependancies namespace_conflicts license
  <list<pkg_ref>>       <chr>               <chr>             <dbl>
1 Tplyr<cran_remote>     deps                  N/A                 MIT
2 dplyr<install>         deps                  N/A                 MIT

@emilliman5 you've already done quite a bit of work here https://github.com/pharmaR/riskmetric/pull/221. I'm thinking everything I laid out here works with that already, with just a couple extra arguments and functionality. I'd be really interested to hear your throughts