Exercises: Using RSPM Repositories

Overview

In the following exercises, you will:

  • Add new repositories and sources for:
    • Serving packages from CRAN
    • Serving packages from curated CRAN
    • Serving packages from Git

Refer to the RSPM Documentation
throughout the exercises, specifically the Getting Started: Configuration
section.

Task: Add a CRAN repository

Follow the documented steps for Serving CRAN Packages to add a new repository that is subscribed to the CRAN source.

The steps you will perform are outlined as follows:

  • Initiate a sync from the default CRAN source
  • Create a new repository
  • Subscribe the new repository to the default CRAN source

You can verify that the new repository has been configured correctly by running:

rspm list

Which should include the following output:

prod-cran - Access CRAN packages
 - cran (CRAN)

Task: Explore CRAN repository

Navigate to the RSPM web interface in your browser and view the newly created prod-cran repository.

Search for the ggplot2 package and determine the following:

  • The newest version of the package that is available
  • The oldest version of the package that is available
  • The license type for this package
  • The command that R users can use to install the latest version of ggplot2
  • The command that R users can use to install version 2.2.0 of ggplot2
  • How many packages are imported and suggested by ggplot2

Quiz: CRAN source

Quiz

Quiz

Quiz

Task: Add a curated CRAN repository

Follow the documented steps for Serving a Subset of Approved CRAN Packages to add a new repository that is subscribed to a source of approved CRAN packages.

Hint: You can also pass in the names of packages directly instead of creating a list of packages, as in:

rspm add --packages 'plumber,shiny,ISLR' --source=subset --dryrun

Hint: Re-use the transaction ID output from the rspm add command with --dryrun flag.

The steps you will perform are outlined as follows:

  • Create a list of packages
  • Initiate a sync from the default CRAN source
  • Create a new source for the approved packages
  • Add the desired packages to the curated CRAN source
  • View the list of proposed packages that will be added to the newly created source
  • Add the proposed packages to the newly created source
  • Create a new repository for the approved packages
  • Subscribe the new repository to the default CRAN source

You can verify that the new repository has been configured correctly by running:

rspm list

Which should include the following output:

approved-cran - Approved packages from CRAN
 - subset (Curated CRAN)

Navigate to the RSPM web interface in your browser and explore the newly created approved-cran repository.

Quiz: Curated CRAN source

Quiz

Quiz

Quiz

Quiz

Task: Add a Git repository

Follow the documented steps for Serving Local Packages from Git to add a new repository that is subscribed to a source with packages from Git.

Hint: You’ll need to configure the version of R using the Server.RVersion option in the config file and then restart RSPM.

Hint: Use the Git URL https://github.com/rstudio/shiny.git in the --git-url option in the rspm add command.

The steps you will perform are outlined as follows:

  • Create a new source for the packages from Git
  • Add a Git endpoint to the newly created source
  • Create a new repository for the packages from Git
  • Subscribe the new repository to the Git-based source

You can verify that the new repository has been configured correctly by running the following command:

rspm list

Which should include the following output:

prod - Stable releases of our internal packages
 - prod-internal-src (Git)

And you can verify the Git builder by running the following command:

rspm list git-builders

Which should include the following output:

Git Builders:
- shiny
    Source: prod-internal-src
    URL: https://github.com/rstudio/shiny.git
    Trigger: tags
    Key: none

Navigate to the RSPM web interface in your browser and explore the newly created prod repository.

After a few minutes, you should see the latest tagged release build of shiny in your prod repository.

Quiz: Git source

Quiz