- GitHub对unauthenticated用户的请求限制为60次/小时,与文件大小无关,但是只能发送60次下载请求。对authenticated用户的限制则为5000次/小时。
- 因此如果一次性从github下载了太多包,就可能从某个包开始出现如下报错
HTTP error 403.
API rate limit exceeded for "这里是你的IP". (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)
Rate limit remaining: 0/60
Rate limit reset at: 2020-10-27 12:48:31 UTC
To increase your GitHub API rate limit
- Use `usethis::browse_github_pat()` to create a Personal Access Token.
- Use `usethis::edit_r_environ()` and add the token as `GITHUB_PAT`.
- 处理要点就在最后两行代码中(也可以手动进入GitHub操作)
- 首先在Rstudio中输入
usethis::browse_github_pat()
- console中返回
Opening URL 'https://github.com/settings/tokens/new?scopes=repo,gist,user:email&description=R:GITHUB_PAT'
* Call `usethis::edit_r_environ()` to open '.Renviron'.
* Store your PAT (personal access token) with a line like:
GITHUB_PAT=xxxyyyzzz
[Copied to clipboard]
* Make sure '.Renviron' ends with a newline!
-
同时浏览器自动跳转到GitHub的这个界面
- 然后进入https://travis-ci.com/,可以使用GitHub账户登录,从主页选择这个setting界面
-
来到environment variables栏目
- 按照刚才GitHub personal access token的名字和密码填入Name和Value,Branch可以默认选择所有,然后Add
- 重新在Rstudio安装包,限制解除