在RStudio中设置代理GitHub
$$
\newcommand{\indep}{\mathrel{\perp\mkern-10mu\perp}}
\newcommand{\P}{\mathbb{P}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\E}{\mathbb{E}}
\newcommand{\Var}{\operatorname{Var}}
\newcommand{\Cov}{\operatorname{Cov}}
\newcommand{\1}[1]{\mathbf{1}\\{#1\\}}
$$
设置代理
在国内使用RStudio难以连接GitHub,需要设置代理。
使用 usethis 📦中的函数:usethis::edit_r_environ()
将以下code写入该文件 (7890 为端口,按实际情况设置)。NOTE: the format is matter!
https_proxy=http://127.0.0.1:7890
http_proxy=http://127.0.0.1:7890
all_proxy=socks5://127.0.0.1:7890
最后,restart RStudio then we are good!
Setting GitHub Token
check this article for more information.
library(usethis)
gh_token_help()
create_github_token()
gitcreds::gitcreds_set()