Create your R package

(Connect Rstudio to Github and push project to Github)

Posted by Chevy on February 21, 2024

1. Use Rstudio to create a new project for package

Reference:R Package Development > Start from a brand new environment.

2. Connecting Rstudio to Github

Reference:how-to-use-git-github-with-r

# 1. create token from github
usethis::create_github_token()

# 2. set token to Rstudio, paste the PAT to Rstudio window
# gitcreds::gitcreds_set()
credentials::set_github_pat()

# 3. create repo based on local repo and push to github
usethis::use_github()

# 4. create a vignette
usethis::use_vignette(name = "chunhui_vignette", title = "This is a vignette")