├── .Rbuildignore ├── .github ├── .gitignore └── workflows │ ├── check-full.yaml │ └── pr-commands.yaml ├── .gitignore ├── LICENSE ├── LICENSE.md ├── NAMESPACE ├── R └── foo.R ├── README.Rmd ├── README.md ├── action.yaml ├── fit_model.R ├── foo.Rmd ├── foo.md ├── foo └── DESCRIPTION ├── man └── foo.Rd ├── renv.lock ├── report.Rmd ├── src └── code.c ├── tests ├── testthat.R └── testthat │ └── test-foo.R └── vignettes ├── .gitignore └── test.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^renv$ 2 | ^renv\.lock$ 3 | ^LICENSE\.md$ 4 | ^\.github$ 5 | 6 | ^README\.Rmd$ 7 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/workflows/check-full.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: [main, master] 4 | pull_request: 5 | branches: [main, master] 6 | 7 | name: R-CMD-check 8 | 9 | jobs: 10 | R-CMD-check: 11 | runs-on: ${{ matrix.config.os }} 12 | 13 | name: ${{ matrix.config.os }} (${{ matrix.config.r }}) 14 | 15 | strategy: 16 | fail-fast: false 17 | matrix: 18 | config: 19 | - {os: windows-latest, r: '4.1'} 20 | - {os: ubuntu-latest, r: '4.1'} 21 | - {os: macOS-latest, r: '4.1'} 22 | 23 | steps: 24 | - uses: actions/checkout@v2 25 | - uses: r-lib/actions/setup-r@v1 26 | with: 27 | r-version: ${{ matrix.config.r }} 28 | use-public-rspm: true 29 | 30 | - uses: r-lib/actions/setup-r-dependencies@TNonet-master 31 | with: 32 | working-directory: 'foo' 33 | -------------------------------------------------------------------------------- /.github/workflows/pr-commands.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/master/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | issue_comment: 5 | types: [created] 6 | 7 | name: Commands 8 | 9 | jobs: 10 | document: 11 | if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }} 12 | name: document 13 | runs-on: ubuntu-latest 14 | env: 15 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 16 | steps: 17 | - uses: actions/checkout@v2 18 | 19 | - uses: r-lib/actions/pr-fetch@v1 20 | with: 21 | repo-token: ${{ secrets.GITHUB_TOKEN }} 22 | 23 | - uses: r-lib/actions/setup-r@v1 24 | with: 25 | use-public-rspm: true 26 | 27 | - uses: r-lib/actions/setup-r-dependencies@v1 28 | with: 29 | extra-packages: roxygen2 30 | 31 | - name: Document 32 | run: Rscript -e 'roxygen2::roxygenise()' 33 | 34 | - name: commit 35 | run: | 36 | git config --local user.name "$GITHUB_ACTOR" 37 | git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" 38 | git add man/\* NAMESPACE 39 | git commit -m 'Document' 40 | 41 | - uses: r-lib/actions/pr-push@v1 42 | with: 43 | repo-token: ${{ secrets.GITHUB_TOKEN }} 44 | 45 | style: 46 | if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }} 47 | name: style 48 | runs-on: ubuntu-latest 49 | env: 50 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 51 | steps: 52 | - uses: actions/checkout@v2 53 | 54 | - uses: r-lib/actions/pr-fetch@v1 55 | with: 56 | repo-token: ${{ secrets.GITHUB_TOKEN }} 57 | 58 | - uses: r-lib/actions/setup-r@v1 59 | 60 | - name: Install dependencies 61 | run: Rscript -e 'install.packages("styler")' 62 | 63 | - name: Style 64 | run: Rscript -e 'styler::style_pkg()' 65 | 66 | - name: commit 67 | run: | 68 | git config --local user.name "$GITHUB_ACTOR" 69 | git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" 70 | git add \*.R 71 | git commit -m 'Style' 72 | 73 | - uses: r-lib/actions/pr-push@v1 74 | with: 75 | repo-token: ${{ secrets.GITHUB_TOKEN }} 76 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | inst/doc 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | YEAR: 2019 2 | COPYRIGHT HOLDER: Jim Hester 3 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # MIT License 2 | 3 | Copyright (c) 2019 Jim Hester 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(foo) 4 | export(foo2) 5 | useDynLib(ractionstest, .registration = TRUE) 6 | -------------------------------------------------------------------------------- /R/foo.R: -------------------------------------------------------------------------------- 1 | ## usethis namespace: start 2 | #' @useDynLib ractionstest, .registration = TRUE 3 | ## usethis namespace: end 4 | NULL 5 | 6 | #' Document a function 7 | #' @param x the x parameter 8 | #' @examples 9 | #' 1 + 1 == foo(1) 10 | #' @export 11 | foo = function(x) x + 1 12 | 13 | #' @rdname foo 14 | #' @export 15 | foo2 <- function(x) .Call(sum_, x) 16 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | # R-actions-test 6 | 7 | A repo for testing GitHub Actions readme2 8 | 9 | ```{r} 10 | plot(1:10) 11 | ``` 12 | 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # R-actions-test 3 | 4 | A repo for testing GitHub Actions readme 5 | 6 | ``` r 7 | plot(1:10) 8 | ``` 9 | 10 | ![](README_files/figure-gfm/unnamed-chunk-1-1.png) 11 | -------------------------------------------------------------------------------- /action.yaml: -------------------------------------------------------------------------------- 1 | name: 'install-r-dependencies' 2 | description: 'Action to install R dependencies' 3 | inputs: 4 | cache-version: 5 | description: 'The version of the cache, change this from the default (1) to start over with a fresh cache' 6 | required: true 7 | default: 1 8 | runs: 9 | using: "composite" 10 | steps: 11 | - name: Install pak and query dependencies 12 | run: | 13 | install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") 14 | saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds") 15 | shell: Rscript {0} 16 | 17 | - name: Get R and OS version 18 | id: get-version 19 | run: | 20 | cat("##[set-output name=os-version;]", sessionInfo()$running, "\n", sep = "") 21 | cat("##[set-output name=r-version;]", R.Version()$version.string, sep = "") 22 | shell: Rscript {0} 23 | 24 | - name: Restore R package cache 25 | uses: actions/cache@v2 26 | with: 27 | path: | 28 | ${{ env.R_LIBS_USER }}/* 29 | !${{ env.R_LIBS_USER }}/pak 30 | key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-${{ hashFiles('.github/r-depends.rds') }} 31 | restore-keys: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}- 32 | 33 | - name: Install system dependencies 34 | run: | 35 | if (Sys.info()[["sysname"]] == "Linux") { 36 | pak::local_system_requirements(execute = TRUE) 37 | pak::pkg_system_requirements("rcmdcheck", execute = TRUE) 38 | } 39 | shell: Rscript {0} 40 | 41 | - name: Install dependencies 42 | run: | 43 | options(pak.no_extra_messages = TRUE) 44 | pak::local_install_dev_deps(upgrade = TRUE) 45 | pak::pkg_install("rcmdcheck") 46 | shell: Rscript {0} 47 | 48 | - name: Session info 49 | run: | 50 | options(width = 100) 51 | pkgs <- installed.packages()[, "Package"] 52 | sessioninfo::session_info(pkgs, include_base = TRUE) 53 | shell: Rscript {0} 54 | 55 | - name: Don't use tar 1.30 from Rtools35 to store the cache 56 | shell: bash 57 | run: | 58 | if command -v /c/Rtools/bin/tar && /c/Rtools/bin/tar --version | grep -q 'tar (GNU tar) 1.30' 59 | then echo 'C:/Program Files/Git/usr/bin' >> $GITHUB_PATH 60 | fi 61 | -------------------------------------------------------------------------------- /fit_model.R: -------------------------------------------------------------------------------- 1 | mod <- lm(mpg ~ hp + gear, data = mtcars) 2 | 3 | saveRDS(mod, "model.Rds") 4 | -------------------------------------------------------------------------------- /foo.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: github_document 3 | --- 4 | 5 | # R-actions-test 6 | 7 | A repo for testing GitHub Actions foo2 8 | 9 | ```{r} 10 | plot(1:10) 11 | ``` 12 | -------------------------------------------------------------------------------- /foo.md: -------------------------------------------------------------------------------- 1 | 2 | # R-actions-test 3 | 4 | A repo for testing GitHub Actions foo2 5 | 6 | ``` r 7 | plot(1:10) 8 | ``` 9 | 10 | ![](foo_files/figure-gfm/unnamed-chunk-1-1.png) 11 | -------------------------------------------------------------------------------- /foo/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: ractionstest 2 | Title: What the Package Does (One Line, Title Case) 3 | Version: 0.0.0.9000 4 | Authors@R: 5 | c(person(given = "Jim", 6 | family = "Hester", 7 | role = c("aut", "cre"), 8 | email = "james.f.hester@gmail.com", 9 | comment = c(ORCID = "0000-0002-2739-7082")), 10 | person(given = "RStudio", 11 | role = c("cph", "fnd"))) 12 | Description: What the package does (one paragraph). 13 | Imports: pkgbuild 14 | URL: https://github.com/jimhester/r-actions-test 15 | License: MIT + file LICENSE 16 | Encoding: UTF-8 17 | LazyData: true 18 | Suggests: 19 | testthat (>= 2.1.0), 20 | knitr, 21 | rmarkdown, 22 | RoxygenNote: 7.1.0 23 | VignetteBuilder: knitr 24 | Config/Needs/website: pkgdown, tidyverse/tidytemplate 25 | Config/Needs/coverage: covr 26 | -------------------------------------------------------------------------------- /man/foo.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/foo.R 3 | \name{foo} 4 | \alias{foo} 5 | \alias{foo2} 6 | \title{Document a function} 7 | \usage{ 8 | foo(x) 9 | 10 | foo2(x) 11 | } 12 | \arguments{ 13 | \item{x}{the x parameter} 14 | } 15 | \description{ 16 | Document a function 17 | } 18 | \examples{ 19 | 1 + 1 == foo(1) 20 | } 21 | -------------------------------------------------------------------------------- /renv.lock: -------------------------------------------------------------------------------- 1 | { 2 | "R": { 3 | "Version": "4.1.0", 4 | "Repositories": [ 5 | { 6 | "Name": "CRAN", 7 | "URL": "https://cloud.r-project.org" 8 | } 9 | ] 10 | }, 11 | "Packages": { 12 | "R6": { 13 | "Package": "R6", 14 | "Version": "2.5.1", 15 | "Source": "CRAN", 16 | "Repository": "CRAN", 17 | "RemoteType": "standard", 18 | "RemotePkgRef": "R6", 19 | "RemoteRef": "R6", 20 | "RemoteRepos": "https://cloud.r-project.org", 21 | "RemotePkgPlatform": "source", 22 | "RemoteSha": "2.5.1", 23 | "Hash": "470851b6d5d0ac559e9d01bb352b4021" 24 | }, 25 | "base64enc": { 26 | "Package": "base64enc", 27 | "Version": "0.1-3", 28 | "Source": "CRAN", 29 | "Repository": "CRAN", 30 | "RemoteType": "standard", 31 | "RemotePkgRef": "base64enc", 32 | "RemoteRef": "base64enc", 33 | "RemoteRepos": "https://cloud.r-project.org", 34 | "RemotePkgPlatform": "macos", 35 | "RemoteSha": "0.1-3", 36 | "Hash": "543776ae6848fde2f48ff3816d0628bc" 37 | }, 38 | "brio": { 39 | "Package": "brio", 40 | "Version": "1.1.2", 41 | "Source": "CRAN", 42 | "Repository": "CRAN", 43 | "RemoteType": "standard", 44 | "RemotePkgRef": "brio", 45 | "RemoteRef": "brio", 46 | "RemoteRepos": "https://cloud.r-project.org", 47 | "RemotePkgPlatform": "macos", 48 | "RemoteSha": "1.1.2", 49 | "Hash": "2f01e16ff9571fe70381c7b9ae560dc4" 50 | }, 51 | "callr": { 52 | "Package": "callr", 53 | "Version": "3.7.0", 54 | "Source": "CRAN", 55 | "Repository": "CRAN", 56 | "RemoteType": "standard", 57 | "RemotePkgRef": "callr", 58 | "RemoteRef": "callr", 59 | "RemoteRepos": "https://cloud.r-project.org", 60 | "RemotePkgPlatform": "macos", 61 | "RemoteSha": "3.7.0", 62 | "Hash": "461aa75a11ce2400245190ef5d3995df" 63 | }, 64 | "cli": { 65 | "Package": "cli", 66 | "Version": "3.0.1", 67 | "Source": "Repository", 68 | "Repository": "CRAN", 69 | "Hash": "e3ae5d68dea0c55a12ea12a9fda02e61" 70 | }, 71 | "crayon": { 72 | "Package": "crayon", 73 | "Version": "1.4.1", 74 | "Source": "CRAN", 75 | "Repository": "CRAN", 76 | "RemoteType": "standard", 77 | "RemotePkgRef": "crayon", 78 | "RemoteRef": "crayon", 79 | "RemoteRepos": "https://cloud.r-project.org", 80 | "RemotePkgPlatform": "macos", 81 | "RemoteSha": "1.4.1", 82 | "Hash": "e75525c55c70e5f4f78c9960a4b402e9" 83 | }, 84 | "desc": { 85 | "Package": "desc", 86 | "Version": "1.4.0", 87 | "Source": "Repository", 88 | "Repository": "CRAN", 89 | "Hash": "28763d08fadd0b733e3cee9dab4e12fe" 90 | }, 91 | "diffobj": { 92 | "Package": "diffobj", 93 | "Version": "0.3.5", 94 | "Source": "Repository", 95 | "Repository": "CRAN", 96 | "Hash": "bcaa8b95f8d7d01a5dedfd959ce88ab8" 97 | }, 98 | "digest": { 99 | "Package": "digest", 100 | "Version": "0.6.28", 101 | "Source": "Repository", 102 | "Repository": "CRAN", 103 | "Hash": "49b5c6e230bfec487b8917d5a0c77cca" 104 | }, 105 | "ellipsis": { 106 | "Package": "ellipsis", 107 | "Version": "0.3.2", 108 | "Source": "CRAN", 109 | "Repository": "CRAN", 110 | "RemoteType": "standard", 111 | "RemotePkgRef": "ellipsis", 112 | "RemoteRef": "ellipsis", 113 | "RemoteRepos": "https://cloud.r-project.org", 114 | "RemotePkgPlatform": "macos", 115 | "RemoteSha": "0.3.2", 116 | "Hash": "bb0eec2fe32e88d9e2836c2f73ea2077" 117 | }, 118 | "evaluate": { 119 | "Package": "evaluate", 120 | "Version": "0.14", 121 | "Source": "CRAN", 122 | "Repository": "CRAN", 123 | "RemoteType": "standard", 124 | "RemotePkgRef": "evaluate", 125 | "RemoteRef": "evaluate", 126 | "RemoteRepos": "https://cloud.r-project.org", 127 | "RemotePkgPlatform": "macos", 128 | "RemoteSha": "0.14", 129 | "Hash": "ec8ca05cffcc70569eaaad8469d2a3a7" 130 | }, 131 | "fansi": { 132 | "Package": "fansi", 133 | "Version": "0.5.0", 134 | "Source": "CRAN", 135 | "Repository": "CRAN", 136 | "RemoteType": "standard", 137 | "RemotePkgRef": "fansi", 138 | "RemoteRef": "fansi", 139 | "RemoteRepos": "https://cloud.r-project.org", 140 | "RemotePkgPlatform": "macos", 141 | "RemoteSha": "0.5.0", 142 | "Hash": "d447b40982c576a72b779f0a3b3da227" 143 | }, 144 | "fastmap": { 145 | "Package": "fastmap", 146 | "Version": "1.1.0", 147 | "Source": "CRAN", 148 | "Repository": "CRAN", 149 | "RemoteType": "standard", 150 | "RemotePkgRef": "fastmap", 151 | "RemoteRef": "fastmap", 152 | "RemoteRepos": "https://cloud.r-project.org", 153 | "RemotePkgPlatform": "macos", 154 | "RemoteSha": "1.1.0", 155 | "Hash": "77bd60a6157420d4ffa93b27cf6a58b8" 156 | }, 157 | "glue": { 158 | "Package": "glue", 159 | "Version": "1.4.2", 160 | "Source": "Repository", 161 | "Repository": "CRAN", 162 | "Hash": "6efd734b14c6471cfe443345f3e35e29" 163 | }, 164 | "highr": { 165 | "Package": "highr", 166 | "Version": "0.9", 167 | "Source": "CRAN", 168 | "Repository": "CRAN", 169 | "RemoteType": "standard", 170 | "RemotePkgRef": "highr", 171 | "RemoteRef": "highr", 172 | "RemoteRepos": "https://cloud.r-project.org", 173 | "RemotePkgPlatform": "macos", 174 | "RemoteSha": "0.9", 175 | "Hash": "8eb36c8125038e648e5d111c0d7b2ed4" 176 | }, 177 | "htmltools": { 178 | "Package": "htmltools", 179 | "Version": "0.5.2", 180 | "Source": "CRAN", 181 | "Repository": "CRAN", 182 | "RemoteType": "standard", 183 | "RemotePkgRef": "htmltools", 184 | "RemoteRef": "htmltools", 185 | "RemoteRepos": "https://cloud.r-project.org", 186 | "RemotePkgPlatform": "macos", 187 | "RemoteSha": "0.5.2", 188 | "Hash": "526c484233f42522278ab06fb185cb26" 189 | }, 190 | "jquerylib": { 191 | "Package": "jquerylib", 192 | "Version": "0.1.4", 193 | "Source": "CRAN", 194 | "Repository": "CRAN", 195 | "RemoteType": "standard", 196 | "RemotePkgRef": "jquerylib", 197 | "RemoteRef": "jquerylib", 198 | "RemoteRepos": "https://cloud.r-project.org", 199 | "RemotePkgPlatform": "macos", 200 | "RemoteSha": "0.1.4", 201 | "Hash": "5aab57a3bd297eee1c1d862735972182" 202 | }, 203 | "jsonlite": { 204 | "Package": "jsonlite", 205 | "Version": "1.7.2", 206 | "Source": "CRAN", 207 | "Repository": "CRAN", 208 | "RemoteType": "standard", 209 | "RemotePkgRef": "jsonlite", 210 | "RemoteRef": "jsonlite", 211 | "RemoteRepos": "https://cloud.r-project.org", 212 | "RemotePkgPlatform": "macos", 213 | "RemoteSha": "1.7.2", 214 | "Hash": "98138e0994d41508c7a6b84a0600cfcb" 215 | }, 216 | "knitr": { 217 | "Package": "knitr", 218 | "Version": "1.36", 219 | "Source": "Repository", 220 | "Repository": "CRAN", 221 | "Hash": "46344b93f8854714cdf476433a59ed10" 222 | }, 223 | "lifecycle": { 224 | "Package": "lifecycle", 225 | "Version": "1.0.1", 226 | "Source": "Repository", 227 | "Repository": "CRAN", 228 | "Hash": "a6b6d352e3ed897373ab19d8395c98d0" 229 | }, 230 | "magrittr": { 231 | "Package": "magrittr", 232 | "Version": "2.0.1", 233 | "Source": "CRAN", 234 | "Repository": "CRAN", 235 | "RemoteType": "standard", 236 | "RemotePkgRef": "magrittr", 237 | "RemoteRef": "magrittr", 238 | "RemoteRepos": "https://cloud.r-project.org", 239 | "RemotePkgPlatform": "macos", 240 | "RemoteSha": "2.0.1", 241 | "Hash": "41287f1ac7d28a92f0a286ed507928d3" 242 | }, 243 | "pillar": { 244 | "Package": "pillar", 245 | "Version": "1.6.3", 246 | "Source": "Repository", 247 | "Repository": "CRAN", 248 | "Hash": "3323bc1a0988d63b5c65771ba0d3935d" 249 | }, 250 | "pkgbuild": { 251 | "Package": "pkgbuild", 252 | "Version": "1.2.0", 253 | "Source": "CRAN", 254 | "Repository": "CRAN", 255 | "RemoteType": "standard", 256 | "RemotePkgRef": "pkgbuild", 257 | "RemoteRef": "pkgbuild", 258 | "RemoteRepos": "https://cloud.r-project.org", 259 | "RemotePkgPlatform": "macos", 260 | "RemoteSha": "1.2.0", 261 | "Hash": "725fcc30222d4d11ec68efb8ff11a9af" 262 | }, 263 | "pkgconfig": { 264 | "Package": "pkgconfig", 265 | "Version": "2.0.3", 266 | "Source": "CRAN", 267 | "Repository": "CRAN", 268 | "RemoteType": "standard", 269 | "RemotePkgRef": "pkgconfig", 270 | "RemoteRef": "pkgconfig", 271 | "RemoteRepos": "https://cloud.r-project.org", 272 | "RemotePkgPlatform": "macos", 273 | "RemoteSha": "2.0.3", 274 | "Hash": "01f28d4278f15c76cddbea05899c5d6f" 275 | }, 276 | "pkgload": { 277 | "Package": "pkgload", 278 | "Version": "1.2.2", 279 | "Source": "Repository", 280 | "Repository": "CRAN", 281 | "Hash": "53139eedf68b98eecd5289664969c3f2" 282 | }, 283 | "praise": { 284 | "Package": "praise", 285 | "Version": "1.0.0", 286 | "Source": "CRAN", 287 | "Repository": "CRAN", 288 | "RemoteType": "standard", 289 | "RemotePkgRef": "praise", 290 | "RemoteRef": "praise", 291 | "RemoteRepos": "https://cloud.r-project.org", 292 | "RemotePkgPlatform": "macos", 293 | "RemoteSha": "1.0.0", 294 | "Hash": "a555924add98c99d2f411e37e7d25e9f" 295 | }, 296 | "prettyunits": { 297 | "Package": "prettyunits", 298 | "Version": "1.1.1", 299 | "Source": "CRAN", 300 | "Repository": "CRAN", 301 | "RemoteType": "standard", 302 | "RemotePkgRef": "prettyunits", 303 | "RemoteRef": "prettyunits", 304 | "RemoteRepos": "https://cloud.r-project.org", 305 | "RemotePkgPlatform": "macos", 306 | "RemoteSha": "1.1.1", 307 | "Hash": "95ef9167b75dde9d2ccc3c7528393e7e" 308 | }, 309 | "processx": { 310 | "Package": "processx", 311 | "Version": "3.5.2", 312 | "Source": "Repository", 313 | "Repository": "CRAN", 314 | "Hash": "0cbca2bc4d16525d009c4dbba156b37c" 315 | }, 316 | "ps": { 317 | "Package": "ps", 318 | "Version": "1.6.0", 319 | "Source": "CRAN", 320 | "Repository": "CRAN", 321 | "RemoteType": "standard", 322 | "RemotePkgRef": "ps", 323 | "RemoteRef": "ps", 324 | "RemoteRepos": "https://cloud.r-project.org", 325 | "RemotePkgPlatform": "macos", 326 | "RemoteSha": "1.6.0", 327 | "Hash": "32620e2001c1dce1af49c49dccbb9420" 328 | }, 329 | "rematch2": { 330 | "Package": "rematch2", 331 | "Version": "2.1.2", 332 | "Source": "CRAN", 333 | "Repository": "CRAN", 334 | "RemoteType": "standard", 335 | "RemotePkgRef": "rematch2", 336 | "RemoteRef": "rematch2", 337 | "RemoteRepos": "https://cloud.r-project.org", 338 | "RemotePkgPlatform": "macos", 339 | "RemoteSha": "2.1.2", 340 | "Hash": "76c9e04c712a05848ae7a23d2f170a40" 341 | }, 342 | "renv": { 343 | "Package": "renv", 344 | "Version": "0.14.0", 345 | "Source": "Repository", 346 | "Repository": "CRAN", 347 | "Hash": "30e5eba91b67f7f4d75d31de14bbfbdc" 348 | }, 349 | "rlang": { 350 | "Package": "rlang", 351 | "Version": "0.4.11", 352 | "Source": "Repository", 353 | "Repository": "CRAN", 354 | "Hash": "515f341d3affe0de9e4a7f762efb0456" 355 | }, 356 | "rmarkdown": { 357 | "Package": "rmarkdown", 358 | "Version": "2.11", 359 | "Source": "Repository", 360 | "Repository": "CRAN", 361 | "Hash": "320017b52d05a943981272b295750388" 362 | }, 363 | "rprojroot": { 364 | "Package": "rprojroot", 365 | "Version": "2.0.2", 366 | "Source": "CRAN", 367 | "Repository": "CRAN", 368 | "RemoteType": "standard", 369 | "RemotePkgRef": "rprojroot", 370 | "RemoteRef": "rprojroot", 371 | "RemoteRepos": "https://cloud.r-project.org", 372 | "RemotePkgPlatform": "macos", 373 | "RemoteSha": "2.0.2", 374 | "Hash": "249d8cd1e74a8f6a26194a91b47f21d1" 375 | }, 376 | "rstudioapi": { 377 | "Package": "rstudioapi", 378 | "Version": "0.13", 379 | "Source": "CRAN", 380 | "Repository": "CRAN", 381 | "RemoteType": "standard", 382 | "RemotePkgRef": "rstudioapi", 383 | "RemoteRef": "rstudioapi", 384 | "RemoteRepos": "https://cloud.r-project.org", 385 | "RemotePkgPlatform": "macos", 386 | "RemoteSha": "0.13", 387 | "Hash": "06c85365a03fdaf699966cc1d3cf53ea" 388 | }, 389 | "stringi": { 390 | "Package": "stringi", 391 | "Version": "1.7.5", 392 | "Source": "Repository", 393 | "Repository": "CRAN", 394 | "Hash": "cd50dc9b449de3d3b47cdc9976886999" 395 | }, 396 | "stringr": { 397 | "Package": "stringr", 398 | "Version": "1.4.0", 399 | "Source": "Repository", 400 | "Repository": "CRAN", 401 | "Hash": "0759e6b6c0957edb1311028a49a35e76" 402 | }, 403 | "testthat": { 404 | "Package": "testthat", 405 | "Version": "3.1.0", 406 | "Source": "Repository", 407 | "Repository": "CRAN", 408 | "Hash": "89e55ebe4f5ddd7f43f0f2bc6d96c950" 409 | }, 410 | "tibble": { 411 | "Package": "tibble", 412 | "Version": "3.1.5", 413 | "Source": "Repository", 414 | "Repository": "CRAN", 415 | "Hash": "36eb05ad4cfdfeaa56f5a9b2a1311efd" 416 | }, 417 | "tinytex": { 418 | "Package": "tinytex", 419 | "Version": "0.34", 420 | "Source": "Repository", 421 | "Repository": "CRAN", 422 | "Hash": "043daa786f4d254f0031534150e28d42" 423 | }, 424 | "utf8": { 425 | "Package": "utf8", 426 | "Version": "1.2.2", 427 | "Source": "CRAN", 428 | "Repository": "CRAN", 429 | "RemoteType": "standard", 430 | "RemotePkgRef": "utf8", 431 | "RemoteRef": "utf8", 432 | "RemoteRepos": "https://cloud.r-project.org", 433 | "RemotePkgPlatform": "macos", 434 | "RemoteSha": "1.2.2", 435 | "Hash": "c9c462b759a5cc844ae25b5942654d13" 436 | }, 437 | "vctrs": { 438 | "Package": "vctrs", 439 | "Version": "0.3.8", 440 | "Source": "Repository", 441 | "Repository": "CRAN", 442 | "Hash": "ecf749a1b39ea72bd9b51b76292261f1" 443 | }, 444 | "waldo": { 445 | "Package": "waldo", 446 | "Version": "0.3.1", 447 | "Source": "Repository", 448 | "Repository": "CRAN", 449 | "Hash": "ad8cfff5694ac5b3c354f8f2044bd976" 450 | }, 451 | "withr": { 452 | "Package": "withr", 453 | "Version": "2.4.2", 454 | "Source": "CRAN", 455 | "Repository": "CRAN", 456 | "RemoteType": "standard", 457 | "RemotePkgRef": "withr", 458 | "RemoteRef": "withr", 459 | "RemoteRepos": "https://cloud.r-project.org", 460 | "RemotePkgPlatform": "macos", 461 | "RemoteSha": "2.4.2", 462 | "Hash": "ad03909b44677f930fa156d47d7a3aeb" 463 | }, 464 | "xfun": { 465 | "Package": "xfun", 466 | "Version": "0.26", 467 | "Source": "Repository", 468 | "Repository": "CRAN", 469 | "Hash": "a270216f7ffda25e53298293046d1d05" 470 | }, 471 | "yaml": { 472 | "Package": "yaml", 473 | "Version": "2.2.1", 474 | "Source": "CRAN", 475 | "Repository": "CRAN", 476 | "RemoteType": "standard", 477 | "RemotePkgRef": "yaml", 478 | "RemoteRef": "yaml", 479 | "RemoteRepos": "https://cloud.r-project.org", 480 | "RemotePkgPlatform": "macos", 481 | "RemoteSha": "2.2.1", 482 | "Hash": "2826c5d9efb0a88f657c7a679c7106db" 483 | } 484 | } 485 | } 486 | -------------------------------------------------------------------------------- /report.Rmd: -------------------------------------------------------------------------------- 1 | A report 2 | 3 | ```{r} 4 | mod <- readRDS("model.Rds") 5 | 6 | plot(mod) 7 | ``` 8 | -------------------------------------------------------------------------------- /src/code.c: -------------------------------------------------------------------------------- 1 | #define R_NO_REMAP 2 | #include 3 | #include 4 | #include // for NULL 5 | #include 6 | 7 | SEXP sum_(SEXP x_sxp) { 8 | double* x = REAL(x_sxp); 9 | R_xlen_t n = Rf_xlength(x_sxp); 10 | double sum = 0; 11 | for (R_xlen_t i = 0; i < n; ++i) { 12 | sum += x[i]; 13 | } 14 | return Rf_ScalarReal(sum); 15 | } 16 | 17 | static const R_CallMethodDef CallEntries[] = { 18 | {"sum_", (DL_FUNC) &sum_, 1}, 19 | {NULL, NULL, 0} 20 | }; 21 | 22 | void R_init_ractionstest(DllInfo *dll) 23 | { 24 | R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); 25 | R_useDynamicSymbols(dll, FALSE); 26 | } 27 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | library(testthat) 2 | library(ractionstest) 3 | 4 | test_check("ractionstest") 5 | -------------------------------------------------------------------------------- /tests/testthat/test-foo.R: -------------------------------------------------------------------------------- 1 | test_that("multiplication works", { 2 | expect_equal(foo(1), 4) 3 | }) 4 | -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | -------------------------------------------------------------------------------- /vignettes/test.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "test" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{test} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>" 14 | ) 15 | ``` 16 | 17 | ```{r setup} 18 | library(ractionstest) 19 | ``` 20 | --------------------------------------------------------------------------------