Skip to content

Add a new repository to the list of repositories that pak uses to look for packages.


repo_add(..., .list = NULL)




Repository specifications, possibly named character vectors. See details below.


List or character vector of repository specifications. This argument is easier to use programmatically than .... See details below.


Repository specification, a possibly named character scalar.


repo_resolve() returns a named character scalar, the URL of the repository.


repo_add() adds new repositories. It resolves the specified repositories using repo_resolve() and then modifies the repos global option.

repo_add() only has an effect in the current R session. If you want to keep your configuration between R sessions, then set the repos option to the desired value in your user or project .Rprofile file.

Repository specifications

The format of a repository specification is a named or unnamed character scalar. If the name is missing, pak adds a name automatically. The repository named CRAN is the main CRAN repository, but otherwise names are informational.

Currently supported repository specifications:

  • URL pointing to the root of the CRAN-like repository. Example:

  • PPM@latest, PPM (Posit Package Manager, formerly RStudio Package Manager), the latest snapshot.

  • PPM@<date>, PPM (Posit Package Manager, formerly RStudio Package Manager) snapshot, at the specified date.

  • PPM@<package>-<version> PPM snapshot, for the day after the release of <version> of <package>.

  • PPM@R-<version> PPM snapshot, for the day after R <version> was released.

Still works for dates starting from 2017-10-10, but now deprecated, because MRAN is discontinued:

  • MRAN@<date>, MRAN (Microsoft R Application Network) snapshot, at the specified date.

  • MRAN@<package>-<version> MRAN snapshot, for the day after the release of <version> of <package>.

  • MRAN@R-<version> MRAN snapshot, for the day after R <version> was released.



repo_add(PPMdplyr100 = "PPM@dplyr-1.0.0")

#> # A data frame: 7 × 5                                                   
#>   name          url                         type  r_version bioc_version
#> * <chr>         <chr>                       <chr> <chr>     <chr>       
#> 1 CRAN cran  *         NA          
#> 2 PPMdplyr100   https://packagemanager.pos… cran… *         NA          
#> 3 BioCsoft… bioc  4.3.1     3.17        
#> 4 BioCann… bioc  4.3.1     3.17        
#> 5 BioCexp… bioc  4.3.1     3.17        
#> 6 BioCworkflows… bioc  4.3.1     3.17        
#> 7 BioCbooks… bioc  4.3.1     3.17        


#>                                       CRAN                              
#> ""                              


#>                                       CRAN                              
#> ""                              


#>                                       CRAN                              
#> ""                              

See also

Other repository functions: repo_get(), repo_status()