Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
caitobrien committed May 1, 2024
1 parent 7d2a608 commit a2e141c
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,31 @@ This option will run the Shiny App within you RStudio environment but will not d

3. Once project is created, and the repository is cloned, you can run the app within R environment by going to the folder: `dev > run_dev.R` and loading lines of code, with the final `run_app()` to launch the app.


*Possible download error with GitHubs security settings:*

If you receive an error associated with github_PAT credentials, you may need to setup a GitHub Personal Access Token (PAT) for authentication when you try to install a package from GitHub using `devtools::install_github()`. Here are the steps to resolve this issue:

1. **Generate a new GitHub PAT**: Go to your GitHub account settings, then to Developer settings -> Personal access tokens -> Generate new token (classic or fine-grained). Set expiration date and save token. Token will disappear if not saved.

2. **Set the new PAT in your R environment**: You can use the `usethis` package to set the PAT in your R environment. Here's how:

```r
# Install the usethis package if you haven't already
install.packages("usethis")

# Use usethis to set the GITHUB_PAT environment variable
usethis::edit_r_environ()

# This will open your .Renviron file in a text editor. Add the following line to the file, replacing "your_new_pat" with your actual PAT:
GITHUB_PAT=your_new_pat

# Save and close the file. Then, restart your R session to make sure the new environment variable takes effect.
```

3. **Try installing the package again**: Now, you should be able to install the package from GitHub without encountering the authentication error. Follow steps in Option 1.


The app structure follows a Golem framework described in [Engineering Production-Grade Shiny Apps](https://engineering-shiny.org/setting-up-for-success.html) by Colin Fay, Sébastien Rochette, Vincent Guyader and Cervan Girard.

## Contact
Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,38 @@ repository. Alternatively, within Rstudio, use the following steps:
`dev > run_dev.R` and loading lines of code, with the final
`run_app()` to launch the app.

*Possible download error with GitHubs security settings:*

If you receive an error associated with github_PAT credentials, you may
need to setup a GitHub Personal Access Token (PAT) for authentication
when you try to install a package from GitHub using
`devtools::install_github()`. Here are the steps to resolve this issue:

1. **Generate a new GitHub PAT**: Go to your GitHub account settings,
then to Developer settings -\> Personal access tokens -\> Generate
new token (classic or fine-grained). Set expiration date and save
token. Token will disappear if not saved.

2. **Set the new PAT in your R environment**: You can use the `usethis`
package to set the PAT in your R environment. Here’s how:

``` r
# Install the usethis package if you haven't already
install.packages("usethis")

# Use usethis to set the GITHUB_PAT environment variable
usethis::edit_r_environ()

# This will open your .Renviron file in a text editor. Add the following line to the file, replacing "your_new_pat" with your actual PAT:
GITHUB_PAT=your_new_pat

# Save and close the file. Then, restart your R session to make sure the new environment variable takes effect.
```

3. **Try installing the package again**: Now, you should be able to
install the package from GitHub without encountering the
authentication error. Follow steps in Option 1.

The app structure follows a Golem framework described in [Engineering
Production-Grade Shiny
Apps](https://engineering-shiny.org/setting-up-for-success.html) by
Expand Down

0 comments on commit a2e141c

Please sign in to comment.