R configuration for packages - - PowerPoint PPT Presentation

r configuration for packages install packages c devtools
SMART_READER_LITE
LIVE PREVIEW

R configuration for packages - - PowerPoint PPT Presentation

R configuration for packages install.packages(c("devtools", "usethis", "testthat", "reprex", "pkgdown")) git_sitrep() > library(usethis) > git_sitrep() Git user * Name: 'Amelia McNamara'


slide-1
SLIDE 1

R configuration for packages

slide-2
SLIDE 2

install.packages(c("devtools", "usethis", "testthat", "reprex", "pkgdown"))

slide-3
SLIDE 3

git_sitrep()

> library(usethis) > git_sitrep() Git user * Name: 'Amelia McNamara' * Email: 'amelia.mcnamara@stthomas.edu' * Vaccinated: TRUE usethis + git2r * Default usethis protocol: https * git2r supports SSH: FALSE * Credentials: '<usethis + git2r default behaviour>' GitHub * Personal access token: '<found in env var>' * User: 'AmeliaMN' * Name: 'Amelia McNamara' Repo ℹ No active usethis project.

slide-4
SLIDE 4

If your name, email, and vaccinate aren’t set:

library("usethis") use_git_config(user.name = "Amelia McNamara", user.email = "amelia.mcnamara@stthomas.edu") git_vaccinate()

slide-5
SLIDE 5

git_sitrep()

> library(usethis) > git_sitrep() Git user * Name: 'Amelia McNamara' * Email: 'amelia.mcnamara@stthomas.edu' * Vaccinated: TRUE usethis + git2r * Default usethis protocol: https * git2r supports SSH: FALSE * Credentials: '<usethis + git2r default behaviour>' GitHub * Personal access token: '<found in env var>' * User: 'AmeliaMN' * Name: 'Amelia McNamara' Repo ℹ No active usethis project.

slide-6
SLIDE 6

To get here, we need to set our Github PAT

  • Open .Renviron, with

edit_r_environ()

  • Add some generic code (I provided

an example on the course site)

  • Go find your GitHub access token,

using browse_github_pat()

  • Copy the token from GitHub
  • Paste into your .Renviron (make

sure there’s a newline after it), save .Renviron

  • Restart R (Session -> Restart R)

Give it a new name, leave the default check boxes, scroll down and generate token

slide-7
SLIDE 7

git_sitrep()

> library(usethis) > git_sitrep() Git user * Name: 'Amelia McNamara' * Email: 'amelia.mcnamara@stthomas.edu' * Vaccinated: TRUE usethis + git2r * Default usethis protocol: https * git2r supports SSH: FALSE * Credentials: '<usethis + git2r default behaviour>' GitHub * Personal access token: '<found in env var>' * User: 'AmeliaMN' * Name: 'Amelia McNamara' Repo ℹ No active usethis project.

slide-8
SLIDE 8

edit_r_profile()

  • Open .Rprofile, with

edit_r_profile()

  • Add some generic code (I

provided an example on the course site)

  • Edit your name and email

address, make sure the file ends with a newline, save .Rprofile

  • Restart R (Session -> Restart

R)

slide-9
SLIDE 9

git_sitrep()

> library(usethis) > git_sitrep() Git user * Name: 'Amelia McNamara' * Email: 'amelia.mcnamara@stthomas.edu' * Vaccinated: TRUE usethis + git2r * Default usethis protocol: https * git2r supports SSH: FALSE * Credentials: '<usethis + git2r default behaviour>' GitHub * Personal access token: '<found in env var>' * User: 'AmeliaMN' * Name: 'Amelia McNamara' Repo ℹ No active usethis project.