Skip to content

Commit 98318e7

Browse files
committed
Merge branch 'statistical-models-ws' of https://github.com/EDUCE-UBC/educer into statistical-models-ws
2 parents 5edafde + c91b331 commit 98318e7

File tree

14 files changed

+3213
-251
lines changed

14 files changed

+3213
-251
lines changed

.Rbuildignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
^.*\.Rproj$
22
^\.Rproj\.user$
33
^data-raw$
4+
^\.github$
5+
CODEOWNERS
6+
CONTRIBUTING.md

.github/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.html

.github/workflows/R-CMD-check.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
2+
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
name: R-CMD-check
14+
15+
jobs:
16+
R-CMD-check:
17+
runs-on: macOS-latest
18+
env:
19+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- uses: r-lib/actions/setup-r@v1
23+
- name: Install dependencies
24+
run: |
25+
install.packages(c("remotes", "rcmdcheck"))
26+
remotes::install_deps(dependencies = TRUE)
27+
shell: Rscript {0}
28+
- name: Check
29+
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
30+
shell: Rscript {0}

.github/workflows/pkgdown.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
- master
6+
7+
name: pkgdown
8+
9+
jobs:
10+
pkgdown:
11+
runs-on: macOS-latest
12+
env:
13+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- uses: r-lib/actions/setup-r@v1
18+
19+
- uses: r-lib/actions/setup-pandoc@v1
20+
21+
- name: Query dependencies
22+
run: |
23+
install.packages('remotes')
24+
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
25+
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
26+
shell: Rscript {0}
27+
28+
- name: Cache R packages
29+
uses: actions/cache@v2
30+
with:
31+
path: ${{ env.R_LIBS_USER }}
32+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
33+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
34+
35+
- name: Install dependencies
36+
run: |
37+
remotes::install_deps(dependencies = TRUE)
38+
install.packages("pkgdown", type = "binary")
39+
install.packages("rsconnect", type = "binary")
40+
shell: Rscript {0}
41+
42+
- name: Install package
43+
run: R CMD INSTALL .
44+
45+
- name: Deploy package
46+
run: |
47+
git config --local user.email "[email protected]"
48+
git config --local user.name "GitHub Actions"
49+
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Contributing to educer
2+
3+
Thank you for taking the time to contribute to educer!
4+
5+
## What should I know before I get started?
6+
7+
Please see our general resources for EDUCE contributors on our [EDUCE-UBC.github.io Wiki](https://github.com/EDUCE-UBC/EDUCE-UBC.github.io/wiki/Contributors).
8+
9+
## Package conventions
10+
11+
- Place any images in the `inst/resources/images/` folder.
12+
- If it does not exist yet, create an R setup code chunk in the `.Rmd` file of the learnr tutorial right after the yaml header.
13+
- Add the following line of code to the R setup code chunk:
14+
15+
```
16+
library(educer)
17+
setup_resources()
18+
```
19+
20+
- To add an image in the `.Rmd` file of the learnr tutorial, you can now give the path to an `image.ext` in `inst/resources/images/` like so (you MUST include the first `/`):
21+
22+
```
23+
![](/images/image.ext)
24+
```
25+
26+
- You can learn more about the helper function `setup_resources()` with `?setup_resources` and add other paths to resources (e.g. `resources/css/` is already established).

README.md

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,31 @@
1-
21
# educer
32

43
<!-- badges: start -->
5-
<!-- badges: end -->
64

7-
Please visit the EDUCE homepage for [install instructions of R and RStudio](https://educe-ubc.github.io/r_and_rstudio.html).
5+
[![R-CMD-check](https://github.com/EDUCE-UBC/educer/workflows/R-CMD-check/badge.svg)](https://github.com/EDUCE-UBC/educer/actions)
86

7+
<!-- badges: end -->
98

9+
Please visit the EDUCE homepage for [install instructions of R and RStudio](https://educe-ubc.github.io/r_and_rstudio.html).
1010

1111
## Installation
1212

1313
You can install the released version of educer from GitHub with:
1414

15-
``` r
15+
```
1616
if (!require(devtools)) install.packages("devtools")
1717
devtools::install_github("EDUCE-UBC/educer")
1818
```
1919

2020
See the EDUCE homepage for more detailed [install instructions](https://educe-ubc.github.io/educer.html).
2121

22-
23-
2422
## Loading and getting help on the educer package
2523

26-
``` r
24+
```
2725
library(educer)
2826
?educer
2927
```
3028

31-
32-
3329
## Using the interactive tutorials
3430

3531
Please the the EDUCE homepage for information on how to [start the tutorials](https://educe-ubc.github.io/tutorials.html).
36-
37-
38-
39-
## For developers
40-
41-
- Place any images in the `inst/resources/images/` folder
42-
- If it does not exist yet, create an r setup code chunk in the tutorial.Rmd file right after the yaml header
43-
- Add the following line of code to the r setup code chunk:
44-
45-
```
46-
library(educer)
47-
setup_resources()
48-
```
49-
50-
- To add an image in tutorial.Rmd, you can now give the path to an `image.ext` in `inst/resources/images/` like so (you MUST include the first `/`):
51-
![](/images/image.ext)
52-
- You can learn more about the helper function `setup_resources` with `?setup_resources` and add other paths to resources (css is already established).

0 commit comments

Comments
 (0)