rgithubggplot2installationfailed-installation

Failed to install 'unknown package' from GitHub


I am trying to install the ggpattern package from GitHub (https://www.rdocumentation.org/packages/ggpattern/versions/0.2.0)

I've reinstalled R, followed the all steps according to the site, also tried

remotes::install_github("coolbutuseless/ggpattern", force = TRUE)

But I still get:

Error: Failed to install 'unknown package' from GitHub:
  HTTP error 401.
  Bad credentials

  Rate limit remaining: 19/60
  Rate limit reset at: 2022-01-29 18:28:15 UTC

I'm working on R version 4.1.2 (newest according to me) on Windows. Do you have any idea what is the issue here?


Solution

  • You need to check if you have a personal access token set in your environment. For example, when I have a Git project, I set a personal access token. However, I set this in the project environment, so that it isn't any issues outside of that environment.

    To see if there is one assigned:

    Sys.getenv("GITHUB_PAT")
    

    If there is one set, write it down (you may need that in the future).

    To remove it, so you can install the GitHub package:

    Sys.unsetenv("GITHUB_PAT")