├── .Rbuildignore ├── .github ├── .gitignore └── workflows │ ├── R-CMD-check-dev.yaml │ ├── R-CMD-check-status.yaml │ ├── R-CMD-check.yaml │ ├── check │ └── action.yml │ ├── commit │ └── action.yml │ ├── covr │ └── action.yml │ ├── dep-matrix │ └── action.yml │ ├── dep-suggests-matrix │ ├── action.R │ └── action.yml │ ├── fledge.yaml │ ├── get-extra │ └── action.yml │ ├── git-identity │ └── action.yml │ ├── install │ └── action.yml │ ├── lock.yaml │ ├── matrix-check │ └── action.yml │ ├── pkgdown-build │ └── action.yml │ ├── pkgdown-deploy │ └── action.yml │ ├── pkgdown.yaml │ ├── pr-commands.yaml │ ├── rate-limit │ └── action.yml │ ├── revdep.yaml │ ├── roxygenize │ └── action.yml │ ├── style │ └── action.yml │ ├── update-snapshots │ └── action.yml │ └── versions-matrix │ ├── action.R │ └── action.yml ├── .gitignore ├── DESCRIPTION ├── LICENSE ├── Makefile ├── NAMESPACE ├── NEWS.md ├── R ├── Koenigsberg.R ├── UKfaculty.R ├── USairports.R ├── enron.R ├── files.R ├── foodweb.R ├── igraphdata-package.R ├── immuno.R ├── karate.R ├── kite.R ├── macaque.R ├── netzschleuder.R ├── rfid.R └── yeast.R ├── README.Rmd ├── README.md ├── data ├── Koenigsberg.rda ├── UKfaculty.rda ├── USairports.rda ├── enron.rda ├── foodwebs.rda ├── immuno.rda ├── karate.rda ├── kite.rda ├── macaque.rda ├── rfid.rda └── yeast.rda ├── igraphdata.Rproj ├── inst ├── files │ ├── lesmis.gml │ ├── lesmis.graphml │ └── lesmis.net ├── getdata.R └── upgrade.R ├── man ├── Koenigsberg.Rd ├── UKfaculty.Rd ├── USairports.Rd ├── enron.Rd ├── foodwebs.Rd ├── igraphdata-package.Rd ├── immuno.Rd ├── karate.Rd ├── kite.Rd ├── lesmis.Rd ├── macaque.Rd ├── netzschleuder.Rd ├── rfid.Rd └── yeast.Rd └── tests ├── testthat.R └── testthat ├── _snaps └── data.md ├── test-data.R └── test-files.R /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^README.md$ 2 | ^Makefile$ 3 | ^tags$ 4 | ^inst/wikipedia$ 5 | ^igraphdata\.Rproj$ 6 | ^\.Rproj\.user$ 7 | ^\.github$ 8 | ^README\.Rmd$ 9 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | /pkg.lock 2 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check-dev.yaml: -------------------------------------------------------------------------------- 1 | # This workflow calls the GitHub API very frequently. 2 | # Can't be run as part of commits 3 | on: 4 | schedule: 5 | - cron: "0 5 * * *" # 05:00 UTC every day only run on main branch 6 | push: 7 | branches: 8 | - "cran-*" 9 | tags: 10 | - "v*" 11 | 12 | name: rcc dev 13 | 14 | jobs: 15 | matrix: 16 | runs-on: ubuntu-22.04 17 | outputs: 18 | matrix: ${{ steps.set-matrix.outputs.matrix }} 19 | 20 | name: Collect deps 21 | 22 | steps: 23 | - uses: actions/checkout@v4 24 | 25 | - uses: ./.github/workflows/rate-limit 26 | with: 27 | token: ${{ secrets.GITHUB_TOKEN }} 28 | 29 | - uses: r-lib/actions/setup-r@v2 30 | 31 | - id: set-matrix 32 | uses: ./.github/workflows/dep-matrix 33 | 34 | check-matrix: 35 | runs-on: ubuntu-22.04 36 | needs: matrix 37 | 38 | name: Check deps 39 | 40 | steps: 41 | - name: Install json2yaml 42 | run: | 43 | sudo npm install -g json2yaml 44 | 45 | - name: Check matrix definition 46 | run: | 47 | matrix='${{ needs.matrix.outputs.matrix }}' 48 | echo $matrix 49 | echo $matrix | jq . 50 | echo $matrix | json2yaml 51 | 52 | R-CMD-check-base: 53 | runs-on: ubuntu-22.04 54 | 55 | name: base 56 | 57 | # Begin custom: services 58 | # End custom: services 59 | 60 | strategy: 61 | fail-fast: false 62 | 63 | steps: 64 | - uses: actions/checkout@v4 65 | 66 | - uses: ./.github/workflows/custom/before-install 67 | if: hashFiles('.github/workflows/custom/before-install/action.yml') != '' 68 | 69 | - uses: ./.github/workflows/install 70 | with: 71 | cache-version: rcc-dev-base-1 72 | needs: build, check 73 | extra-packages: "any::rcmdcheck any::remotes ." 74 | token: ${{ secrets.GITHUB_TOKEN }} 75 | 76 | - name: Session info 77 | run: | 78 | options(width = 100) 79 | if (!requireNamespace("sessioninfo", quietly = TRUE)) install.packages("sessioninfo") 80 | pkgs <- installed.packages()[, "Package"] 81 | sessioninfo::session_info(pkgs, include_base = TRUE) 82 | shell: Rscript {0} 83 | 84 | - uses: ./.github/workflows/custom/after-install 85 | if: hashFiles('.github/workflows/custom/after-install/action.yml') != '' 86 | 87 | - uses: ./.github/workflows/update-snapshots 88 | if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository 89 | 90 | - uses: ./.github/workflows/check 91 | with: 92 | results: ${{ matrix.package }} 93 | 94 | R-CMD-check-dev: 95 | needs: 96 | - matrix 97 | - R-CMD-check-base 98 | 99 | runs-on: ubuntu-22.04 100 | 101 | name: 'rcc-dev: ${{ matrix.package }}' 102 | 103 | # Begin custom: services 104 | # End custom: services 105 | 106 | strategy: 107 | fail-fast: false 108 | matrix: ${{fromJson(needs.matrix.outputs.matrix)}} 109 | 110 | steps: 111 | - uses: actions/checkout@v4 112 | 113 | - uses: ./.github/workflows/custom/before-install 114 | if: hashFiles('.github/workflows/custom/before-install/action.yml') != '' 115 | 116 | - uses: ./.github/workflows/install 117 | with: 118 | cache-version: rcc-dev-${{ matrix.package }}-1 119 | needs: build, check 120 | extra-packages: "any::rcmdcheck any::remotes ." 121 | token: ${{ secrets.GITHUB_TOKEN }} 122 | 123 | - name: Install dev version of ${{ matrix.package }} 124 | env: 125 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 126 | run: | 127 | remotes::install_dev("${{ matrix.package }}", "https://cloud.r-project.org", upgrade = "always") 128 | shell: Rscript {0} 129 | 130 | - name: Session info 131 | run: | 132 | options(width = 100) 133 | if (!requireNamespace("sessioninfo", quietly = TRUE)) install.packages("sessioninfo") 134 | pkgs <- installed.packages()[, "Package"] 135 | sessioninfo::session_info(pkgs, include_base = TRUE) 136 | shell: Rscript {0} 137 | 138 | - uses: ./.github/workflows/custom/after-install 139 | if: hashFiles('.github/workflows/custom/after-install/action.yml') != '' 140 | 141 | - uses: ./.github/workflows/update-snapshots 142 | if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository 143 | 144 | - uses: ./.github/workflows/check 145 | with: 146 | results: ${{ matrix.package }} 147 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check-status.yaml: -------------------------------------------------------------------------------- 1 | # Workflow to update the status of a commit for the R-CMD-check workflow 2 | # Necessary because remote PRs cannot update the status of the commit 3 | on: 4 | workflow_run: 5 | workflows: 6 | - rcc 7 | types: 8 | - requested 9 | - completed 10 | 11 | name: rcc-status 12 | 13 | jobs: 14 | rcc-status: 15 | runs-on: ubuntu-24.04 16 | 17 | name: "Update commit status" 18 | 19 | permissions: 20 | contents: read 21 | statuses: write 22 | 23 | steps: 24 | - name: "Update commit status" 25 | # Only run if triggered by rcc workflow 26 | if: github.event.workflow_run.name == 'rcc' 27 | env: 28 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 29 | run: | 30 | set -x 31 | 32 | if [ "${{ github.event.workflow_run.status }}" == "completed" ]; then 33 | if [ "${{ github.event.workflow_run.conclusion }}" == "success" ]; then 34 | state="success" 35 | else 36 | state="failure" 37 | fi 38 | 39 | # Read artifact ID 40 | artifact_id=$(gh api \ 41 | -H "Accept: application/vnd.github+json" \ 42 | -H "X-GitHub-Api-Version: 2022-11-28" \ 43 | repos/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}/artifacts | jq -r '.artifacts[] | select(.name == "rcc-smoke-sha") | .id') 44 | 45 | if [ -n "${artifact_id}" ]; then 46 | # Download artifact 47 | curl -L -o rcc-smoke-sha.zip \ 48 | -H "Accept: application/vnd.github+json" \ 49 | -H "Authorization: Bearer ${GH_TOKEN}" \ 50 | -H "X-GitHub-Api-Version: 2022-11-28" \ 51 | https://api.github.com/repos/${{ github.repository }}/actions/artifacts/${artifact_id}/zip 52 | 53 | # Unzip artifact 54 | unzip rcc-smoke-sha.zip 55 | 56 | # Read artifact 57 | sha=$(cat rcc-smoke-sha.txt) 58 | 59 | # Clean up 60 | rm rcc-smoke-sha.zip rcc-smoke-sha.txt 61 | fi 62 | else 63 | state="pending" 64 | fi 65 | 66 | if [ -z "${sha}" ]; then 67 | sha=${{ github.event.workflow_run.head_sha }} 68 | fi 69 | 70 | html_url=${{ github.event.workflow_run.html_url }} 71 | description=${{ github.event.workflow_run.name }} 72 | 73 | gh api \ 74 | --method POST \ 75 | -H "Accept: application/vnd.github+json" \ 76 | -H "X-GitHub-Api-Version: 2022-11-28" \ 77 | repos/${{ github.repository }}/statuses/${sha} \ 78 | -f "state=${state}" -f "target_url=${html_url}" -f "description=${description}" -f "context=rcc" 79 | shell: bash 80 | -------------------------------------------------------------------------------- /.github/workflows/R-CMD-check.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | # 4 | # NOTE: This workflow is overkill for most R packages and 5 | # check-standard.yaml is likely a better choice. 6 | # usethis::use_github_action("check-standard") will install it. 7 | on: 8 | push: 9 | branches: 10 | - main 11 | - master 12 | - release 13 | - cran-* 14 | pull_request: 15 | branches: 16 | - main 17 | - master 18 | workflow_dispatch: 19 | inputs: 20 | ref: 21 | description: "Branch, tag, or commit to check out" 22 | required: false 23 | default: "main" 24 | versions-matrix: 25 | description: "Create a matrix of R versions" 26 | type: boolean 27 | default: false 28 | dep-suggests-matrix: 29 | description: "Create a matrix of suggested dependencies" 30 | type: boolean 31 | default: false 32 | merge_group: 33 | types: 34 | - checks_requested 35 | schedule: 36 | - cron: "10 1 * * *" 37 | 38 | concurrency: 39 | group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.ref || github.head_ref || github.sha }}-${{ github.base_ref || '' }} 40 | cancel-in-progress: true 41 | 42 | name: rcc 43 | 44 | jobs: 45 | rcc-smoke: 46 | runs-on: ubuntu-24.04 47 | 48 | outputs: 49 | sha: ${{ steps.commit.outputs.sha }} 50 | versions-matrix: ${{ steps.versions-matrix.outputs.matrix }} 51 | dep-suggests-matrix: ${{ steps.dep-suggests-matrix.outputs.matrix }} 52 | 53 | name: "Smoke test: stock R" 54 | 55 | permissions: 56 | contents: write 57 | statuses: write 58 | pull-requests: write 59 | actions: write 60 | 61 | # Begin custom: services 62 | # End custom: services 63 | 64 | steps: 65 | - uses: actions/checkout@v4 66 | with: 67 | ref: ${{ inputs.ref }} 68 | 69 | - name: Update status for rcc 70 | # FIXME: Wrap into action 71 | if: github.event_name == 'workflow_dispatch' 72 | env: 73 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 74 | run: | 75 | # Check status of this workflow 76 | state="pending" 77 | sha=${{ inputs.ref }} 78 | if [ -z "${sha}" ]; then 79 | sha=${{ github.head_ref }} 80 | fi 81 | if [ -z "${sha}" ]; then 82 | sha=${{ github.sha }} 83 | fi 84 | sha=$(git rev-parse ${sha}) 85 | 86 | html_url=$(gh api \ 87 | -H "Accept: application/vnd.github+json" \ 88 | -H "X-GitHub-Api-Version: 2022-11-28" \ 89 | repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq -r .html_url) 90 | 91 | description="${{ github.workflow }} / ${{ github.job }}" 92 | 93 | gh api \ 94 | --method POST \ 95 | -H "Accept: application/vnd.github+json" \ 96 | -H "X-GitHub-Api-Version: 2022-11-28" \ 97 | repos/${{ github.repository }}/statuses/${sha} \ 98 | -f "state=${state}" -f "target_url=${html_url}" -f "description=${description}" -f "context=rcc" 99 | shell: bash 100 | 101 | - uses: ./.github/workflows/rate-limit 102 | with: 103 | token: ${{ secrets.GITHUB_TOKEN }} 104 | 105 | - uses: ./.github/workflows/git-identity 106 | 107 | - uses: ./.github/workflows/custom/before-install 108 | if: hashFiles('.github/workflows/custom/before-install/action.yml') != '' 109 | 110 | - uses: ./.github/workflows/install 111 | with: 112 | token: ${{ secrets.GITHUB_TOKEN }} 113 | cache-version: rcc-smoke-2 114 | needs: build, check, website 115 | # Beware of using dev pkgdown here, has brought in dev dependencies in the past 116 | extra-packages: any::rcmdcheck r-lib/roxygen2 any::decor r-lib/styler r-lib/pkgdown deps::. 117 | 118 | - uses: ./.github/workflows/custom/after-install 119 | if: hashFiles('.github/workflows/custom/after-install/action.yml') != '' 120 | 121 | # Must come after the custom after-install workflow 122 | - name: Install package 123 | run: | 124 | _R_SHLIB_STRIP_=true R CMD INSTALL . 125 | shell: bash 126 | 127 | - id: versions-matrix 128 | # Only run for pull requests if the base repo is different from the head repo, not for workflow_dispatch if not requested, always run for other events 129 | if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository) && (github.event_name != 'workflow_dispatch' || inputs.versions-matrix) 130 | uses: ./.github/workflows/versions-matrix 131 | 132 | - id: dep-suggests-matrix 133 | # Not for workflow_dispatch if not requested, always run for other events 134 | if: github.event_name != 'workflow_dispatch' || inputs.dep-suggests-matrix 135 | uses: ./.github/workflows/dep-suggests-matrix 136 | 137 | - uses: ./.github/workflows/update-snapshots 138 | with: 139 | base: ${{ inputs.ref || github.head_ref }} 140 | 141 | - uses: ./.github/workflows/style 142 | 143 | - uses: ./.github/workflows/roxygenize 144 | 145 | - name: Remove config files from previous iteration 146 | run: | 147 | rm -f .github/dep-suggests-matrix.json .github/versions-matrix.json 148 | shell: bash 149 | 150 | - id: commit 151 | uses: ./.github/workflows/commit 152 | with: 153 | token: ${{ secrets.GITHUB_TOKEN }} 154 | 155 | - uses: ./.github/workflows/check 156 | with: 157 | results: ${{ runner.os }}-smoke-test 158 | 159 | - uses: ./.github/workflows/pkgdown-build 160 | if: github.event_name != 'push' 161 | 162 | - uses: ./.github/workflows/pkgdown-deploy 163 | if: github.event_name == 'push' 164 | 165 | # Upload sha as artifact 166 | - run: | 167 | echo -n "${{ steps.commit.outputs.sha }}" > rcc-smoke-sha.txt 168 | shell: bash 169 | 170 | - uses: actions/upload-artifact@v4 171 | with: 172 | name: rcc-smoke-sha 173 | path: rcc-smoke-sha.txt 174 | 175 | - name: Update status for rcc 176 | # FIXME: Wrap into action 177 | if: always() && github.event_name == 'workflow_dispatch' 178 | env: 179 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 180 | run: | 181 | # Check status of this workflow 182 | if [ "${{ job.status }}" == "success" ]; then 183 | state="success" 184 | else 185 | state="failure" 186 | fi 187 | 188 | sha=${{ steps.commit.outputs.sha }} 189 | if [ -z "${sha}" ]; then 190 | sha=${{ inputs.ref }} 191 | fi 192 | if [ -z "${sha}" ]; then 193 | sha=${{ github.head_ref }} 194 | fi 195 | if [ -z "${sha}" ]; then 196 | sha=${{ github.sha }} 197 | fi 198 | sha=$(git rev-parse ${sha}) 199 | 200 | html_url=$(gh api \ 201 | -H "Accept: application/vnd.github+json" \ 202 | -H "X-GitHub-Api-Version: 2022-11-28" \ 203 | repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq -r .html_url) 204 | 205 | description="${{ github.workflow }} / ${{ github.job }}" 206 | 207 | gh api \ 208 | --method POST \ 209 | -H "Accept: application/vnd.github+json" \ 210 | -H "X-GitHub-Api-Version: 2022-11-28" \ 211 | repos/${{ github.repository }}/statuses/${sha} \ 212 | -f "state=${state}" -f "target_url=${html_url}" -f "description=${description}" -f "context=rcc" 213 | shell: bash 214 | 215 | rcc-smoke-check-matrix: 216 | runs-on: ubuntu-24.04 217 | 218 | name: "Check matrix" 219 | 220 | needs: 221 | - rcc-smoke 222 | 223 | steps: 224 | - uses: actions/checkout@v4 225 | with: 226 | ref: ${{ needs.rcc-smoke.outputs.sha }} 227 | 228 | - uses: ./.github/workflows/matrix-check 229 | with: 230 | matrix: ${{ needs.rcc-smoke.outputs.versions-matrix }} 231 | 232 | - uses: ./.github/workflows/matrix-check 233 | with: 234 | matrix: ${{ needs.rcc-smoke.outputs.dep-suggests-matrix }} 235 | 236 | rcc-full: 237 | needs: 238 | - rcc-smoke 239 | 240 | runs-on: ${{ matrix.os }} 241 | 242 | if: ${{ needs.rcc-smoke.outputs.versions-matrix != '' }} 243 | 244 | name: 'rcc: ${{ matrix.os }} (${{ matrix.r }}) ${{ matrix.desc }}' 245 | 246 | # Begin custom: services 247 | # End custom: services 248 | 249 | strategy: 250 | fail-fast: false 251 | matrix: ${{fromJson(needs.rcc-smoke.outputs.versions-matrix)}} 252 | 253 | steps: 254 | - uses: actions/checkout@v4 255 | with: 256 | ref: ${{ needs.rcc-smoke.outputs.sha }} 257 | 258 | - uses: ./.github/workflows/custom/before-install 259 | if: hashFiles('.github/workflows/custom/before-install/action.yml') != '' 260 | 261 | - uses: ./.github/workflows/install 262 | with: 263 | r-version: ${{ matrix.r }} 264 | cache-version: rcc-full-1 265 | token: ${{ secrets.GITHUB_TOKEN }} 266 | needs: build, check 267 | 268 | - uses: ./.github/workflows/custom/after-install 269 | if: hashFiles('.github/workflows/custom/after-install/action.yml') != '' 270 | 271 | - name: Must allow NOTEs if packages are missing, even with _R_CHECK_FORCE_SUGGESTS_ 272 | run: | 273 | if (Sys.getenv("RCMDCHECK_ERROR_ON") %in% c("", "note")) { 274 | pkgs <- setdiff(desc::desc_get_deps()$package, "R") 275 | installable <- vapply(pkgs, FUN.VALUE = logical(1), requireNamespace, quietly = TRUE) 276 | if (any(!installable)) { 277 | message("Missing packages: ", paste(pkgs[!installable], collapse = ", ")) 278 | cat('RCMDCHECK_ERROR_ON="warning"\n', file = Sys.getenv("GITHUB_ENV"), append = TRUE) 279 | } 280 | } 281 | shell: Rscript {0} 282 | 283 | - uses: ./.github/workflows/update-snapshots 284 | if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository 285 | 286 | - uses: ./.github/workflows/check 287 | if: ${{ ! matrix.covr }} 288 | with: 289 | results: ${{ runner.os }}-r${{ matrix.r }} 290 | 291 | - uses: ./.github/workflows/covr 292 | if: ${{ matrix.covr }} 293 | with: 294 | token: ${{ secrets.CODECOV_TOKEN }} 295 | 296 | # The status update is taken care of by R-CMD-check-status.yaml 297 | 298 | rcc-suggests: 299 | needs: 300 | - rcc-smoke 301 | 302 | runs-on: ubuntu-22.04 303 | 304 | if: ${{ needs.rcc-smoke.outputs.dep-suggests-matrix != '' }} 305 | 306 | name: Without ${{ matrix.package }} 307 | 308 | # Begin custom: services 309 | # End custom: services 310 | 311 | strategy: 312 | fail-fast: false 313 | matrix: ${{fromJson(needs.rcc-smoke.outputs.dep-suggests-matrix)}} 314 | 315 | steps: 316 | - uses: actions/checkout@v4 317 | 318 | - uses: ./.github/workflows/custom/before-install 319 | if: hashFiles('.github/workflows/custom/before-install/action.yml') != '' 320 | 321 | - uses: ./.github/workflows/install 322 | with: 323 | cache-version: rcc-dev-${{ matrix.package }}-1 324 | needs: build, check 325 | extra-packages: "any::rcmdcheck any::remotes ." 326 | token: ${{ secrets.GITHUB_TOKEN }} 327 | 328 | - name: Remove ${{ matrix.package }} and all strong dependencies 329 | run: | 330 | pkg <- "${{ matrix.package }}" 331 | pkgs <- tools::package_dependencies(pkg, reverse = TRUE)[[1]] 332 | installed <- rownames(utils::installed.packages()) 333 | to_remove <- c(pkg, intersect(pkgs, installed)) 334 | print(to_remove) 335 | remove.packages(to_remove) 336 | shell: Rscript {0} 337 | 338 | - name: Session info 339 | run: | 340 | options(width = 100) 341 | if (!requireNamespace("sessioninfo", quietly = TRUE)) install.packages("sessioninfo") 342 | pkgs <- installed.packages()[, "Package"] 343 | sessioninfo::session_info(pkgs, include_base = TRUE) 344 | shell: Rscript {0} 345 | 346 | - uses: ./.github/workflows/custom/after-install 347 | if: hashFiles('.github/workflows/custom/after-install/action.yml') != '' 348 | 349 | - name: Must allow NOTEs, even with _R_CHECK_FORCE_SUGGESTS_ 350 | run: | 351 | if (Sys.getenv("RCMDCHECK_ERROR_ON") %in% c("", "note")) { 352 | cat('RCMDCHECK_ERROR_ON="warning"\n', file = Sys.getenv("GITHUB_ENV"), append = TRUE) 353 | } 354 | shell: Rscript {0} 355 | 356 | - name: Check env vars 357 | run: | 358 | print(Sys.getenv('_R_CHECK_FORCE_SUGGESTS_')) 359 | print(Sys.getenv('RCMDCHECK_ERROR_ON')) 360 | shell: Rscript {0} 361 | 362 | - uses: ./.github/workflows/check 363 | with: 364 | results: ${{ matrix.package }} 365 | 366 | # The status update is taken care of by R-CMD-check-status.yaml 367 | -------------------------------------------------------------------------------- /.github/workflows/check/action.yml: -------------------------------------------------------------------------------- 1 | name: "Actions to check an R package" 2 | inputs: 3 | results: 4 | description: Slug for check results 5 | required: true 6 | 7 | runs: 8 | using: "composite" 9 | steps: 10 | - uses: r-lib/actions/check-r-package@v2 11 | with: 12 | # Fails on R 3.6 on Windows, remove when this job is removed? 13 | args: 'c("--no-manual", "--as-cran", "--no-multiarch")' 14 | error-on: ${{ env.RCMDCHECK_ERROR_ON || '"note"' }} 15 | 16 | - name: Show test output 17 | if: always() 18 | run: | 19 | ## -- Show test output -- 20 | echo "::group::Test output" 21 | find check -name '*.Rout*' -exec head -n 1000000 '{}' \; || true 22 | echo "::endgroup::" 23 | shell: bash 24 | 25 | - name: Upload check results 26 | if: failure() 27 | uses: actions/upload-artifact@main 28 | with: 29 | name: ${{ inputs.results }}-results 30 | path: check 31 | -------------------------------------------------------------------------------- /.github/workflows/commit/action.yml: -------------------------------------------------------------------------------- 1 | name: "Action to commit changes to the repository" 2 | inputs: 3 | token: 4 | description: "GitHub token" 5 | required: true 6 | outputs: 7 | sha: 8 | description: "SHA of generated commit" 9 | value: ${{ steps.commit.outputs.sha }} 10 | 11 | runs: 12 | using: "composite" 13 | steps: 14 | - name: Commit if changed, create a PR if protected 15 | id: commit 16 | env: 17 | GITHUB_TOKEN: ${{ inputs.token }} 18 | run: | 19 | set -x 20 | if [ -n "$(git status --porcelain)" ]; then 21 | echo "Changed" 22 | protected=${{ github.ref_protected }} 23 | foreign=${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }} 24 | if [ "${foreign}" = "true" ]; then 25 | # https://github.com/krlmlr/actions-sync/issues/44 26 | echo "Can't push to foreign branch" 27 | elif [ "${protected}" = "true" ]; then 28 | current_branch=$(git branch --show-current) 29 | new_branch=gha-commit-$(git rev-parse --short HEAD) 30 | git checkout -b ${new_branch} 31 | git add . 32 | git commit -m "chore: Auto-update from GitHub Actions"$'\n'$'\n'"Run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" 33 | # Force-push, used in only one place 34 | # Alternative: separate branch names for each usage 35 | git push -u origin HEAD -f 36 | 37 | existing_pr=$(gh pr list --state open --base main --head ${new_branch} --json number --jq '.[] | .number') 38 | if [ -n "${existing_pr}" ]; then 39 | echo "Existing PR: ${existing_pr}" 40 | else 41 | gh pr create --base main --head ${new_branch} --title "chore: Auto-update from GitHub Actions" --body "Run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" 42 | fi 43 | 44 | gh workflow run rcc -f ref=$(git rev-parse HEAD) 45 | gh pr merge --merge --auto 46 | else 47 | git fetch 48 | if [ -n "${GITHUB_HEAD_REF}" ]; then 49 | git add . 50 | git stash save 51 | git switch ${GITHUB_HEAD_REF} 52 | git merge origin/${GITHUB_BASE_REF} --no-edit 53 | git stash pop 54 | fi 55 | git add . 56 | git commit -m "chore: Auto-update from GitHub Actions"$'\n'$'\n'"Run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" 57 | git push -u origin HEAD 58 | 59 | # Only set output if changed 60 | echo sha=$(git rev-parse HEAD) >> $GITHUB_OUTPUT 61 | fi 62 | fi 63 | shell: bash 64 | -------------------------------------------------------------------------------- /.github/workflows/covr/action.yml: -------------------------------------------------------------------------------- 1 | name: "Actions to run covr for an R package" 2 | inputs: 3 | token: 4 | description: codecov token 5 | required: false 6 | 7 | runs: 8 | using: "composite" 9 | steps: 10 | - name: Run coverage check 11 | run: | 12 | if (dir.exists("tests/testthat")) { 13 | cov <- covr::package_coverage( 14 | quiet = FALSE, 15 | clean = FALSE, 16 | install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") 17 | ) 18 | covr::to_cobertura(cov) 19 | } else { 20 | message("No tests found, coverage not tested.") 21 | } 22 | shell: Rscript {0} 23 | 24 | - uses: codecov/codecov-action@v5 25 | with: 26 | # Fail if token is given 27 | fail_ci_if_error: ${{ inputs.token != '' }} 28 | files: ./cobertura.xml 29 | plugins: noop 30 | disable_search: true 31 | token: ${{ inputs.token }} 32 | 33 | - name: Show testthat output 34 | if: always() 35 | run: | 36 | ## -------------------------------------------------------------------- 37 | find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true 38 | shell: bash 39 | 40 | - name: Upload test results 41 | if: failure() 42 | uses: actions/upload-artifact@v4 43 | with: 44 | name: coverage-test-failures 45 | path: ${{ runner.temp }}/package 46 | -------------------------------------------------------------------------------- /.github/workflows/dep-matrix/action.yml: -------------------------------------------------------------------------------- 1 | name: "Actions to compute a matrix with all dependent packages" 2 | outputs: 3 | matrix: 4 | description: "Generated matrix" 5 | value: ${{ steps.set-matrix.outputs.matrix }} 6 | 7 | runs: 8 | using: "composite" 9 | steps: 10 | - id: set-matrix 11 | run: | 12 | # Determine package dependencies 13 | # From remotes 14 | read_dcf <- function(path) { 15 | fields <- colnames(read.dcf(path)) 16 | as.list(read.dcf(path, keep.white = fields)[1, ]) 17 | } 18 | 19 | re_match <- function(text, pattern, perl = TRUE, ...) { 20 | 21 | stopifnot(is.character(pattern), length(pattern) == 1, !is.na(pattern)) 22 | text <- as.character(text) 23 | 24 | match <- regexpr(pattern, text, perl = perl, ...) 25 | 26 | start <- as.vector(match) 27 | length <- attr(match, "match.length") 28 | end <- start + length - 1L 29 | 30 | matchstr <- substring(text, start, end) 31 | matchstr[ start == -1 ] <- NA_character_ 32 | 33 | res <- data.frame( 34 | stringsAsFactors = FALSE, 35 | .text = text, 36 | .match = matchstr 37 | ) 38 | 39 | if (!is.null(attr(match, "capture.start"))) { 40 | 41 | gstart <- attr(match, "capture.start") 42 | glength <- attr(match, "capture.length") 43 | gend <- gstart + glength - 1L 44 | 45 | groupstr <- substring(text, gstart, gend) 46 | groupstr[ gstart == -1 ] <- NA_character_ 47 | dim(groupstr) <- dim(gstart) 48 | 49 | res <- cbind(groupstr, res, stringsAsFactors = FALSE) 50 | } 51 | 52 | names(res) <- c(attr(match, "capture.names"), ".text", ".match") 53 | class(res) <- c("tbl_df", "tbl", class(res)) 54 | res 55 | } 56 | 57 | dev_split_ref <- function(x) { 58 | re_match(x, "^(?[^@#]+)(?[@#].*)?$") 59 | } 60 | 61 | has_dev_dep <- function(package) { 62 | cran_url <- "https://cloud.r-project.org" 63 | 64 | refs <- dev_split_ref(package) 65 | url <- file.path(cran_url, "web", "packages", refs[["pkg"]], "DESCRIPTION") 66 | 67 | f <- tempfile() 68 | on.exit(unlink(f)) 69 | 70 | utils::download.file(url, f) 71 | desc <- read_dcf(f) 72 | 73 | url_fields <- c(desc$URL, desc$BugReports) 74 | 75 | if (length(url_fields) == 0) { 76 | return(FALSE) 77 | } 78 | 79 | pkg_urls <- unlist(strsplit(url_fields, "[[:space:]]*,[[:space:]]*")) 80 | 81 | # Remove trailing "/issues" from the BugReports URL 82 | pkg_urls <- sub("/issues$", "", pkg_urls) 83 | 84 | valid_domains <- c("github[.]com", "gitlab[.]com", "bitbucket[.]org") 85 | 86 | parts <- 87 | re_match(pkg_urls, 88 | sprintf("^https?://(?%s)/(?%s)/(?%s)(?:/(?%s))?", 89 | domain = paste0(valid_domains, collapse = "|"), 90 | username = "[^/]+", 91 | repo = "[^/@#]+", 92 | subdir = "[^/@$ ]+" 93 | ) 94 | )[c("domain", "username", "repo", "subdir")] 95 | 96 | # Remove cases which don't match and duplicates 97 | 98 | parts <- unique(stats::na.omit(parts)) 99 | 100 | nrow(parts) == 1 101 | } 102 | 103 | if (!requireNamespace("desc", quietly = TRUE)) { 104 | install.packages("desc") 105 | } 106 | 107 | deps_df <- desc::desc_get_deps() 108 | deps_df <- deps_df[deps_df$type %in% c("Depends", "Imports", "LinkingTo", "Suggests"), ] 109 | 110 | packages <- sort(deps_df$package) 111 | packages <- intersect(packages, rownames(available.packages())) 112 | 113 | valid_dev_dep <- vapply(packages, has_dev_dep, logical(1)) 114 | 115 | # https://github.com/r-lib/remotes/issues/576 116 | valid_dev_dep[packages %in% c("igraph", "duckdb", "logging")] <- FALSE 117 | 118 | deps <- packages[valid_dev_dep] 119 | if (any(!valid_dev_dep)) { 120 | msg <- paste0( 121 | "Could not determine development repository for packages: ", 122 | paste(packages[!valid_dev_dep], collapse = ", ") 123 | ) 124 | writeLines(paste0("::warning::", msg)) 125 | } 126 | 127 | json <- paste0( 128 | '{"package":[', 129 | paste0('"', deps, '"', collapse = ","), 130 | ']}' 131 | ) 132 | writeLines(json) 133 | writeLines(paste0("matrix=", json), Sys.getenv("GITHUB_OUTPUT")) 134 | shell: Rscript {0} 135 | -------------------------------------------------------------------------------- /.github/workflows/dep-suggests-matrix/action.R: -------------------------------------------------------------------------------- 1 | # FIXME: Dynamic lookup by parsing https://svn.r-project.org/R/tags/ 2 | get_deps <- function() { 3 | # Determine package dependencies 4 | if (!requireNamespace("desc", quietly = TRUE)) { 5 | install.packages("desc") 6 | } 7 | 8 | deps_df <- desc::desc_get_deps() 9 | deps_df_optional <- deps_df$package[deps_df$type %in% c("Suggests", "Enhances")] 10 | deps_df_hard <- deps_df$package[deps_df$type %in% c("Depends", "Imports", "LinkingTo")] 11 | deps_df_base <- unlist(tools::standard_package_names(), use.names = FALSE) 12 | 13 | packages <- sort(deps_df_optional) 14 | packages <- intersect(packages, rownames(available.packages())) 15 | 16 | # Too big to fail, or can't be avoided: 17 | off_limits <- c("testthat", "rmarkdown", "rcmdcheck", deps_df_hard, deps_df_base) 18 | off_limits_dep <- unlist(tools::package_dependencies(off_limits, recursive = TRUE, which = "strong")) 19 | setdiff(packages, c(off_limits, off_limits_dep)) 20 | } 21 | 22 | if (Sys.getenv("GITHUB_BASE_REF") != "") { 23 | print(Sys.getenv("GITHUB_BASE_REF")) 24 | system("git fetch origin ${GITHUB_BASE_REF}") 25 | # Use .. to avoid having to fetch the entire history 26 | # https://github.com/krlmlr/actions-sync/issues/45 27 | diff_cmd <- "git diff origin/${GITHUB_BASE_REF}.. -- R/ tests/ | egrep '^[+][^+]' | grep -q ::" 28 | diff_lines <- system(diff_cmd, intern = TRUE) 29 | if (length(diff_lines) > 0) { 30 | writeLines("Changes using :: in R/ or tests/:") 31 | writeLines(diff_lines) 32 | packages <- get_deps() 33 | } else { 34 | writeLines("No changes using :: found in R/ or tests/, not checking without suggested packages") 35 | packages <- character() 36 | } 37 | } else { 38 | writeLines("No GITHUB_BASE_REF, checking without suggested packages") 39 | packages <- get_deps() 40 | } 41 | 42 | if (length(packages) > 0) { 43 | json <- paste0( 44 | '{"package":[', 45 | paste0('"', packages, '"', collapse = ","), 46 | "]}" 47 | ) 48 | writeLines(paste0("matrix=", json), Sys.getenv("GITHUB_OUTPUT")) 49 | writeLines(json) 50 | } else { 51 | writeLines("No suggested packages found.") 52 | } 53 | -------------------------------------------------------------------------------- /.github/workflows/dep-suggests-matrix/action.yml: -------------------------------------------------------------------------------- 1 | name: "Actions to compute a matrix with all suggested packages" 2 | outputs: 3 | matrix: 4 | description: "Generated matrix" 5 | value: ${{ steps.set-matrix.outputs.matrix }} 6 | 7 | runs: 8 | using: "composite" 9 | steps: 10 | - id: set-matrix 11 | run: | 12 | Rscript ./.github/workflows/dep-suggests-matrix/action.R 13 | shell: bash 14 | -------------------------------------------------------------------------------- /.github/workflows/fledge.yaml: -------------------------------------------------------------------------------- 1 | name: fledge 2 | 3 | on: 4 | # for manual triggers 5 | workflow_dispatch: 6 | inputs: 7 | pr: 8 | description: "Create PR" 9 | required: false 10 | type: boolean 11 | default: false 12 | # daily run 13 | schedule: 14 | - cron: "30 0 * * *" 15 | 16 | concurrency: 17 | group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }} 18 | cancel-in-progress: true 19 | 20 | jobs: 21 | check_fork: 22 | runs-on: ubuntu-24.04 23 | outputs: 24 | is_forked: ${{ steps.check.outputs.is_forked }} 25 | steps: 26 | - name: Check if the repo is forked 27 | id: check 28 | env: 29 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 30 | run: | 31 | is_forked=$(gh api repos/${{ github.repository }} | jq .fork) 32 | echo "is_forked=${is_forked}" >> $GITHUB_OUTPUT 33 | shell: bash 34 | 35 | fledge: 36 | runs-on: ubuntu-24.04 37 | needs: check_fork 38 | if: needs.check_fork.outputs.is_forked == 'false' 39 | permissions: 40 | contents: write 41 | pull-requests: write 42 | actions: write 43 | env: 44 | FLEDGE_GHA_CI: true 45 | steps: 46 | - uses: actions/checkout@v4 47 | with: 48 | fetch-depth: 0 49 | fetch-tags: true 50 | 51 | - name: Configure Git identity 52 | run: | 53 | env | sort 54 | git config --local user.name "$GITHUB_ACTOR" 55 | git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" 56 | shell: bash 57 | 58 | - name: Update apt 59 | run: | 60 | sudo apt-get update 61 | shell: bash 62 | 63 | - uses: r-lib/actions/setup-r@v2 64 | with: 65 | use-public-rspm: true 66 | 67 | - uses: r-lib/actions/setup-r-dependencies@v2 68 | env: 69 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 70 | with: 71 | pak-version: devel 72 | packages: cynkra/fledge 73 | cache-version: fledge-1 74 | 75 | - name: Count rulesets 76 | # Assume that branch is protected if ruleset exists 77 | id: rulesets 78 | env: 79 | GH_TOKEN: ${{ github.token }} 80 | run: | 81 | n_rulesets=$(gh api repos/${{ github.repository }}/rulesets -q length) 82 | echo "count=${n_rulesets}" >> $GITHUB_OUTPUT 83 | shell: bash 84 | 85 | - name: Switch to branch if branch protection is enabled 86 | if: github.ref_protected == 'true' || inputs.pr == 'true' || steps.rulesets.outputs.count > 0 87 | run: | 88 | git checkout -b fledge 89 | git push -f -u origin HEAD 90 | shell: bash 91 | 92 | - name: Bump version 93 | env: 94 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 95 | run: | 96 | check_default_branch <- ("${{ github.ref_protected == 'true' || inputs.pr == 'true' || steps.rulesets.outputs.count > 0 }}" != "true") 97 | if (fledge::bump_version(which = "dev", no_change_behavior = "noop", check_default_branch = check_default_branch)) { 98 | fledge::finalize_version(push = TRUE) 99 | } 100 | shell: Rscript {0} 101 | 102 | - name: Create and merge PR if branch protection is enabled 103 | if: github.ref_protected == 'true' || inputs.pr == 'true' || steps.rulesets.outputs.count > 0 104 | env: 105 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 106 | run: | 107 | set -ex 108 | if [ -n "$(git diff main --numstat)" ]; then 109 | gh pr create --base main --head fledge --fill-first 110 | gh workflow run rcc -f ref=$(git rev-parse HEAD) 111 | gh pr merge --squash --auto 112 | else 113 | echo "No changes." 114 | fi 115 | shell: bash 116 | 117 | - name: Check release 118 | env: 119 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 120 | run: | 121 | fledge:::release_after_cran_built_binaries() 122 | shell: Rscript {0} 123 | -------------------------------------------------------------------------------- /.github/workflows/get-extra/action.yml: -------------------------------------------------------------------------------- 1 | name: "Action to determine extra packages to be installed" 2 | outputs: 3 | packages: 4 | description: "List of extra packages" 5 | value: ${{ steps.get-extra.outputs.packages }} 6 | 7 | runs: 8 | using: "composite" 9 | steps: 10 | - name: Get extra packages 11 | id: get-extra 12 | run: | 13 | set -x 14 | packages=$( ( grep Config/gha/extra-packages DESCRIPTION || true ) | cut -d " " -f 2) 15 | echo packages=$packages >> $GITHUB_OUTPUT 16 | shell: bash 17 | -------------------------------------------------------------------------------- /.github/workflows/git-identity/action.yml: -------------------------------------------------------------------------------- 1 | name: "Actions to set up a Git identity" 2 | 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: Configure Git identity 7 | run: | 8 | env | sort 9 | git config --local user.name "$GITHUB_ACTOR" 10 | git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" 11 | shell: bash 12 | -------------------------------------------------------------------------------- /.github/workflows/install/action.yml: -------------------------------------------------------------------------------- 1 | name: "Actions to run for installing R packages" 2 | inputs: 3 | token: 4 | description: GitHub token, set to secrets.GITHUB_TOKEN 5 | required: true 6 | r-version: 7 | description: Passed on to r-lib/actions/setup-r@v2 8 | required: false 9 | default: release 10 | install-r: 11 | description: Passed on to r-lib/actions/setup-r@v2 12 | required: false 13 | default: true 14 | needs: 15 | description: Passed on to r-lib/actions/setup-r-dependencies@v2 16 | required: false 17 | default: "" 18 | packages: 19 | description: Passed on to r-lib/actions/setup-r-dependencies@v2 20 | required: false 21 | default: deps::., any::sessioninfo 22 | extra-packages: 23 | description: Passed on to r-lib/actions/setup-r-dependencies@v2 24 | required: false 25 | default: any::rcmdcheck 26 | cache-version: 27 | description: Passed on to r-lib/actions/setup-r-dependencies@v2 28 | required: false 29 | default: 1 30 | 31 | runs: 32 | using: "composite" 33 | steps: 34 | - name: Set environment variables 35 | run: | 36 | echo "R_REMOTES_NO_ERRORS_FROM_WARNINGS=true" | tee -a $GITHUB_ENV 37 | echo "R_KEEP_PKG_SOURCE=yes" | tee -a $GITHUB_ENV 38 | echo "_R_CHECK_SYSTEM_CLOCK_=false" | tee -a $GITHUB_ENV 39 | echo "_R_CHECK_FUTURE_FILE_TIMESTAMPS_=false" | tee -a $GITHUB_ENV 40 | # prevent rgl issues because no X11 display is available 41 | echo "RGL_USE_NULL=true" | tee -a $GITHUB_ENV 42 | # from https://github.com/r-devel/r-dev-web/blob/main/CRAN/QA/Kurt/lib/R/Scripts/check_CRAN_incoming.R 43 | echo "_R_CHECK_CRAN_INCOMING_CHECK_FILE_URIS_=true" | tee -a $GITHUB_ENV 44 | echo "_R_CHECK_CRAN_INCOMING_NOTE_GNU_MAKE_=true" | tee -a $GITHUB_ENV 45 | echo "_R_CHECK_PACKAGE_DEPENDS_IGNORE_MISSING_ENHANCES_=true" | tee -a $GITHUB_ENV 46 | echo "_R_CHECK_CODE_CLASS_IS_STRING_=true" | tee -a $GITHUB_ENV 47 | echo "_R_CHECK_CODOC_VARIABLES_IN_USAGES_=true" | tee -a $GITHUB_ENV 48 | echo "_R_CHECK_CONNECTIONS_LEFT_OPEN_=true" | tee -a $GITHUB_ENV 49 | echo "_R_CHECK_DATALIST_=true" | tee -a $GITHUB_ENV 50 | echo "_R_CHECK_NEWS_IN_PLAIN_TEXT_=true" | tee -a $GITHUB_ENV 51 | echo "_R_CHECK_PACKAGES_USED_CRAN_INCOMING_NOTES_=true" | tee -a $GITHUB_ENV 52 | echo "_R_CHECK_RD_CONTENTS_KEYWORDS_=true" | tee -a $GITHUB_ENV 53 | echo "_R_CHECK_R_DEPENDS_=warn" | tee -a $GITHUB_ENV 54 | echo "_R_CHECK_S3_METHODS_SHOW_POSSIBLE_ISSUES_=true" | tee -a $GITHUB_ENV 55 | echo "_R_CHECK_THINGS_IN_TEMP_DIR_=true" | tee -a $GITHUB_ENV 56 | echo "_R_CHECK_UNDOC_USE_ALL_NAMES_=true" | tee -a $GITHUB_ENV 57 | echo "_R_CHECK_URLS_SHOW_301_STATUS_=true" | tee -a $GITHUB_ENV 58 | echo "_R_CXX_USE_NO_REMAP_=true" | tee -a $GITHUB_ENV 59 | # There is no way to disable recency and frequency checks when the incoming checks are run 60 | # echo "_R_CHECK_CRAN_INCOMING_=true" | tee -a $GITHUB_ENV 61 | echo "_R_CHECK_CRAN_INCOMING_SKIP_LARGE_VERSION_=true" | tee -a $GITHUB_ENV 62 | echo "_R_CHECK_FORCE_SUGGESTS_=false" | tee -a $GITHUB_ENV 63 | shell: bash 64 | 65 | - name: Set environment variables (non-Windows only) 66 | if: runner.os != 'Windows' 67 | run: | 68 | echo "_R_CHECK_BASHISMS_=true" | tee -a $GITHUB_ENV 69 | shell: bash 70 | 71 | - name: Update apt 72 | if: runner.os == 'Linux' 73 | run: | 74 | sudo apt-get update 75 | sudo apt-get install -y aspell 76 | echo "_R_CHECK_CRAN_INCOMING_USE_ASPELL_=true" | tee -a $GITHUB_ENV 77 | shell: bash 78 | 79 | - name: Remove pkg-config@0.29.2 80 | if: runner.os == 'macOS' 81 | run: | 82 | brew uninstall pkg-config@0.29.2 || true 83 | shell: bash 84 | 85 | - uses: r-lib/actions/setup-pandoc@v2 86 | 87 | - uses: r-lib/actions/setup-r@v2 88 | with: 89 | r-version: ${{ inputs.r-version }} 90 | install-r: ${{ inputs.install-r }} 91 | http-user-agent: ${{ matrix.config.http-user-agent }} 92 | use-public-rspm: true 93 | 94 | - id: get-extra 95 | run: | 96 | set -x 97 | packages=$( ( grep Config/gha/extra-packages DESCRIPTION || true ) | cut -d " " -f 2) 98 | echo packages=$packages >> $GITHUB_OUTPUT 99 | shell: bash 100 | 101 | - uses: r-lib/actions/setup-r-dependencies@v2 102 | env: 103 | GITHUB_PAT: ${{ inputs.token }} 104 | with: 105 | pak-version: stable 106 | needs: ${{ inputs.needs }} 107 | packages: ${{ inputs.packages }} 108 | extra-packages: ${{ inputs.extra-packages }} ${{ ( matrix.covr && 'covr xml2' ) || '' }} ${{ steps.get-extra.outputs.packages }} 109 | cache-version: ${{ inputs.cache-version }} 110 | 111 | - name: Add pkg.lock to .gitignore 112 | run: | 113 | set -x 114 | if ! [ -f .github/.gitignore ] || [ -z "$(grep '^/pkg.lock$' .github/.gitignore)" ]; then 115 | echo /pkg.lock >> .github/.gitignore 116 | fi 117 | shell: bash 118 | 119 | - name: Add fake qpdf and checkbashisms 120 | if: runner.os == 'Linux' 121 | run: | 122 | sudo ln -s $(which true) /usr/local/bin/qpdf 123 | sudo ln -s $(which true) /usr/local/bin/checkbashisms 124 | shell: bash 125 | 126 | - name: Install ccache 127 | uses: krlmlr/ccache-action@parallel-dir 128 | with: 129 | max-size: 10G 130 | verbose: 1 131 | save: false 132 | restore: false 133 | 134 | - name: Use ccache for compiling R code, and parallelize 135 | run: | 136 | mkdir -p ~/.R 137 | echo 'CC := ccache $(CC)' >> ~/.R/Makevars 138 | echo 'CXX := ccache $(CXX)' >> ~/.R/Makevars 139 | echo 'CXX11 := ccache $(CXX11)' >> ~/.R/Makevars 140 | echo 'CXX14 := ccache $(CXX14)' >> ~/.R/Makevars 141 | echo 'CXX17 := ccache $(CXX17)' >> ~/.R/Makevars 142 | echo 'MAKEFLAGS = -j2' >> ~/.R/Makevars 143 | cat ~/.R/Makevars 144 | 145 | echo 'CCACHE_SLOPPINESS=locale,time_macros' | tee -a $GITHUB_ENV 146 | 147 | # echo 'CCACHE_DEBUG=true' | tee -a $GITHUB_ENV 148 | # echo "CCACHE_DEBUGDIR=$(dirname $(pwd))/ccache-debug" | tee -a $GITHUB_ENV 149 | # mkdir -p $(dirname $(pwd))/.ccache-debug 150 | 151 | echo 'PKG_BUILD_EXTRA_FLAGS=false' | tee -a $GITHUB_ENV 152 | 153 | # Repair 154 | git rm -rf .ccache || true 155 | rm -rf .ccache 156 | shell: bash 157 | 158 | - name: Show R CMD config --all 159 | run: | 160 | R CMD config --all 161 | shell: bash 162 | -------------------------------------------------------------------------------- /.github/workflows/lock.yaml: -------------------------------------------------------------------------------- 1 | name: "Lock threads" 2 | permissions: 3 | issues: write 4 | pull-requests: write 5 | discussions: write 6 | on: 7 | workflow_dispatch: 8 | schedule: 9 | - cron: "37 2 * * *" 10 | 11 | jobs: 12 | lock: 13 | runs-on: ubuntu-24.04 14 | steps: 15 | - uses: krlmlr/lock-threads@patch-1 16 | with: 17 | github-token: ${{ github.token }} 18 | issue-inactive-days: "365" 19 | issue-lock-reason: "" 20 | issue-comment: > 21 | This old thread has been automatically locked. If you think you have 22 | found something related to this, please open a new issue and link to this 23 | old issue if necessary. 24 | -------------------------------------------------------------------------------- /.github/workflows/matrix-check/action.yml: -------------------------------------------------------------------------------- 1 | name: "Actions to check a matrix with all R and OS versions, computed with the versions-matrix action" 2 | inputs: 3 | matrix: 4 | description: "Generated matrix" 5 | required: true 6 | 7 | runs: 8 | using: "composite" 9 | steps: 10 | - name: Install json2yaml 11 | run: | 12 | sudo npm install -g json2yaml 13 | shell: bash 14 | 15 | - run: | 16 | matrix='${{ inputs.matrix }}' 17 | if [ -n "${matrix}" ]; then 18 | echo $matrix | jq . 19 | echo $matrix | json2yaml 20 | else 21 | echo "No matrix found" 22 | fi 23 | shell: bash 24 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown-build/action.yml: -------------------------------------------------------------------------------- 1 | name: "Action to build a pkgdown website" 2 | 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: Build site 7 | run: | 8 | pkgdown::build_site() 9 | shell: Rscript {0} 10 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown-deploy/action.yml: -------------------------------------------------------------------------------- 1 | name: "Action to deploy a pkgdown website" 2 | 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: Deploy site 7 | uses: nick-fields/retry@v3 8 | with: 9 | timeout_minutes: 15 10 | max_attempts: 10 11 | command: | 12 | R -q -e 'pkgdown::deploy_to_branch(new_process = FALSE)' 13 | -------------------------------------------------------------------------------- /.github/workflows/pkgdown.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Also included in R-CMD-check.yaml, this workflow only listens to pushes to branches 3 | # that start with "docs*" or "cran-*" and does not need to act on pushes to the main branch. 4 | on: 5 | push: 6 | branches: 7 | - "docs*" 8 | - "cran-*" 9 | # The main branch is excluded here, it is handled by the R-CMD-check workflow. 10 | # This workflow is only for handling pushes to designated branches. 11 | workflow_dispatch: 12 | 13 | name: pkgdown 14 | 15 | concurrency: 16 | group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.sha }}-${{ github.base_ref || '' }} 17 | cancel-in-progress: true 18 | 19 | jobs: 20 | pkgdown: 21 | runs-on: ubuntu-24.04 22 | 23 | name: "pkgdown" 24 | 25 | # Begin custom: services 26 | # End custom: services 27 | 28 | steps: 29 | - uses: actions/checkout@v4 30 | 31 | - uses: ./.github/workflows/rate-limit 32 | with: 33 | token: ${{ secrets.GITHUB_TOKEN }} 34 | 35 | - uses: ./.github/workflows/git-identity 36 | if: github.event_name == 'push' 37 | 38 | - uses: ./.github/workflows/custom/before-install 39 | if: hashFiles('.github/workflows/custom/before-install/action.yml') != '' 40 | 41 | - uses: ./.github/workflows/install 42 | with: 43 | token: ${{ secrets.GITHUB_TOKEN }} 44 | cache-version: pkgdown-2 45 | needs: website 46 | extra-packages: r-lib/pkgdown local::. 47 | 48 | - uses: ./.github/workflows/custom/after-install 49 | if: hashFiles('.github/workflows/custom/after-install/action.yml') != '' 50 | 51 | - uses: ./.github/workflows/pkgdown-build 52 | if: github.event_name != 'push' 53 | 54 | - uses: ./.github/workflows/pkgdown-deploy 55 | if: github.event_name == 'push' 56 | -------------------------------------------------------------------------------- /.github/workflows/pr-commands.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | issue_comment: 3 | types: [created] 4 | name: Commands 5 | jobs: 6 | document: 7 | if: startsWith(github.event.comment.body, '/document') 8 | name: document 9 | # macos is actually better here due to native binary packages 10 | runs-on: macos-latest 11 | env: 12 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 13 | steps: 14 | - uses: actions/checkout@v4 15 | - uses: r-lib/actions/pr-fetch@v2 16 | with: 17 | repo-token: ${{ secrets.GITHUB_TOKEN }} 18 | - uses: r-lib/actions/setup-r@v2 19 | - name: Configure Git identity 20 | run: | 21 | env | sort 22 | git config --local user.name "$GITHUB_ACTOR" 23 | git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" 24 | shell: bash 25 | - name: Install dependencies 26 | run: | 27 | install.packages(c("remotes", "roxygen2"), type = "binary") 28 | remotes::install_deps(dependencies = TRUE) 29 | shell: Rscript {0} 30 | - name: Document 31 | run: | 32 | roxygen2::roxygenise() 33 | shell: Rscript {0} 34 | - name: commit 35 | run: | 36 | if [ -n "$(git status --porcelain man/ NAMESPACE)" ]; then 37 | git add man/ NAMESPACE 38 | git commit -m 'Document' 39 | fi 40 | - uses: r-lib/actions/pr-push@v2 41 | with: 42 | repo-token: ${{ secrets.GITHUB_TOKEN }} 43 | style: 44 | if: startsWith(github.event.comment.body, '/style') 45 | name: style 46 | # macos is actually better here due to native binary packages 47 | runs-on: macos-latest 48 | env: 49 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 50 | steps: 51 | - uses: actions/checkout@v4 52 | - uses: r-lib/actions/pr-fetch@v2 53 | with: 54 | repo-token: ${{ secrets.GITHUB_TOKEN }} 55 | - uses: r-lib/actions/setup-r@v2 56 | - name: Configure Git identity 57 | run: | 58 | env | sort 59 | git config --local user.name "$GITHUB_ACTOR" 60 | git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" 61 | shell: bash 62 | - name: Install dependencies 63 | run: | 64 | install.packages(c("styler", "roxygen2"), type = "binary") 65 | shell: Rscript {0} 66 | - name: Style 67 | run: | 68 | styler::style_pkg(strict = FALSE) 69 | shell: Rscript {0} 70 | - name: commit 71 | run: | 72 | if [ -n "$(git status --porcelain '*.R' '*.Rmd')" ]; then 73 | git add '*.R' '*.Rmd' 74 | git commit -m 'Style' 75 | fi 76 | - uses: r-lib/actions/pr-push@v2 77 | with: 78 | repo-token: ${{ secrets.GITHUB_TOKEN }} 79 | merge: 80 | if: startsWith(github.event.comment.body, '/merge') 81 | name: merge 82 | runs-on: ubuntu-22.04 83 | steps: 84 | - name: Create and merge pull request 85 | run: | 86 | set -exo pipefail 87 | PR_DETAILS=$( curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} ) 88 | echo "$PR_DETAILS" | jq . 89 | PR_BASE=$(echo "$PR_DETAILS" | jq -r .base.ref) 90 | PR_HEAD=$(echo "$PR_DETAILS" | jq -r .head.ref) 91 | PR_URL=$(curl -s -X POST --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" --data '{ "head": "'$PR_BASE'", "base": "'$PR_HEAD'", "title": "Merge back PR target branch", "body": "Target: #${{ github.event.issue.number }}" }' https://api.github.com/repos/${{ github.repository }}/pulls | jq -r .url ) 92 | echo $PR_URL 93 | # Merging here won't run CI/CD 94 | # curl -s -X PUT --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" $PR_URL/merge 95 | # A mock job just to ensure we have a successful build status 96 | finish: 97 | runs-on: ubuntu-22.04 98 | steps: 99 | - run: true 100 | -------------------------------------------------------------------------------- /.github/workflows/rate-limit/action.yml: -------------------------------------------------------------------------------- 1 | name: "Check GitHub rate limits" 2 | inputs: 3 | token: # id of input 4 | description: GitHub token, pass secrets.GITHUB_TOKEN 5 | required: true 6 | 7 | runs: 8 | using: "composite" 9 | steps: 10 | - name: Check rate limits 11 | run: | 12 | curl -s --header "authorization: Bearer ${{ inputs.token }}" https://api.github.com/rate_limit 13 | shell: bash 14 | -------------------------------------------------------------------------------- /.github/workflows/revdep.yaml: -------------------------------------------------------------------------------- 1 | # This workflow creates many jobs, run only when a branch is created 2 | on: 3 | push: 4 | branches: 5 | - "revdep*" # never run automatically on main branch 6 | 7 | name: revdep 8 | 9 | jobs: 10 | matrix: 11 | runs-on: ubuntu-22.04 12 | outputs: 13 | matrix: ${{ steps.set-matrix.outputs.matrix }} 14 | 15 | name: Collect revdeps 16 | 17 | env: 18 | R_REMOTES_NO_ERRORS_FROM_WARNINGS: true 19 | RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest 20 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 21 | # prevent rgl issues because no X11 display is available 22 | RGL_USE_NULL: true 23 | # Begin custom: env vars 24 | # End custom: env vars 25 | 26 | steps: 27 | - name: Check rate limits 28 | run: | 29 | curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit 30 | shell: bash 31 | 32 | - uses: actions/checkout@v4 33 | 34 | # FIXME: Avoid reissuing succesful jobs 35 | # https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#list-jobs-for-a-workflow-run 36 | # https://docs.github.com/en/free-pro-team@latest/rest/reference/actions#workflow-runs 37 | - id: set-matrix 38 | run: | 39 | package <- read.dcf("DESCRIPTION")[, "Package"][[1]] 40 | deps <- tools:::package_dependencies(package, reverse = TRUE, which = c("Depends", "Imports", "LinkingTo", "Suggests"))[[1]] 41 | json <- paste0( 42 | '{"package":[', 43 | paste0('"', deps, '"', collapse = ","), 44 | ']}' 45 | ) 46 | writeLines(json) 47 | writeLines(paste0("matrix=", json), Sys.getenv("GITHUB_OUTPUT")) 48 | shell: Rscript {0} 49 | 50 | check-matrix: 51 | runs-on: ubuntu-22.04 52 | needs: matrix 53 | steps: 54 | - name: Install json2yaml 55 | run: | 56 | sudo npm install -g json2yaml 57 | 58 | - name: Check matrix definition 59 | run: | 60 | matrix='${{ needs.matrix.outputs.matrix }}' 61 | echo $matrix 62 | echo $matrix | jq . 63 | echo $matrix | json2yaml 64 | 65 | R-CMD-check: 66 | needs: matrix 67 | 68 | runs-on: ubuntu-22.04 69 | 70 | name: 'revdep: ${{ matrix.package }}' 71 | 72 | # Begin custom: services 73 | # End custom: services 74 | 75 | strategy: 76 | fail-fast: false 77 | matrix: ${{fromJson(needs.matrix.outputs.matrix)}} 78 | 79 | env: 80 | R_REMOTES_NO_ERRORS_FROM_WARNINGS: true 81 | RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest 82 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 83 | # prevent rgl issues because no X11 display is available 84 | RGL_USE_NULL: true 85 | # Begin custom: env vars 86 | # End custom: env vars 87 | 88 | steps: 89 | - name: Check rate limits 90 | run: | 91 | curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit 92 | shell: bash 93 | 94 | - uses: actions/checkout@v4 95 | 96 | # Begin custom: before install 97 | # End custom: before install 98 | 99 | - name: Use RSPM 100 | run: | 101 | mkdir -p /home/runner/work/_temp/Library 102 | echo 'local({release <- system2("lsb_release", "-sc", stdout = TRUE); options(repos=c(CRAN = paste0("https://packagemanager.rstudio.com/all/__linux__/", release, "/latest")), HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version$platform, R.version$arch, R.version$os)))}); .libPaths("/home/runner/work/_temp/Library")' | sudo tee /etc/R/Rprofile.site 103 | 104 | - name: Install remotes 105 | run: | 106 | if (!requireNamespace("curl", quietly = TRUE)) install.packages("curl") 107 | if (!requireNamespace("remotes", quietly = TRUE)) install.packages("remotes") 108 | shell: Rscript {0} 109 | 110 | - uses: r-lib/actions/setup-pandoc@v2 111 | 112 | - name: Install system dependencies 113 | if: runner.os == 'Linux' 114 | run: | 115 | sudo apt-get update -y 116 | Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "22.04")); package <- "${{ matrix.package }}"; deps <- tools::package_dependencies(package, which = "Suggests")[[1]]; lapply(c(package, deps), function(x) { writeLines(remotes::system_requirements("ubuntu", "22.04", package = x)) })' | sort | uniq > .github/deps.sh 117 | cat .github/deps.sh 118 | sudo sh < .github/deps.sh 119 | 120 | - name: Install package 121 | run: | 122 | package <- "${{ matrix.package }}" 123 | install.packages(package, dependencies = TRUE) 124 | remotes::install_cran("rcmdcheck") 125 | shell: Rscript {0} 126 | 127 | - name: Session info old 128 | run: | 129 | options(width = 100) 130 | if (!requireNamespace("sessioninfo", quietly = TRUE)) install.packages("sessioninfo") 131 | pkgs <- installed.packages()[, "Package"] 132 | sessioninfo::session_info(pkgs, include_base = TRUE) 133 | shell: Rscript {0} 134 | 135 | # Begin custom: after install 136 | # End custom: after install 137 | 138 | - name: Check old 139 | env: 140 | _R_CHECK_CRAN_INCOMING_: false 141 | _R_CHECK_SYSTEM_CLOCK_: false 142 | _R_CHECK_FUTURE_FILE_TIMESTAMPS_: false 143 | # Avoid downloading binary package from RSPM 144 | run: | 145 | package <- "${{ matrix.package }}" 146 | options(HTTPUserAgent = "gha") 147 | path <- download.packages(package, destdir = ".github")[, 2] 148 | print(path) 149 | 150 | dir <- file.path("revdep", package) 151 | dir.create(dir, showWarnings = FALSE, recursive = TRUE) 152 | check <- rcmdcheck::rcmdcheck(path, args = c("--no-manual", "--as-cran"), error_on = "never", check_dir = file.path(dir, "check")) 153 | file.rename(file.path(dir, "check"), file.path(dir, "old")) 154 | saveRDS(check, file.path(dir, "old.rds")) 155 | shell: Rscript {0} 156 | 157 | - name: Install local package 158 | run: | 159 | remotes::install_local(".", force = TRUE) 160 | shell: Rscript {0} 161 | 162 | - name: Session info new 163 | run: | 164 | options(width = 100) 165 | pkgs <- installed.packages()[, "Package"] 166 | sessioninfo::session_info(pkgs, include_base = TRUE) 167 | shell: Rscript {0} 168 | 169 | - name: Check new 170 | env: 171 | _R_CHECK_CRAN_INCOMING_: false 172 | _R_CHECK_SYSTEM_CLOCK_: false 173 | _R_CHECK_FUTURE_FILE_TIMESTAMPS_: false 174 | run: | 175 | package <- "${{ matrix.package }}" 176 | path <- dir(".github", pattern = paste0("^", package), full.names = TRUE)[[1]] 177 | print(path) 178 | 179 | dir <- file.path("revdep", package) 180 | check <- rcmdcheck::rcmdcheck(path, args = c("--no-manual", "--as-cran"), error_on = "never", check_dir = file.path(dir, "check")) 181 | file.rename(file.path(dir, "check"), file.path(dir, "new")) 182 | saveRDS(check, file.path(dir, "new.rds")) 183 | shell: Rscript {0} 184 | 185 | - name: Compare 186 | run: | 187 | package <- "${{ matrix.package }}" 188 | dir <- file.path("revdep", package) 189 | old <- readRDS(file.path(dir, "old.rds")) 190 | new <- readRDS(file.path(dir, "new.rds")) 191 | compare <- rcmdcheck::compare_checks(old, new) 192 | compare 193 | cmp <- compare$cmp 194 | if (!identical(cmp[cmp$which == "old", "output"], cmp[cmp$which == "new", "output"])) { 195 | if (!requireNamespace("waldo", quietly = TRUE)) install.packages("waldo") 196 | print(waldo::compare(old, new)) 197 | 198 | stop("Check output differs.") 199 | } 200 | shell: Rscript {0} 201 | 202 | - name: Upload check results 203 | if: failure() 204 | uses: actions/upload-artifact@main 205 | with: 206 | name: ${{ matrix.package }}-results 207 | path: revdep/${{ matrix.package }} 208 | 209 | - name: Check rate limits 210 | if: always() 211 | run: | 212 | curl -s --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit 213 | shell: bash 214 | -------------------------------------------------------------------------------- /.github/workflows/roxygenize/action.yml: -------------------------------------------------------------------------------- 1 | name: "Action to create documentation with roxygen2" 2 | 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: Roxygenize 7 | run: | 8 | try(roxygen2::roxygenize()) 9 | shell: Rscript {0} 10 | -------------------------------------------------------------------------------- /.github/workflows/style/action.yml: -------------------------------------------------------------------------------- 1 | name: "Action to auto-style a package" 2 | 3 | runs: 4 | using: "composite" 5 | steps: 6 | - name: Check styler options 7 | id: check 8 | run: | 9 | set -x 10 | scope=$( ( grep Config/autostyle/scope DESCRIPTION || true ) | cut -d " " -f 2) 11 | strict=$( ( grep Config/autostyle/strict DESCRIPTION || true ) | cut -d " " -f 2) 12 | rmd=$( ( grep Config/autostyle/rmd DESCRIPTION || true ) | cut -d " " -f 2) 13 | echo scope=$scope >> $GITHUB_OUTPUT 14 | echo strict=$strict >> $GITHUB_OUTPUT 15 | echo rmd=$rmd >> $GITHUB_OUTPUT 16 | shell: bash 17 | 18 | - uses: actions/cache@v4 19 | if: ${{ steps.check.outputs.scope }} 20 | with: 21 | path: | 22 | ~/.cache/R/R.cache 23 | key: ${{ runner.os }}-2-${{ github.run_id }}- 24 | restore-keys: | 25 | ${{ runner.os }}-2- 26 | 27 | - name: Imprint run ID 28 | if: ${{ steps.check.outputs.scope }} 29 | run: | 30 | mkdir -p ~/.cache/R/R.cache/styler 31 | touch ~/.cache/R/R.cache/${{ github.run_id }} 32 | shell: bash 33 | 34 | - name: Show cache 35 | if: ${{ steps.check.outputs.scope }} 36 | run: | 37 | ls -l ~/.cache/R/R.cache 38 | ls -l ~/.cache/R/R.cache/styler 39 | shell: bash 40 | 41 | - name: Enable styler cache 42 | if: ${{ steps.check.outputs.scope }} 43 | run: | 44 | styler::cache_activate(verbose = TRUE) 45 | shell: Rscript {0} 46 | 47 | - name: Run styler 48 | if: ${{ steps.check.outputs.scope }} 49 | run: | 50 | strict <- as.logical("${{ steps.check.outputs.strict }}") 51 | if (is.na(strict)) { 52 | strict <- FALSE 53 | } 54 | rmd <- as.logical("${{ steps.check.outputs.rmd }}") 55 | if (is.na(rmd)) { 56 | rmd <- TRUE 57 | } 58 | styler::style_pkg( 59 | scope = "${{ steps.check.outputs.scope }}", 60 | strict = strict, 61 | filetype = c("R", "Rprofile", if (rmd) c("Rmd", "Rmarkdown", "Rnw", "Qmd")) 62 | ) 63 | shell: Rscript {0} 64 | 65 | - name: Show cache again 66 | if: ${{ steps.check.outputs.scope }} 67 | run: | 68 | ls -l ~/.cache/R/R.cache 69 | ls -l ~/.cache/R/R.cache/styler 70 | gdu -s --inodes ~/.cache/R/R.cache/styler/* || du -s --inodes ~/.cache/R/R.cache/styler/* 71 | shell: bash 72 | -------------------------------------------------------------------------------- /.github/workflows/update-snapshots/action.yml: -------------------------------------------------------------------------------- 1 | name: "Action to create pull requests for updated testthat snapshots" 2 | description: > 3 | This action will run `testthat::test_local()` for tests that seem to use snapshots, 4 | this is determined by reading and grepping the test files. 5 | If the tests are failing, snapshots are updated, and a pull request is opened. 6 | inputs: 7 | base: 8 | description: "The base branch to create the pull request against." 9 | required: false 10 | default: "main" 11 | 12 | runs: 13 | using: "composite" 14 | steps: 15 | - name: Run tests on test files that use snapshots 16 | id: run-tests 17 | run: | 18 | ## -- Run tests on test files that use snapshots -- 19 | rx <- "^test-(.*)[.][rR]$" 20 | files <- dir("tests/testthat", pattern = rx) 21 | has_snapshot <- vapply(files, function(.x) any(grepl("snapshot", readLines(file.path("tests/testthat", .x)), fixed = TRUE)), logical(1)) 22 | if (any(has_snapshot)) { 23 | patterns <- gsub(rx, "^\\1$", files[has_snapshot]) 24 | pattern <- paste0(patterns, collapse = "|") 25 | tryCatch( 26 | { 27 | result <- as.data.frame(testthat::test_local(pattern = pattern, reporter = "silent", stop_on_failure = FALSE)) 28 | print(result) 29 | failures <- result[result$failed + result$warning > 0, ] 30 | if (nrow(failures) > 0) { 31 | writeLines("Snapshot tests failed/warned.") 32 | print(failures[names(failures) != "result"]) 33 | print(failures$result) 34 | testthat::snapshot_accept() 35 | writeLines("changed=true", Sys.getenv("GITHUB_OUTPUT")) 36 | } else { 37 | writeLines("Snapshot tests ran successfully.") 38 | } 39 | }, 40 | error = print 41 | ) 42 | } else { 43 | writeLines("No snapshots found.") 44 | } 45 | shell: Rscript {0} 46 | 47 | - name: Add snapshots to Git 48 | if: ${{ steps.run-tests.outputs.changed }} 49 | run: | 50 | ## -- Add snapshots to Git -- 51 | mkdir -p tests/testthat/_snaps 52 | git add -- tests/testthat/_snaps 53 | shell: bash 54 | 55 | - name: Check changed files 56 | if: ${{ steps.run-tests.outputs.changed }} 57 | id: check-changed 58 | run: | 59 | echo "changed=$(git status --porcelain -- tests/testthat/_snaps | head -n 1)" >> $GITHUB_OUTPUT 60 | shell: bash 61 | 62 | - name: Derive branch name 63 | if: ${{ steps.check-changed.outputs.changed }} 64 | id: matrix-desc 65 | run: | 66 | config=$(echo '${{ toJSON(matrix) }}' | jq -c .) 67 | echo "text=$(echo ${config})" >> $GITHUB_OUTPUT 68 | echo "branch=$(echo ${config} | sed -r 's/[^0-9a-zA-Z]+/-/g;s/^-//;s/-$//')" >> $GITHUB_OUTPUT 69 | shell: bash 70 | 71 | - name: Create pull request 72 | if: ${{ steps.check-changed.outputs.changed }} 73 | id: cpr 74 | uses: peter-evans/create-pull-request@v6 75 | with: 76 | base: ${{ inputs.base }} 77 | branch: snapshot-${{ inputs.base }}-${{ github.job }}-${{ steps.matrix-desc.outputs.branch }} 78 | delete-branch: true 79 | title: "test: Snapshot updates for ${{ github.job }} (${{ steps.matrix-desc.outputs.text }})" 80 | body: "Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action${{ github.event.number && format(' for #{0}', github.event.number) || '' }}." 81 | add-paths: | 82 | tests/testthat/_snaps 83 | 84 | - name: Fail if pull request created 85 | if: ${{ steps.cpr.outputs.pull-request-number }} 86 | run: | 87 | false 88 | shell: bash 89 | -------------------------------------------------------------------------------- /.github/workflows/versions-matrix/action.R: -------------------------------------------------------------------------------- 1 | # Determine active versions of R to test against 2 | tags <- xml2::read_html("https://svn.r-project.org/R/tags/") 3 | 4 | bullets <- 5 | tags |> 6 | xml2::xml_find_all("//li") |> 7 | xml2::xml_text() 8 | 9 | version_bullets <- grep("^R-([0-9]+-[0-9]+-[0-9]+)/$", bullets, value = TRUE) 10 | versions <- unique(gsub("^R-([0-9]+)-([0-9]+)-[0-9]+/$", "\\1.\\2", version_bullets)) 11 | 12 | r_release <- head(sort(as.package_version(versions), decreasing = TRUE), 5) 13 | 14 | deps <- desc::desc_get_deps() 15 | r_crit <- deps$version[deps$package == "R"] 16 | if (length(r_crit) == 1) { 17 | min_r <- as.package_version(gsub("^>= ([0-9]+[.][0-9]+)(?:.*)$", "\\1", r_crit)) 18 | r_release <- r_release[r_release >= min_r] 19 | } 20 | 21 | r_versions <- c("devel", as.character(r_release)) 22 | 23 | macos <- data.frame(os = "macos-latest", r = r_versions[2:3]) 24 | windows <- data.frame(os = "windows-latest", r = r_versions[1:3]) 25 | linux_devel <- data.frame(os = "ubuntu-22.04", r = r_versions[1], `http-user-agent` = "release", check.names = FALSE) 26 | linux <- data.frame(os = "ubuntu-22.04", r = r_versions[-1]) 27 | covr <- data.frame(os = "ubuntu-22.04", r = r_versions[2], covr = "true", desc = "with covr") 28 | 29 | include_list <- list(macos, windows, linux_devel, linux, covr) 30 | 31 | if (file.exists(".github/versions-matrix.R")) { 32 | custom <- source(".github/versions-matrix.R")$value 33 | if (is.data.frame(custom)) { 34 | custom <- list(custom) 35 | } 36 | include_list <- c(include_list, custom) 37 | } 38 | 39 | print(include_list) 40 | 41 | filter <- read.dcf("DESCRIPTION")[1, ]["Config/gha/filter"] 42 | if (!is.na(filter)) { 43 | filter_expr <- parse(text = filter)[[1]] 44 | subset_fun_expr <- bquote(function(x) subset(x, .(filter_expr))) 45 | subset_fun <- eval(subset_fun_expr) 46 | include_list <- lapply(include_list, subset_fun) 47 | print(include_list) 48 | } 49 | 50 | to_json <- function(x) { 51 | if (nrow(x) == 0) return(character()) 52 | parallel <- vector("list", length(x)) 53 | for (i in seq_along(x)) { 54 | parallel[[i]] <- paste0('"', names(x)[[i]], '":"', x[[i]], '"') 55 | } 56 | paste0("{", do.call(paste, c(parallel, sep = ",")), "}") 57 | } 58 | 59 | configs <- unlist(lapply(include_list, to_json)) 60 | json <- paste0('{"include":[', paste(configs, collapse = ","), "]}") 61 | 62 | if (Sys.getenv("GITHUB_OUTPUT") != "") { 63 | writeLines(paste0("matrix=", json), Sys.getenv("GITHUB_OUTPUT")) 64 | } 65 | writeLines(json) 66 | -------------------------------------------------------------------------------- /.github/workflows/versions-matrix/action.yml: -------------------------------------------------------------------------------- 1 | name: "Actions to compute a matrix with all R and OS versions" 2 | 3 | outputs: 4 | matrix: 5 | description: "Generated matrix" 6 | value: ${{ steps.set-matrix.outputs.matrix }} 7 | 8 | runs: 9 | using: "composite" 10 | steps: 11 | - name: Install json2yaml 12 | run: | 13 | sudo npm install -g json2yaml 14 | shell: bash 15 | 16 | - id: set-matrix 17 | run: | 18 | Rscript ./.github/workflows/versions-matrix/action.R 19 | shell: bash 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /tags 2 | .Rproj.user 3 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: igraphdata 2 | Title: A Collection of Network Data Sets for the 'igraph' Package 3 | Version: 1.0.1.9013 4 | Authors@R: c( 5 | person("Gábor", "Csárdi", , role = "aut", 6 | comment = c(ORCID = "0000-0001-7098-9676")), 7 | person("Szabolcs", "Horvát", , role = "ctb", 8 | comment = c(ORCID = "0000-0002-3100-523X")), 9 | person("Kirill", "Müller", , "kirill@cynkra.com", role = c("aut", "cre"), 10 | comment = c(ORCID = "0000-0002-1416-3412")), 11 | person("Maëlle", "Salmon", role = "ctb", 12 | comment = c(ORCID = "0000-0002-2815-0399")), 13 | person("David","Schoch", role = "aut", 14 | comment = c(ORCID="0000-0003-2952-4812")), 15 | person("Chan Zuckerberg Initiative", role = "fnd") 16 | ) 17 | Description: A small collection of various network data sets, to use with 18 | the 'igraph' package: the Enron email network, various food webs, 19 | interactions in the immunoglobulin protein, the karate club network, 20 | Koenigsberg's bridges, visuotactile brain areas of the macaque monkey, 21 | UK faculty friendship network, domestic US flights network, etc. Also provides 22 | access to the API of . 23 | License: CC BY-SA 4.0 + file LICENSE 24 | URL: http://igraph.org 25 | BugReports: https://github.com/igraph/igraphdata/issues 26 | Depends: 27 | R (>= 4.0) 28 | Imports: 29 | igraph (>= 2.0.0), 30 | rlang 31 | Suggests: 32 | cli, 33 | minty, 34 | httr2, 35 | testthat (>= 3.0.0) 36 | Encoding: UTF-8 37 | LazyData: true 38 | Roxygen: list(markdown = TRUE) 39 | RoxygenNote: 7.3.2.9000 40 | Config/testthat/edition: 3 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This files lists the copyright holders and licenses (if known) of the 2 | various data sets in the igraphdata package: 3 | 4 | Koenigsberg 5 | ----------- 6 | 7 | This data set was collected from Public Domain sources, and it is 8 | int the Public Domain itself. 9 | 10 | Please cite the following publication if you use this data set: 11 | 12 | Euler, L.: Solutio problematis ad geometriam situs pertinentis. 13 | Commentarii academiae scientiarum Petropolitanae, 128-140, 1741. 14 | 15 | 16 | UKfaculty 17 | --------- 18 | 19 | This dataset is licensed under a Creative Commons 20 | Attribution-Share Alike 2.0 UK: England & Wales License, 21 | see http://creativecommons.org/licenses/by-sa/2.0/uk/ for details. 22 | 23 | Please cite the following reference if you use this dataset: 24 | 25 | Nepusz T., Petróczi A., Négyessy L., Bazsó F.: Fuzzy communities and 26 | the concept of bridgeness in complex networks. Physical Review E 27 | 77:016107, 2008. 28 | 29 | USairports 30 | ---------- 31 | 32 | The data is from the Research and Innovative Technology Administration, 33 | and it is in the Public Domain. 34 | 35 | enron 36 | ----- 37 | 38 | The data was downloaded from http://www.cis.jhu.edu/~parky/Enron/ 39 | Please cite the appropriate paper (see the manual) if you use 40 | this data set. 41 | 42 | foodwebs 43 | -------- 44 | 45 | The data was downloaded from 46 | http://vlado.fmf.uni-lj.si/pub/networks/data/bio/foodweb/foodweb.htm 47 | Please see the manual page of the data set for the publications 48 | that you should cite, if you use some of this data. 49 | 50 | immuno 51 | ------ 52 | 53 | The data was collected by David Gfeller. Please cite his PhD thesis if 54 | you use this data set: 55 | 56 | D. Gfeller, Simplifying complex networks: from a clustering to a 57 | coarse graining strategy, \emph{PhD Thesis EPFL}, no 3888, 2007. 58 | http://library.epfl.ch/theses/?nr=3888 59 | 60 | karate 61 | ------ 62 | 63 | The data was extracted from the original publication. 64 | Please cite: 65 | 66 | Wayne W. Zachary. An Information Flow Model for Conflict and 67 | Fission in Small Groups. Journal of Anthropological Research 68 | Vol. 33, No. 4 452-473 69 | 70 | kite 71 | ---- 72 | 73 | The data set was extracted from the publication. Please cite: 74 | 75 | David Krackhardt: Assessing the Political Landscape: Structure, Cognition, 76 | and Power in Organizations. Admin. Sci. Quart. 35, 342-369, 1990. 77 | 78 | macaque 79 | ------- 80 | 81 | This dataset is licensed under a Creative Commons 82 | Attribution-Share Alike 2.0 UK: England & Wales License, 83 | see http://creativecommons.org/licenses/by-sa/2.0/uk/ for details. 84 | 85 | Please cite the following reference if you use this dataset: 86 | 87 | Négyessy L., Nepusz T., Kocsis L., Bazsó F.: Prediction of the main 88 | cortical areas and connections involved in the tactile function of the 89 | visual cortex by network analysis. European Journal of Neuroscience 90 | 23(7):1919–1930, 2006. 91 | 92 | rfid 93 | ---- 94 | 95 | This data set is licensed under a GPL v3 license. 96 | 97 | Please cite the following reference if you use this dataset: 98 | 99 | P. Vanhems, A. Barrat, C. Cattuto, J.-F. Pinton, N. Khanafer, 100 | C. Regis, B.-a. Kim, B. Comte, N. Voirin: Estimating potential 101 | infection transmission routes in hospital wards using wearable 102 | proximity sensors. PloS One 8(9), e73970 306 (2013). 103 | 104 | yeast 105 | ----- 106 | 107 | The data was downloaded from 108 | http://www.nature.com/nature/journal/v417/n6887/suppinfo/nature750.html 109 | 110 | Please cite the following paper if you use this data set: 111 | 112 | Comparative assessment of large-scale data sets of protein-protein 113 | interactions. Christian von Mering, Roland Krause, Berend Snel, 114 | Michael Cornell, Stephen G. Oliver, Stanley Fields and Peer Bork. 115 | Nature 417, 399-403 (2002) 116 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: inst/README.md 3 | 4 | inst/README.md: inst/README.Rmd 5 | Rscript -e "library(knitr); knit('$<', output = '$@', quiet = TRUE)" 6 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | S3method(print,ns_meta) 4 | export(lesmis_gml) 5 | export(lesmis_graphml) 6 | export(lesmis_pajek) 7 | export(ns_df) 8 | export(ns_graph) 9 | export(ns_metadata) 10 | importFrom(igraph,vcount) 11 | -------------------------------------------------------------------------------- /NEWS.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # igraphdata 1.0.1.9013 4 | 5 | ## Continuous integration 6 | 7 | - Avoid failure in fledge workflow if no changes (#19). 8 | 9 | 10 | # igraphdata 1.0.1.9012 11 | 12 | ## Continuous integration 13 | 14 | - Fetch tags for fledge workflow to avoid unnecessary NEWS entries (#18). 15 | 16 | 17 | # igraphdata 1.0.1.9011 18 | 19 | ## Continuous integration 20 | 21 | - Use stable pak (#17). 22 | 23 | 24 | # igraphdata 1.0.1.9010 25 | 26 | ## Continuous integration 27 | 28 | - Trigger run (#15). 29 | 30 | - ci: Trigger run 31 | 32 | - ci: Latest changes 33 | 34 | 35 | # igraphdata 1.0.1.9009 36 | 37 | ## Continuous integration 38 | 39 | - Use pkgdown branch (#14). 40 | 41 | - ci: Use pkgdown branch 42 | 43 | - ci: Updates from duckdb 44 | 45 | - ci: Trigger run 46 | 47 | 48 | # igraphdata 1.0.1.9008 49 | 50 | ## Continuous integration 51 | 52 | - Install via R CMD INSTALL ., not pak (#13). 53 | 54 | - ci: Install via R CMD INSTALL ., not pak 55 | 56 | - ci: Bump version of upload-artifact action 57 | 58 | 59 | # igraphdata 1.0.1.9007 60 | 61 | ## Chore 62 | 63 | - Auto-update from GitHub Actions. 64 | 65 | Run: https://github.com/igraph/igraphdata/actions/runs/10425484116 66 | 67 | - Auto-update from GitHub Actions. 68 | 69 | Run: https://github.com/igraph/igraphdata/actions/runs/10200109769 70 | 71 | - Auto-update from GitHub Actions. 72 | 73 | Run: https://github.com/igraph/igraphdata/actions/runs/9728439599 74 | 75 | - Auto-update from GitHub Actions. 76 | 77 | Run: https://github.com/igraph/igraphdata/actions/runs/9691615086 78 | 79 | ## Continuous integration 80 | 81 | - Install local package for pkgdown builds. 82 | 83 | - Improve support for protected branches with fledge. 84 | 85 | - Improve support for protected branches, without fledge. 86 | 87 | - Sync with latest developments. 88 | 89 | - Use v2 instead of master. 90 | 91 | - Inline action. 92 | 93 | - Use dev roxygen2 and decor. 94 | 95 | - Fix on Windows, tweak lock workflow. 96 | 97 | - Avoid checking bashisms on Windows. 98 | 99 | - Better commit message. 100 | 101 | - Bump versions, better default, consume custom matrix. 102 | 103 | - Recent updates. 104 | 105 | 106 | # igraphdata 1.0.1.9006 107 | 108 | - Internal changes only. 109 | 110 | 111 | # igraphdata 1.0.1.9005 112 | 113 | ## Chore 114 | 115 | - Change maintainer (#7). 116 | 117 | 118 | # igraphdata 1.0.1.9004 119 | 120 | ## Chore 121 | 122 | - Update download link for yeast (#8, #9). 123 | 124 | 125 | # igraphdata 1.0.1.9003 126 | 127 | ## Chore 128 | 129 | - Load igraph package when loading this package. 130 | 131 | - Compress as xz, in version 2. 132 | 133 | 134 | # igraphdata 1.0.1.9002 135 | 136 | ## Features 137 | 138 | - Import igraph. 139 | 140 | - Upgrade graphs to igraph 1.5.0. 141 | 142 | ## Chore 143 | 144 | - Igraph on CRAN now. 145 | 146 | - Turn off Travis and AppVeyor (#10). 147 | 148 | - Move README.\* to root. 149 | 150 | 151 | # igraphdata 1.0.1.9001 152 | 153 | ## Features 154 | 155 | - New `lesmis_*()` functions (@krlmlr, #3). 156 | 157 | ## Chore 158 | 159 | - Add tests (#5). 160 | 161 | - Convert documentation to roxygen2 and Markdown (@krlmlr, #4). 162 | 163 | - Build-ignore. 164 | 165 | - README tweaks. 166 | 167 | 168 | # igraphdata 1.0.1.9000 169 | 170 | - Internal changes only. 171 | 172 | 173 | # igraphdata 1.0.1 174 | 175 | - First version with a NEWS file. 176 | 177 | - Get rid of `R CMD check` warning for marked UTF-8 characters. 178 | 179 | # igraphdata 1.0.0 180 | 181 | - Last version without a NEWS file. 182 | -------------------------------------------------------------------------------- /R/Koenigsberg.R: -------------------------------------------------------------------------------- 1 | #' Bridges of Koenigsberg from Euler's times 2 | #' 3 | #' @description 4 | #' 5 | #' The Seven Bridges of Koenigsberg is a notable historical problem in 6 | #' mathematics. Its negative resolution by Leonhard Euler in 1735 laid 7 | #' the foundations of graph theory and presaged the idea of topology. 8 | #' 9 | #' The city of Koenigsberg in Prussia (now Kaliningrad, Russia) was set on 10 | #' both sides of the Pregel River, and included two large islands which 11 | #' were connected to each other and the mainland by seven bridges 12 | #' 13 | #' The problem was to find a walk through the city that would cross each 14 | #' bridge once and only once. The islands could not be reached by any route 15 | #' other than the bridges, and every bridge must have been crossed 16 | #' completely every time (one could not walk half way onto the bridge and 17 | #' then turn around and later cross the other half from the other side). 18 | #' 19 | #' Euler proved that the problem has no solution. 20 | #' 21 | #' 22 | #' 23 | #' @name Koenigsberg 24 | #' @docType data 25 | #' @usage 26 | #' Koenigsberg 27 | #' @format 28 | #' An undirected `igraph` graph object with vertex attributes 29 | #' \sQuote{name} and \sQuote{Euler_letter}, the latter is the notation 30 | #' from Eulers original paper; and edge attributes \sQuote{name} (the name 31 | #' of the bridge) and \sQuote{Euler_letter}, again, Euler's notation 32 | #' from his paper. 33 | #' 34 | #' This dataset is in the public domain. 35 | #' @references Leonhard Euler, “Solutio problematis ad geometriam situs pertinensis” 36 | #' Commentarii Academiae Scientarum Imperialis Petropolitanae, 8 (1736), 128–140 + Plate VIII. 37 | #' @source Wikipedia, 38 | #' 39 | #' @keywords datasets 40 | NULL 41 | -------------------------------------------------------------------------------- /R/UKfaculty.R: -------------------------------------------------------------------------------- 1 | #' Friendship network of a UK university faculty 2 | #' 3 | #' @description 4 | #' The personal friendship network of a faculty of a UK 5 | #' university, consisting of 81 vertices (individuals) and 817 directed 6 | #' and weighted connections. The school affiliation of each individual is 7 | #' stored as a vertex attribute. This dataset can serve as a testbed for 8 | #' community detection algorithms. 9 | #' 10 | #' @name UKfaculty 11 | #' @docType data 12 | #' @usage 13 | #' UKfaculty 14 | #' @format 15 | #' A directed `igraph` graph object with vertex attribute 16 | #' \sQuote{Group}, the numeric id of the school affiliation, and edge 17 | #' attribute \sQuote{weight}, i.e. the graph is weighted. 18 | #' 19 | #' This dataset is licensed under a Creative Commons 20 | #' Attribution-Share Alike 2.0 UK: England & Wales License, 21 | #' see for details. 22 | #' Please cite the reference below if you use this dataset. 23 | #' @references Nepusz T., Petroczi A., Negyessy L., Bazso F.: Fuzzy 24 | #' communities and the concept of bridgeness in complex 25 | #' networks. Physical Review E 77:016107, 2008. 26 | #' \doi{10.1103/PhysRevE.77.016107} 27 | #' @source See reference below. 28 | #' @keywords datasets 29 | NULL 30 | -------------------------------------------------------------------------------- /R/USairports.R: -------------------------------------------------------------------------------- 1 | #' US airport network, 2010 December 2 | #' 3 | #' @description 4 | #' 5 | #' The network of passanger flights between airports in the United 6 | #' States. The data set was compiled based on flights in 2010 7 | #' December. This network is directed and edge directions correspond to 8 | #' flight directions. Each edge is specific to a single carrier aircraft 9 | #' type. Multiple carriers between the same two airports are denoted by 10 | #' multiple edges. 11 | #' 12 | #' See information about the included meta-data below. 13 | #' 14 | #' 15 | #' 16 | #' @name USairports 17 | #' @docType data 18 | #' @usage 19 | #' USairports 20 | #' @format 21 | #' A directed `igraph` graph object, with multiple edges. It has a 22 | #' \sQuote{name} graph attribute, and several vertex and edge 23 | #' attributes. The vertex attributes: 24 | #' \describe{ 25 | #' \item{name}{Symbolic vertex name, this is the three letter IATA 26 | #' airport code.} 27 | #' \item{City}{City and state, where the airport is located.} 28 | #' \item{Position}{Position of the airport, in WGS coordinates.} 29 | #' } 30 | #' 31 | #' Edge attributes: 32 | #' \describe{ 33 | #' \item{Carrier}{Name of the airline. The network includes both 34 | #' domestic and international carriers that performed at least one 35 | #' flight in December of 2010.} 36 | #' \item{Departures}{The number of departures (for a given airline and 37 | #' aircraft type.} 38 | #' \item{Seats}{The total number of seats available on the flights 39 | #' carried out by a given airline, using a given aircraft type.} 40 | #' \item{Passengers}{The total number of passangers on the flights 41 | #' carried out by a given airline, using a given aircraft type.} 42 | #' \item{Aircraft}{Type of the aircraft.} 43 | #' \item{Distance}{The distance between the two airports, in miles.} 44 | #' } 45 | #' @source 46 | #' Most of this information was downloaded from The Research and 47 | #' Innovative Technology Administration (RITA). See 48 | #' for details. The airport 49 | #' position information was collected from Wikipedia and other public 50 | #' online sources. 51 | #' @keywords datasets 52 | NULL 53 | -------------------------------------------------------------------------------- /R/enron.R: -------------------------------------------------------------------------------- 1 | #' Enron Email Network 2 | #' 3 | #' @description 4 | #' 5 | #' An Enron email dataset has been made public by the U.S. Department of Justice. 6 | #' 7 | #' 8 | #' 9 | #' @name enron 10 | #' @docType data 11 | #' @usage 12 | #' enron 13 | #' @format 14 | #' A directed `igraph` graph object. 15 | #' 16 | #' Graph attributes: \itemize{ 17 | #' \item \sQuote{LDC_names} The names of the 32 LDC catagories the emails 18 | #' are classfied into by Michael W. Berry 19 | #' () 20 | #' \item \sQuote{LDC_desc} Longer descriptions of the 32 LDC 21 | #' categories. 22 | #' \item \sQuote{Citation} Additionally, see also the references below. 23 | #' \item \sQuote{name} 24 | #' } 25 | #' 26 | #' Vertex attributes: \itemize{ 27 | #' \item \sQuote{Email} Email address. 28 | #' \item \sQuote{Name} Real name. 29 | #' \item \sQuote{Note} E.g. position at Enron. 30 | #' } 31 | #' 32 | #' Edge attributes: \itemize{ 33 | #' \item \sQuote{Time} When the email was sent. Note that some time 34 | #' labels are from 1979, these are certainly wrong and you might want 35 | #' to remove them before analyses that include time. 36 | #' \item \sQuote{Reciptype} Recipient type, \sQuote{to}, \sQuote{cc} or 37 | #' \sQuote{bcc}. 38 | #' \item \sQuote{Topic} Assigned based on 3-means clustering of 39 | #' randomly selected 3,120 out of all 125,409 messages, then NN 40 | #' classification for the whole corpus. Note that topic 0 means an 41 | #' outlier, e.g., too few words or all meaningless numbers in the 42 | #' message body. 43 | #' \item \sQuote{LDC_topic} Assigned based on Michael W. Berry's 2001 44 | #' \dQuote{Annotated (by Topic) Enron Email Data Set.} 45 | #' () 46 | #' There are 32 topics. Topic "0" means an outlier, e.g., too few words 47 | #' or all meaningless numbers in the message body, etc. Topic "-1" 48 | #' means there is no matching topic. 49 | #' } 50 | #' @references 51 | #' C.E. Priebe, J.M. Conroy, D.J. Marchette, and Y. Park, 52 | #' Scan Statistics on Enron Graphs Computational and Mathematical 53 | #' Organization Theory, Volume 11, Number 3, p229 - 247, October 2005, 54 | #' Springer Science+Business Media B.V. \doi{10.1007/s10588-005-5378-z} 55 | #' 56 | #' C.E. Priebe, J.M. Conroy, D.J. Marchette, and Y. Park, 57 | #' Scan Statistics on Enron Graphs, SIAM International Conference on 58 | #' Data Mining, Workshop on Link Analysis, Counterterrorism and Security, 59 | #' Newport Beach, California, April 23, 2005. 60 | #' 61 | #' Gina Kolata, Enron Offers an Unlikely Boost to E-Mail Surveillance, 62 | #' New York Times, Week in Review, May 22, 2005. 63 | #' 64 | #' C.E. Priebe, Scan Statistics on Enron Graphs, IPAM Summer Graduate 65 | #' School: Intelligent Extraction of Information from Graphs and High 66 | #' Dimensional Data, UCLA, July 11-29, 2005. 67 | #' 68 | #' C.E. Priebe, Scan Statistics on Enron Graphs, 2005 Fall Department 69 | #' of Applied Mathematics and Statistics Seminars, September 15, 2005, 70 | #' The Johns Hopkins University. 71 | #' 72 | #' Y. Park, C.E. Priebe, D.J. Marchette, Scan Statistics on Enron 73 | #' Hypergraphs, Interface 2008, Durham, North Carolina, May 21, 2008, 74 | #' 75 | #' Y. Park, C.E. Priebe, D.J. Marchette, Anomaly Detection using Scan 76 | #' Statistics on Enron Graphs and Hypergraphs, The Satellite Workshop of 77 | #' the IASC 2008 Conference, Seoul, Korea, December 1-3, 2008. 78 | #' 79 | #' Y. Park, C.E. Priebe, D.J. Marchette, A. Youssef, Anomaly Detection 80 | #' using Scan Statistics on Time Series of Hypergraphs, Workshop on Link 81 | #' Analysis, Counterterrorism and Security at the SIAM International 82 | #' Conference on Data Mining, Sparks, Nevada, May 1-3, 2009, 83 | #' 84 | #' Y. Park, C.E. Priebe, A. Youssef, Anomaly Detection in Time Series of 85 | #' Graphs using Fusion of Invariants, Computational and Mathematical 86 | #' Organization Theory, submitted, 2010. \doi{10.1109/JSTSP.2012.2233712} 87 | #' @source 88 | #' 89 | NULL 90 | -------------------------------------------------------------------------------- /R/files.R: -------------------------------------------------------------------------------- 1 | #' Example files 2 | #' 3 | #' Functions that return paths to example files of the "Les Miserables" example network, 4 | #' in the GML, GraphML or Pajek format. 5 | #' 6 | #' @return A string indicating an absolute path to a file. 7 | #' @name lesmis 8 | #' @references D. E. Knuth, The Stanford GraphBase: A Platform for Combinatorial Computing, Addison-Wesley, Reading, MA (1993). 9 | #' \url{https://www-cs-faculty.stanford.edu/~knuth/sgb.html} 10 | #' @export 11 | lesmis_gml <- function() { 12 | system.file("files/lesmis.gml", package = "igraphdata", mustWork = TRUE) 13 | } 14 | 15 | #' @export 16 | #' @rdname lesmis 17 | lesmis_graphml <- function() { 18 | system.file("files/lesmis.graphml", package = "igraphdata", mustWork = TRUE) 19 | } 20 | 21 | #' @export 22 | #' @rdname lesmis 23 | lesmis_pajek <- function() { 24 | system.file("files/lesmis.net", package = "igraphdata", mustWork = TRUE) 25 | } 26 | -------------------------------------------------------------------------------- /R/foodweb.R: -------------------------------------------------------------------------------- 1 | #' A collection of food webs 2 | #' 3 | #' @description 4 | #' A list of graphs. Each one is a food web, i.e. a directed 5 | #' graph of predator-prey relationships. 6 | #' 7 | #' 8 | #' 9 | #' @name foodwebs 10 | #' @docType data 11 | #' @usage 12 | #' foodwebs 13 | #' @format 14 | #' A named list of directed `igraph` graph objects. Here are the 15 | #' list of the graphs included: 16 | #' \describe{ 17 | #' \item{\sQuote{ChesLower}}{Lower Chesapeake Bay in Summer. 18 | #' 19 | #' Reference: Hagy, J.D. (2002) Eutrophication, hypoxia and 20 | #' trophic transfer efficiency in Chesapeake Bay PhD Dissertation, 21 | #' University of Maryland at College Park (USA), 446 pp.} 22 | #' \item{\sQuote{ChesMiddle}}{Middle Chesapeake Bay in Summer. 23 | #' 24 | #' Reference: same as for \sQuote{ChesLower}.} 25 | #' \item{\sQuote{ChesUpper}}{Upper Chesapeake Bay in Summer. 26 | #' 27 | #' Reference: same as for \sQuote{ChesLower}.} 28 | #' \item{\sQuote{Chesapeake}}{Chesapeake Bay Mesohaline Network. 29 | #' 30 | #' Reference: Baird D. & Ulanowicz R.E. (1989) The seasonal dynamics 31 | #' of the Chesapeake Bay ecosystem. Ecological Monographs 59:329-364.} 32 | #' \item{\sQuote{CrystalC}}{Crystal River Creek (Control). 33 | #' 34 | #' Reference: Homer, M. and W.M. Kemp. Unpublished Ms. See also 35 | #' Ulanowicz, R.E. 1986. Growth and Development: Ecosystems 36 | #' Phenomenology. Springer, New York. pp 69-79.} 37 | #' \item{\sQuote{CrystalD}}{Crystal River Creek (Delta Temp). 38 | #' 39 | #' Reference: same as for \sQuote{CrystalD}.} 40 | #' \item{\sQuote{Maspalomas}}{Charca de Maspalomas. 41 | #' 42 | #' Reference: Almunia, J., G. Basterretxea, J. Aristegui, and 43 | #' R.E. Ulanowicz. (1999) Benthic- Pelagic switching in a coastal 44 | #' subtropical lagoon. Estuarine, Coastal and Shelf Science 45 | #' 49:363-384.} 46 | #' \item{\sQuote{Michigan}}{Lake Michigan Control network. 47 | #' 48 | #' Reference: Krause, A. and D. Mason. (In preparation.) A. Krause, 49 | #' PhD. Dissertation, Michigan State University. Ann Arbor, MI. USA.} 50 | #' \item{\sQuote{Mondego}}{Mondego Estuary - Zostrea site. 51 | #' 52 | #' Reference: Patricio, J. (In Preparation) Master's 53 | #' Thesis. University of Coimbra, Coimbra, Portugal.} 54 | #' \item{\sQuote{Narragan}}{Narragansett Bay Model. 55 | #' 56 | #' Reference: Monaco, M.E. and R.E. Ulanowicz. (1997) Comparative 57 | #' ecosystem trophic structure of three U.S. Mid-Atlantic 58 | #' estuaries. Mar. Ecol. Prog. Ser. 161:239-254.} 59 | #' \item{\sQuote{Rhode}}{Rhode River Watershed - Water Budget. 60 | #' 61 | #' Reference: Correll, D. (Unpublished manuscript) Smithsonian 62 | #' Institute, Chesapeake Bay Center for Environmental Research, 63 | #' Edgewater, Maryland 21037-0028 USA.} 64 | #' \item{\sQuote{StMarks}}{St. Marks River (Florida) Flow network. 65 | #' 66 | #' Reference: Baird, D., J. Luczkovich and R. R. Christian. (1998) 67 | #' Assessment of spatial and temporal variability in ecosystem 68 | #' attributes of the St Marks National Wildlife Refuge, Apalachee Bay, 69 | #' Florida. Estuarine, Coastal, and Shelf Science 47: 329-349.} 70 | #' \item{\sQuote{baydry}}{Florida Bay Trophic Exchange Matrix, dry season. 71 | #' 72 | #' Reference: Ulanowicz, R. E., C. Bondavalli, and 73 | #' M. S. Egnotovich. 1998. Network analysis of trophic dynamics in 74 | #' South Florida ecosystems, FY 97: the Florida Bay ecosystem. Annual 75 | #' Report to the United States Geological Service Biological Resources 76 | #' Division, University of Miami Coral Gables, \[UM-CES\] CBL 98-123, 77 | #' Maryland System Center for Environmental Science, Chesapeake 78 | #' Biological Laboratory, Maryland, USA.} 79 | #' \item{\sQuote{baywet}}{Florida Bay Trophic Exchange Matrix, wet season. 80 | #' 81 | #' Reference: same as for \sQuote{baydry}.} 82 | #' \item{\sQuote{cypdry}}{Cypress, dry season. 83 | #' 84 | #' Reference: Ulanowicz, R. E., C. Bondavalli, and 85 | #' M. S. Egnotovich. 1997. Network analysis of trophic dynamics in 86 | #' South Florida ecosystems, FY 96: the cypress wetland 87 | #' ecosystem. Annual Report to the United States Geological Service 88 | #' Biological Resources Division, University of Miami Coral Gables, 89 | #' \[UM-CES\] CBL 97-075, Maryland System Center for Environmental 90 | #' Science, Chesapeake Biological Laboratory.} 91 | #' \item{\sQuote{cypwet}}{Cypress, wet season. 92 | #' 93 | #' Reference: same as for \sQuote{cypdry}.} 94 | #' \item{\sQuote{gramdry}}{Everglades Graminoids - Dry Season. 95 | #' 96 | #' Reference: Ulanowicz, R. E., J. J. Heymans, and 97 | #' M. S. Egnotovich. 2000. Network analysis of trophic dynamics in 98 | #' South Florida ecosystems, FY 99: the graminoid ecosystem. Technical 99 | #' Report TS-191-99, Maryland System Center for Environmental Science, 100 | #' Chesapeake Biological Laboratory, Maryland, USA.} 101 | #' \item{\sQuote{gramwet}}{Everglades Graminoids - Wet Season. 102 | #' 103 | #' Reference: same as for \sQuote{gramdry}.} 104 | #' \item{\sQuote{mangdry}}{Mangrove Estuary, Dry Season. 105 | #' 106 | #' Reference: Ulanowicz, R. E., C. Bondavalli, J. J. Heymans, and 107 | #' M. S. Egnotovich. 1999. Network analysis of trophic dynamics in 108 | #' South Florida ecosystems, FY 98: the mangrove ecosystem. Technical 109 | #' Report TS-191-99, Maryland System Center for Environmental Science, 110 | #' Chesapeake Biological Laboratory, Maryland, USA.} 111 | #' \item{\sQuote{mangwet}}{Mangrove Estuary, Wet Season. 112 | #' 113 | #' Reference: same as for \sQuote{mangdry}.} 114 | #' } 115 | #' 116 | #' Each graph has the following vertex attributes: \sQuote{name} is the 117 | #' name of the species, \sQuote{ECO} is the type of the node, and 118 | #' integer value between one and five, meaning: 119 | #' \enumerate{ 120 | #' \item Living/producing compartment 121 | #' \item Other compartment 122 | #' \item Input 123 | #' \item Output 124 | #' \item Respiration. 125 | #' } 126 | #' The \sQuote{Biomass} vertex attribute contains the biomass of the 127 | #' species. 128 | #' 129 | #' Edges are weighted, and the weights denote energy flux between the 130 | #' species involved. 131 | #' 132 | #' The graphs also contain some informative graph attributes: 133 | #' \sQuote{Author}, \sQuote{Citation}, \sQuote{URL}, and 134 | #' \sQuote{name}. 135 | #' @references See them above. 136 | #' @source See references for the individual webs above. The data itself 137 | #' was downloaded from 138 | #' . 139 | #' @keywords datasets 140 | NULL 141 | -------------------------------------------------------------------------------- /R/igraphdata-package.R: -------------------------------------------------------------------------------- 1 | #' @keywords internal 2 | "_PACKAGE" 3 | 4 | #' @section How to use the data sets 5 | #' After loading the \pkg{igraphdata} package, the various data sets are available 6 | #' by accessing them directly. 7 | #' 8 | #' Get a list of data sets included in this package with 9 | #' `data(package = "igraphdata")`. 10 | 11 | 12 | ## usethis namespace: start 13 | #' @importFrom igraph vcount 14 | ## usethis namespace: end 15 | NULL 16 | -------------------------------------------------------------------------------- /R/immuno.R: -------------------------------------------------------------------------------- 1 | #' Immunoglobulin interaction network 2 | #' 3 | #' @description 4 | #' 5 | #' The undirected and connected network of interactions 6 | #' in the immunoglobulin protein. It is made up of 1316 vertices 7 | #' representing amino-acids and an edge is drawn between two 8 | #' amino-acids if the shortest distance between their C_alpha atoms 9 | #' is smaller than the threshold value \eqn{\theta=8}{theta=8} Angstrom. 10 | #' 11 | #' 12 | #' 13 | #' @name immuno 14 | #' @docType data 15 | #' @usage 16 | #' immuno 17 | #' @format 18 | #' An undirected `igraph` graph object. 19 | #' 20 | #' Graph attributes: \sQuote{name}, \sQuote{Citation}, \sQuote{Author}. 21 | #' @references 22 | #' D. Gfeller, Simplifying complex networks: from a clustering to a 23 | #' coarse graining strategy, *PhD Thesis EPFL*, no 3888, 2007. 24 | #' 25 | #' @source 26 | #' See reference below. 27 | #' @keywords datasets 28 | NULL 29 | -------------------------------------------------------------------------------- /R/karate.R: -------------------------------------------------------------------------------- 1 | #' Zachary's karate club network 2 | #' 3 | #' @description 4 | #' 5 | #' Social network between members of a university karate club, led by 6 | #' president John A. and karate instructor Mr. Hi (pseudonyms). 7 | #' 8 | #' The edge weights are the number of common activities the club 9 | #' members took part of. These activities were: 10 | #' \enumerate{ 11 | #' \item Association in and between academic classes at the university. 12 | #' \item Membership in Mr. Hi's private karate studio on the east side 13 | #' of the city where Mr. Hi taught nights as a part-time instructor. 14 | #' \item Membership in Mr. Hi's private karate studio on the east side 15 | #' of the city, where many of his supporters worked out on weekends. 16 | #' \item Student teaching at the east-side karate studio referred to in 17 | #' (2). This is different from (2) in that student teachers interacted 18 | #' with each other, but were prohibited from interacting with their 19 | #' students. 20 | #' \item Interaction at the university rathskeller, located in the same 21 | #' basement as the karate club's workout area. 22 | #' \item Interaction at a student-oriented bar located across the 23 | #' street from the university campus. 24 | #' \item Attendance at open karate tournaments held through the area at 25 | #' private karate studios. 26 | #' \item Attendance at intercollegiate karate tournaments held at local 27 | #' universities. Since both open and intercollegiate tournaments were 28 | #' held on Saturdays, attendance at both was impossible. 29 | #' } 30 | #' 31 | #' Zachary studied conflict and fission in this network, as the karate 32 | #' club was split into two separate clubs, after long disputes between 33 | #' two factions of the club, one led by John A., the other by Mr. Hi. 34 | #' 35 | #' The \sQuote{Faction} vertex attribute gives the faction memberships of 36 | #' the actors. After the split of the club, club members chose their 37 | #' new clubs based on their factions, except actor no. 9, who was in John 38 | #' A.'s faction but chose Mr. Hi's club. 39 | #' 40 | #' 41 | #' 42 | #' @name karate 43 | #' @docType data 44 | #' @usage 45 | #' karate 46 | #' @format 47 | #' An undirected `igraph` graph object. Vertex no. 1 is Mr. Hi, 48 | #' vertex no. 34 corresponds to John A. 49 | #' 50 | #' Graph attributes: \sQuote{name}, \sQuote{Citation}, \sQuote{Author}. 51 | #' 52 | #' Vertex attributes: \sQuote{name}, \sQuote{Faction}, \sQuote{color} is 53 | #' the same as \sQuote{Faction}, \sQuote{label} are short labels for plotting. 54 | #' 55 | #' Edge attribute: \sQuote{weight}. 56 | #' @references 57 | #' Wayne W. Zachary. An Information Flow Model for Conflict and Fission 58 | #' in Small Groups. *Journal of Anthropological Research* Vol. 33, 59 | #' No. 4 452-473 60 | #' @source 61 | #' See reference below. 62 | #' @keywords datasets 63 | NULL 64 | -------------------------------------------------------------------------------- /R/kite.R: -------------------------------------------------------------------------------- 1 | #' Krackhardt's kite 2 | #' 3 | #' @description 4 | #' 5 | #' Krackhardt's kite is a fictional social network with ten actors. 6 | #' It is a small (though not the smallest possible) graph for which the most 7 | #' central actors are different according to the three classic centrality 8 | #' measures: degree, closeness and betweenness. 9 | #' 10 | #' @name kite 11 | #' @docType data 12 | #' @usage 13 | #' kite 14 | #' @format 15 | #' An undirected igraph graph with graph attributes `name`, 16 | #' `layout`, `Citation`, `Author`, `URL`, and vertex 17 | #' attributes `label`, `name` and `Firstname`. 18 | #' @references 19 | #' Assessing the Political Landscape: Structure, Cognition, and Power in 20 | #' Organizations. David Krackhardt. *Admin. Sci. Quart.* 35, 342-369, 21 | #' 1990. \doi{10.2307/2393394} 22 | #' @source 23 | #' 24 | #' @keywords datasets 25 | NULL 26 | -------------------------------------------------------------------------------- /R/macaque.R: -------------------------------------------------------------------------------- 1 | #' Visuotactile brain areas and connections 2 | #' 3 | #' @description 4 | #' 5 | #' Graph model of the visuotactile brain areas and connections of the 6 | #' macaque monkey. The model consists of 45 areas and 463 directed 7 | #' connections. 8 | #' 9 | #' 10 | #' 11 | #' @name macaque 12 | #' @docType data 13 | #' @usage 14 | #' macaque 15 | #' @format 16 | #' A directed `igraph` graph object with vertex attributes 17 | #' \sQuote{name} and \sQuote{shape}. 18 | #' 19 | #' This dataset is licensed under a Creative Commons 20 | #' Attribution-Share Alike 2.0 UK: England & Wales License, 21 | #' see for details. 22 | #' Please cite the reference below if you use this dataset. 23 | #' @references Negyessy L., Nepusz T., Kocsis L., Bazso F.: Prediction of 24 | #' the main cortical areas and connections involved in the tactile 25 | #' function of the visual cortex by network analysis. *European 26 | #' Journal of Neuroscience*, 23(7): 1919-1930, 2006. 27 | #' \doi{10.1111/j.1460-9568.2006.04678.x} 28 | #' @source See reference below. 29 | #' @keywords datasets 30 | NULL 31 | -------------------------------------------------------------------------------- /R/netzschleuder.R: -------------------------------------------------------------------------------- 1 | #' @keywords internal 2 | .pkg_env <- new.env(parent = emptyenv()) 3 | 4 | get_base_req <- function() { 5 | if (!exists("base_req", envir = .pkg_env, inherits = FALSE)) { 6 | base_req <- httr2::request("https://networks.skewed.de") |> 7 | httr2::req_throttle(capacity = 20, fill_time_s = 60) |> 8 | httr2::req_user_agent( 9 | "R package igraphdata (github.com/igraph/igraphdata)" 10 | ) 11 | .pkg_env$base_req <- base_req 12 | } 13 | .pkg_env$base_req 14 | } 15 | 16 | make_request <- function(path, token = NULL, method = "GET", file = NULL) { 17 | rlang::check_installed("httr2") 18 | req <- httr2::req_url_path(get_base_req(), path) 19 | req <- httr2::req_method(req, method) 20 | if (method == "HEAD") { 21 | req <- httr2::req_headers(req, `Accept-Encoding` = "identity") 22 | } 23 | if (!is.null(token)) { 24 | req <- httr2::req_headers(req, `WWW-Authenticate` = token) 25 | } 26 | 27 | resp <- httr2::req_perform(req, path = file) 28 | 29 | if (httr2::resp_status(resp) != 200) { 30 | stop("Failed to download file. Status: ", httr2::resp_status(resp)) 31 | } 32 | 33 | resp 34 | } 35 | 36 | resolve_name <- function(x) { 37 | #remove trailing / 38 | x <- sub("/$", "", x) 39 | #remove double slash 40 | x <- sub("//", "/", x) 41 | 42 | if (grepl("/", x)) { 43 | res_names <- strsplit(x, "/", fixed = TRUE)[[1]] 44 | bad_names_format <- (length(res_names) > 2) 45 | if (bad_names_format) { 46 | cli::cli_abort( 47 | "{.arg name} is not correctly formatted." 48 | ) 49 | } 50 | } else { 51 | res_names <- c(x, x) 52 | } 53 | rlang::set_names(res_names, c("collection", "network")) 54 | } 55 | 56 | download_file <- function(zip_url, token = NULL, file, size_limit) { 57 | resp <- make_request(zip_url, token, method = "HEAD") 58 | byte_size <- as.numeric(httr2::resp_headers(resp)[["content-length"]]) 59 | gb_size <- round(byte_size / 1024^3, 4) 60 | if (gb_size > size_limit) { 61 | cli::cli_abort(c( 62 | "{zip_url} has a size of {gb_size} GB and exceeds the size limit of {size_limit} GB.", 63 | "i" = "To download the file, set {.arg size_limit} to a value greater than {gb_size}" 64 | )) 65 | } 66 | make_request(zip_url, token, method = "GET", file = file) 67 | invisible(NULL) 68 | } 69 | 70 | #' Download and Convert Graph Data from Netzschleuder 71 | #' 72 | #' These functions provide tools to interact with the Netzschleuder network dataset archive. 73 | #' Netzschleuder () is a large online repository for network datasets, 74 | #' aimed at aiding scientific research. 75 | #' \describe{ 76 | #' \item{`ns_metadata()`}{ retrieves metadata about a network or network collection.} 77 | #' \item{`ns_df()`}{downloads the graph data as data frames (nodes, edges, and graph properties).} 78 | #' \item{`ns_graph()`}{creates an `igraph` object directly from Netzschleuder.} 79 | #' } 80 | #' 81 | #' @param name Character. The name of the network dataset. To get a network from a collection, 82 | #' use the format `/`. 83 | #' @param collection Logical. If TRUE, get the metadata of a whole collection of networks. 84 | #' @param token Character. Some networks have restricted access and require a token. 85 | #' @param size_limit Numeric. Maximum allowed file size in GB. Larger files will be prevented from being downloaded. 86 | #' See . 87 | #' 88 | #' @return 89 | #' \describe{ 90 | #' \item{`ns_metadata()`}{A list containing metadata for the dataset.} 91 | #' \item{`ns_df()`}{A named list with `nodes`, `edges`, `gprops`, and `meta`.} 92 | #' \item{`ns_graph()`}{An `igraph` object.} 93 | #' } 94 | #' @examples 95 | #' \dontrun{ 96 | #' # Get metadata 97 | #' ns_metadata("copenhagen/calls") 98 | #' 99 | #' # Download network as data frames 100 | #' graph_data <- ns_df("copenhagen/calls") 101 | #' 102 | #' # Create an igraph object 103 | #' g <- ns_graph("copenhagen/calls") 104 | #' } 105 | #' 106 | #' @seealso 107 | #' @rdname netzschleuder 108 | #' @export 109 | ns_metadata <- function(name, collection = FALSE) { 110 | rlang::check_installed("cli") 111 | net_ident <- resolve_name(name) 112 | path <- sprintf("api/net/%s", net_ident[["collection"]]) 113 | collection_url <- sprintf( 114 | "https://networks.skewed.de/net/%s", 115 | net_ident[["collection"]] 116 | ) 117 | resp <- make_request(path) 118 | raw <- httr2::resp_body_json(resp) 119 | class(raw) <- c("ns_meta", class(raw)) 120 | raw[["is_collection"]] <- collection 121 | raw[["collection_name"]] <- net_ident[["collection"]] 122 | if (collection) { 123 | return(raw) 124 | } 125 | 126 | # Check if collection equals network and multiple nets exist 127 | if ( 128 | net_ident[["collection"]] == net_ident[["network"]] && 129 | length(unlist(raw$nets)) > 1 && 130 | !collection 131 | ) { 132 | cli::cli_abort( 133 | c( 134 | "{net_ident[[1]]} is a collection and downloading a whole collection is not permitted.", 135 | "i" = "see {.url {collection_url}}" 136 | ) 137 | ) 138 | } 139 | 140 | # If collection equals network 141 | if (net_ident[["collection"]] == net_ident[["network"]]) { 142 | return(raw) 143 | } 144 | 145 | # Find matching network 146 | idx <- which(unlist(raw[["nets"]]) == net_ident[["network"]]) 147 | if (length(idx) == 0) { 148 | cli::cli_abort( 149 | c( 150 | "{net_ident[[2]]} is not part of the collection {net_ident[[1]]}.", 151 | "i" = "see {.url {collection_url}}" 152 | ) 153 | ) 154 | } 155 | 156 | raw[["analyses"]] <- raw[["analyses"]][[net_ident[["network"]]]] 157 | raw[["nets"]] <- raw[["nets"]][idx] 158 | raw 159 | } 160 | 161 | #' @rdname netzschleuder 162 | #' @export 163 | ns_df <- function(name, token = NULL, size_limit = 1) { 164 | rlang::check_installed("minty") 165 | if (is.character(name)) { 166 | meta <- ns_metadata(name, collection = FALSE) 167 | net_ident <- resolve_name(name) 168 | } else if (inherits(name, "ns_meta")) { 169 | if (name[["is_collection"]]) { 170 | cli::cli_abort(c( 171 | "{.arg name} contains the meta data of a whole collection and downloading a whole collection is not permitted.", 172 | "i" = "set collection = FALSE in `ns_metadata()`" 173 | )) 174 | } 175 | meta <- name 176 | net_ident <- c( 177 | collection = meta[["collection_name"]], 178 | network = meta[["nets"]] 179 | ) 180 | } else { 181 | cli::cli_abort("{.arg name} must be a string or a `ns_meta` object.") 182 | } 183 | 184 | zip_url <- sprintf( 185 | "net/%s/files/%s.csv.zip", 186 | net_ident[["collection"]], 187 | net_ident[["network"]] 188 | ) 189 | 190 | temp <- tempfile(fileext = "zip") 191 | on.exit(unlink(temp)) 192 | download_file(zip_url, token = token, file = temp, size_limit = size_limit) 193 | 194 | zip_contents <- utils::unzip(temp, list = TRUE) 195 | 196 | edge_file_name <- grep("edge", zip_contents$Name, value = TRUE) 197 | node_file_name <- grep("node", zip_contents$Name, value = TRUE) 198 | gprops_file_name <- grep("gprops", zip_contents$Name, value = TRUE) 199 | 200 | con_edge <- unz(temp, edge_file_name) 201 | on.exit(close(con_edge)) 202 | edges_df_raw <- utils::read.csv(con_edge) 203 | edges_df <- suppressWarnings(minty::type_convert(edges_df_raw)) 204 | source_loc <- grep("source", names(edges_df)) 205 | target_loc <- grep("target", names(edges_df)) 206 | names(edges_df)[c(source_loc, target_loc)] <- c("from", "to") 207 | 208 | # netzschleuder uses 0-indexing, igraph uses 1-indexing 209 | edges_df[["from"]] <- edges_df[["from"]] + 1L 210 | edges_df[["to"]] <- edges_df[["to"]] + 1L 211 | 212 | con_nodes <- unz(temp, node_file_name) 213 | on.exit(close(con_nodes)) 214 | nodes_df_raw <- utils::read.csv(con_nodes) 215 | 216 | #suppress warning if no character columns found 217 | nodes_df <- suppressWarnings(minty::type_convert(nodes_df_raw)) 218 | names(nodes_df)[[1]] <- "id" 219 | 220 | # netzschleuder uses 0-indexing, igraph uses 1-indexing 221 | nodes_df[["id"]] <- nodes_df[["id"]] + 1L 222 | if ("X_pos" %in% names(nodes_df)) { 223 | regex <- gregexpr("-?\\d+\\.\\d+", nodes_df[["X_pos"]]) 224 | matches <- regmatches(nodes_df[["X_pos"]], regex) 225 | 226 | mat <- vapply(matches, as.numeric, numeric(2)) 227 | 228 | nodes_df[["X_pos"]] <- NULL 229 | nodes_df[["x"]] <- mat[1, ] 230 | nodes_df[["y"]] <- mat[2, ] 231 | } 232 | 233 | con_gprops <- unz(temp, gprops_file_name) 234 | on.exit(close(con_gprops)) 235 | gprops_df <- readLines(con_gprops) 236 | 237 | list(nodes = nodes_df, edges = edges_df, gprops = gprops_df, meta = meta) 238 | } 239 | 240 | #' @rdname netzschleuder 241 | #' @export 242 | ns_graph <- function(name, token = NULL, size_limit = 1) { 243 | graph_data <- ns_df(name, token = token, size_limit = size_limit) 244 | directed <- graph_data$meta[["analyses"]][["is_directed"]] 245 | bipartite <- graph_data$meta[["analyses"]][["is_bipartite"]] 246 | 247 | g <- igraph::graph_from_data_frame( 248 | graph_data$edges, 249 | directed = directed, 250 | vertices = graph_data$nodes 251 | ) 252 | 253 | if (bipartite) { 254 | types <- rep(FALSE, igraph::vcount(g)) 255 | types[graph_data$nodes$id %in% graph_data$edges[[1]]] <- TRUE 256 | g <- igraph::set_vertex_attr(g, "type", value = types) 257 | } 258 | 259 | g 260 | } 261 | 262 | #' @export 263 | print.ns_meta <- function(x, ...) { 264 | if (x[["is_collection"]]) { 265 | cat("Netzschleuder Metadata for the collection:", x[["collection_name"]]) 266 | cat("Number of Networks:", length(x[["nets"]])) 267 | } else { 268 | cat( 269 | "Netzschleuder Metadata for: ", 270 | x[["collection_name"]], 271 | "/", 272 | x[["nets"]][[1]], 273 | sep = "" 274 | ) 275 | cat("\n") 276 | cat("Number of vertices:", x$analyses$num_vertices) 277 | cat("\n") 278 | cat("Number of Edges:", x$analyses$num_edges) 279 | cat("\n") 280 | cat("Directed:", x$analyses$is_directed) 281 | cat("\n") 282 | cat("Bipartite:", x$analyses$is_bipartite) 283 | } 284 | } 285 | -------------------------------------------------------------------------------- /R/rfid.R: -------------------------------------------------------------------------------- 1 | #' Hospital encounter network data 2 | #' 3 | #' @description 4 | #' 5 | #' Records of contacts among patients and various types of health care 6 | #' workers in the geriatric unit of a hospital in Lyon, France, in 7 | #' 2010, from 1pm on Monday, December 6 to 2pm on Friday, December 8 | #' 10. Each of the 75 people in this study consented to wear RFID 9 | #' sensors on small identification badges during this period, which made 10 | #' it possible to record when any two of them were in face-to-face 11 | #' contact with each other (i.e., within 1-1.5 m of each other) during 12 | #' a 20-second interval of time. 13 | #' 14 | #' 15 | #' 16 | #' @name rfid 17 | #' @docType data 18 | #' @usage 19 | #' rfid 20 | #' @format 21 | #' An igraph graph with graph attributes \sQuote{name} and 22 | #' \sQuote{Citation}, vertex attribute \sQuote{Status} and edge attribute 23 | #' \sQuote{Time}. 24 | #' 25 | #' \sQuote{Status} is the status of the person. Status codes: 26 | #' administrative staff (ADM), medical doctor (MED), paramedical staff, 27 | #' such as nurses or nurses' aides (NUR), and patients (PAT). 28 | #' 29 | #' \sQuote{Time} is the time of the encounter, it is the second when the 30 | #' 20 second encounter terminated. 31 | #' @references 32 | #' P. Vanhems, A. Barrat, C. Cattuto, J.-F. Pinton, N. Khanafer, 33 | #' C. Regis, B.-a. Kim, B. Comte, N. Voirin: Estimating potential 34 | #' infection transmission routes in hospital wards using wearable 35 | #' proximity sensors. PloS One 8(9), e73970 306 (2013). 36 | #' \doi{10.1371/journal.pone.0073970} 37 | #' @source 38 | #' See the reference below. 39 | #' Please cite it if you use this dataset in your work. 40 | #' @keywords datasets 41 | NULL 42 | -------------------------------------------------------------------------------- /R/yeast.R: -------------------------------------------------------------------------------- 1 | #' Yeast protein interaction network 2 | #' 3 | #' @description 4 | #' 5 | #' Comprehensive protein-protein interaction maps promise to reveal many 6 | #' aspects of the complex regulatory network underlying cellular 7 | #' function. 8 | #' 9 | #' This data set was compiled by von Mering et al. (see reference below), 10 | #' combining various sources. Only the interactions that have 11 | #' \sQuote{high} and \sQuote{medium} confidence are included here. 12 | #' 13 | #' 14 | #' 15 | #' @name yeast 16 | #' @docType data 17 | #' @usage 18 | #' yeast 19 | #' @format 20 | #' An undirected `igraph` graph object. Its graph attributes: 21 | #' \sQuote{name}, \sQuote{Citation}, \sQuote{Author}, 22 | #' \sQuote{URL}. \sQuote{Classes}. The \sQuote{Classes} 23 | #' attribute contain the key for the classification labels of the 24 | #' proteins, in a data frame, the original MIPS categories are given 25 | #' after the semicolon: 26 | #' \describe{ 27 | #' \item{E}{energy production; energy} 28 | #' \item{G}{aminoacid metabolism; aminoacid metabolism} 29 | #' \item{M}{other metabolism; all remaining metabolism categories} 30 | #' \item{P}{translation; protein synthesis} 31 | #' \item{T}{transcription; transcription, but without subcategory 32 | #' \sQuote{transcriptional control}} 33 | #' \item{B}{transcriptional control; subcategory 34 | #' \sQuote{transcriptional control}} 35 | #' \item{F}{protein fate; protein fate (folding, modification, 36 | #' destination)} 37 | #' \item{O}{cellular organization; cellular transport and transport 38 | #' mechanisms} 39 | #' \item{A}{transport and sensing; categories \sQuote{transport 40 | #' facilitation} and \sQuote{regulation of / interaction with 41 | #' cellular environment}} 42 | #' \item{R}{stress and defense; cell rescue, defense and virulence} 43 | #' \item{D}{genome maintenance; DNA processing and cell cycle} 44 | #' \item{C}{cellular fate / organization; categories \sQuote{cell fate} 45 | #' and \sQuote{cellular communication / signal transduction} and 46 | #' \sQuote{control of cellular organization}} 47 | #' \item{U}{uncharacterized; categories \sQuote{not yet clear-cut} and 48 | #' \sQuote{uncharacterized}} 49 | #' } 50 | #' 51 | #' Vertex attributes: \sQuote{name}, \sQuote{Description}, 52 | #' \sQuote{Class}, the last one contains the class of the protein, 53 | #' accoring to the classification above. 54 | #' 55 | #' Note that some proteins in the network did not appear in the 56 | #' annotation files, the \sQuote{Class} and \sQuote{Description} 57 | #' attributes are `NA` for these. 58 | #' @references 59 | #' Comparative assessment of large-scale data sets of protein-protein 60 | #' interactions. Christian von Mering, Roland Krause, Berend Snel, 61 | #' Michael Cornell, Stephen G. Oliver, Stanley Fields and Peer 62 | #' Bork. *Nature* 417, 399-403 (2002) 63 | #' @source The data was downloaded from 64 | #' . 65 | #' @keywords datasets 66 | NULL 67 | -------------------------------------------------------------------------------- /README.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | output: downlit::readme_document 3 | --- 4 | 5 | 6 | 7 | 8 | ```{r, setup, echo = FALSE, message = FALSE} 9 | knitr::opts_chunk$set( 10 | comment = "#>" 11 | ) 12 | ``` 13 | 14 | ```{r, echo = FALSE, results = 'hide'} 15 | options(pager = function(files, header, title, delete.file) { 16 | for (f in files) { 17 | l <- readLines(f) 18 | cat(l, sep = "\n") 19 | } 20 | }) 21 | ``` 22 | 23 | # Data sets for the igraph R package 24 | 25 | [![Linux build status](https://travis-ci.org/igraph/igraphdata.png)](https://travis-ci.org/igraph/igraphdata) 26 | [![Windows build status](https://ci.appveyor.com/api/projects/status/6wov9hh8oprrpkhs?svg=true)](https://ci.appveyor.com/project/gaborcsardi/igraphdata) 27 | 28 | This is a data R package, that contains network data sets, 29 | to be used with the igraph R package. 30 | 31 | ## Installation 32 | 33 | From CRAN: 34 | 35 | ```{r, eval = FALSE} 36 | install.packages("igraphdata") 37 | ``` 38 | 39 | You can install the development version from Github, using the 40 | [devtools package](https://github.com/hadley/devtools): 41 | 42 | ```{r, eval = FALSE} 43 | devtools::install_github("igraph/igraphdata") 44 | ``` 45 | 46 | ## Usage 47 | 48 | ```{r} 49 | library(igraphdata) 50 | data(package = "igraphdata") 51 | ``` 52 | 53 | # License 54 | 55 | CC BY-SA 4.0, plus see [LICENSE](LICENSE) for the licenses of the 56 | individual data sets. 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Data sets for the igraph R package 4 | 5 | [![Linux build status](https://travis-ci.org/igraph/igraphdata.png)](https://travis-ci.org/igraph/igraphdata) [![Windows build status](https://ci.appveyor.com/api/projects/status/6wov9hh8oprrpkhs?svg=true)](https://ci.appveyor.com/project/gaborcsardi/igraphdata) 6 | 7 | This is a data R package, that contains network data sets, to be used with the igraph R package. 8 | 9 | ## Installation 10 | 11 | From CRAN: 12 | 13 |
14 | install.packages("igraphdata")
15 | 16 | You can install the development version from Github, using the [devtools package](https://github.com/hadley/devtools): 17 | 18 |
19 | devtools::install_github("igraph/igraphdata")
20 | 21 | ## Usage 22 | 23 |
24 | library(igraphdata)
25 | data(package = "igraphdata")
26 |
27 | #> Data sets in package 'igraphdata':
28 | #> 
29 | #> Koenigsberg             Bridges of Koenigsberg from Euler's times
30 | #> UKfaculty               Friendship network of a UK university faculty
31 | #> USairports              US airport network, 2010 December
32 | #> enron                   Enron Email Network
33 | #> foodwebs                A collection of food webs
34 | #> immuno                  Immunoglobulin interaction network
35 | #> karate                  Zachary's karate club network
36 | #> kite                    Krackhardt's kite
37 | #> macaque                 Visuotactile brain areas and connections
38 | #> rfid                    Hospital encounter network data
39 | #> yeast                   Yeast protein interaction network
40 | 41 | # License 42 | 43 | CC BY-SA 4.0, plus see [LICENSE](LICENSE) for the licenses of the individual data sets. 44 | -------------------------------------------------------------------------------- /data/Koenigsberg.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igraph/igraphdata/022d97b441475cc5111aaf1730b1d335407a92a5/data/Koenigsberg.rda -------------------------------------------------------------------------------- /data/UKfaculty.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igraph/igraphdata/022d97b441475cc5111aaf1730b1d335407a92a5/data/UKfaculty.rda -------------------------------------------------------------------------------- /data/USairports.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igraph/igraphdata/022d97b441475cc5111aaf1730b1d335407a92a5/data/USairports.rda -------------------------------------------------------------------------------- /data/enron.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igraph/igraphdata/022d97b441475cc5111aaf1730b1d335407a92a5/data/enron.rda -------------------------------------------------------------------------------- /data/foodwebs.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igraph/igraphdata/022d97b441475cc5111aaf1730b1d335407a92a5/data/foodwebs.rda -------------------------------------------------------------------------------- /data/immuno.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igraph/igraphdata/022d97b441475cc5111aaf1730b1d335407a92a5/data/immuno.rda -------------------------------------------------------------------------------- /data/karate.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igraph/igraphdata/022d97b441475cc5111aaf1730b1d335407a92a5/data/karate.rda -------------------------------------------------------------------------------- /data/kite.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igraph/igraphdata/022d97b441475cc5111aaf1730b1d335407a92a5/data/kite.rda -------------------------------------------------------------------------------- /data/macaque.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igraph/igraphdata/022d97b441475cc5111aaf1730b1d335407a92a5/data/macaque.rda -------------------------------------------------------------------------------- /data/rfid.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igraph/igraphdata/022d97b441475cc5111aaf1730b1d335407a92a5/data/rfid.rda -------------------------------------------------------------------------------- /data/yeast.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/igraph/igraphdata/022d97b441475cc5111aaf1730b1d335407a92a5/data/yeast.rda -------------------------------------------------------------------------------- /igraphdata.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: No 4 | SaveWorkspace: No 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | LineEndingConversion: Posix 18 | 19 | BuildType: Package 20 | PackageUseDevtools: Yes 21 | PackageInstallArgs: --no-multiarch --with-keep.source 22 | PackageRoxygenize: rd,collate,namespace 23 | -------------------------------------------------------------------------------- /inst/files/lesmis.gml: -------------------------------------------------------------------------------- 1 | Creator "igraph Sat Dec 17 11:32:17 2022" 2 | Version 1 3 | graph 4 | [ 5 | directed 0 6 | node 7 | [ 8 | id 0 9 | name "Myriel" 10 | ] 11 | node 12 | [ 13 | id 1 14 | name "Napoleon" 15 | ] 16 | node 17 | [ 18 | id 2 19 | name "MlleBaptistine" 20 | ] 21 | node 22 | [ 23 | id 3 24 | name "MmeMagloire" 25 | ] 26 | node 27 | [ 28 | id 4 29 | name "CountessDeLo" 30 | ] 31 | node 32 | [ 33 | id 5 34 | name "Geborand" 35 | ] 36 | node 37 | [ 38 | id 6 39 | name "Champtercier" 40 | ] 41 | node 42 | [ 43 | id 7 44 | name "Cravatte" 45 | ] 46 | node 47 | [ 48 | id 8 49 | name "Count" 50 | ] 51 | node 52 | [ 53 | id 9 54 | name "OldMan" 55 | ] 56 | node 57 | [ 58 | id 10 59 | name "Labarre" 60 | ] 61 | node 62 | [ 63 | id 11 64 | name "Valjean" 65 | ] 66 | node 67 | [ 68 | id 12 69 | name "Marguerite" 70 | ] 71 | node 72 | [ 73 | id 13 74 | name "MmeDeR" 75 | ] 76 | node 77 | [ 78 | id 14 79 | name "Isabeau" 80 | ] 81 | node 82 | [ 83 | id 15 84 | name "Gervais" 85 | ] 86 | node 87 | [ 88 | id 16 89 | name "Tholomyes" 90 | ] 91 | node 92 | [ 93 | id 17 94 | name "Listolier" 95 | ] 96 | node 97 | [ 98 | id 18 99 | name "Fameuil" 100 | ] 101 | node 102 | [ 103 | id 19 104 | name "Blacheville" 105 | ] 106 | node 107 | [ 108 | id 20 109 | name "Favourite" 110 | ] 111 | node 112 | [ 113 | id 21 114 | name "Dahlia" 115 | ] 116 | node 117 | [ 118 | id 22 119 | name "Zephine" 120 | ] 121 | node 122 | [ 123 | id 23 124 | name "Fantine" 125 | ] 126 | node 127 | [ 128 | id 24 129 | name "MmeThenardier" 130 | ] 131 | node 132 | [ 133 | id 25 134 | name "Thenardier" 135 | ] 136 | node 137 | [ 138 | id 26 139 | name "Cosette" 140 | ] 141 | node 142 | [ 143 | id 27 144 | name "Javert" 145 | ] 146 | node 147 | [ 148 | id 28 149 | name "Fauchelevent" 150 | ] 151 | node 152 | [ 153 | id 29 154 | name "Bamatabois" 155 | ] 156 | node 157 | [ 158 | id 30 159 | name "Perpetue" 160 | ] 161 | node 162 | [ 163 | id 31 164 | name "Simplice" 165 | ] 166 | node 167 | [ 168 | id 32 169 | name "Scaufflaire" 170 | ] 171 | node 172 | [ 173 | id 33 174 | name "Woman1" 175 | ] 176 | node 177 | [ 178 | id 34 179 | name "Judge" 180 | ] 181 | node 182 | [ 183 | id 35 184 | name "Champmathieu" 185 | ] 186 | node 187 | [ 188 | id 36 189 | name "Brevet" 190 | ] 191 | node 192 | [ 193 | id 37 194 | name "Chenildieu" 195 | ] 196 | node 197 | [ 198 | id 38 199 | name "Cochepaille" 200 | ] 201 | node 202 | [ 203 | id 39 204 | name "Pontmercy" 205 | ] 206 | node 207 | [ 208 | id 40 209 | name "Boulatruelle" 210 | ] 211 | node 212 | [ 213 | id 41 214 | name "Eponine" 215 | ] 216 | node 217 | [ 218 | id 42 219 | name "Anzelma" 220 | ] 221 | node 222 | [ 223 | id 43 224 | name "Woman2" 225 | ] 226 | node 227 | [ 228 | id 44 229 | name "MotherInnocent" 230 | ] 231 | node 232 | [ 233 | id 45 234 | name "Gribier" 235 | ] 236 | node 237 | [ 238 | id 46 239 | name "Jondrette" 240 | ] 241 | node 242 | [ 243 | id 47 244 | name "MmeBurgon" 245 | ] 246 | node 247 | [ 248 | id 48 249 | name "Gavroche" 250 | ] 251 | node 252 | [ 253 | id 49 254 | name "Gillenormand" 255 | ] 256 | node 257 | [ 258 | id 50 259 | name "Magnon" 260 | ] 261 | node 262 | [ 263 | id 51 264 | name "MlleGillenormand" 265 | ] 266 | node 267 | [ 268 | id 52 269 | name "MmePontmercy" 270 | ] 271 | node 272 | [ 273 | id 53 274 | name "MlleVaubois" 275 | ] 276 | node 277 | [ 278 | id 54 279 | name "LtGillenormand" 280 | ] 281 | node 282 | [ 283 | id 55 284 | name "Marius" 285 | ] 286 | node 287 | [ 288 | id 56 289 | name "BaronessT" 290 | ] 291 | node 292 | [ 293 | id 57 294 | name "Mabeuf" 295 | ] 296 | node 297 | [ 298 | id 58 299 | name "Enjolras" 300 | ] 301 | node 302 | [ 303 | id 59 304 | name "Combeferre" 305 | ] 306 | node 307 | [ 308 | id 60 309 | name "Prouvaire" 310 | ] 311 | node 312 | [ 313 | id 61 314 | name "Feuilly" 315 | ] 316 | node 317 | [ 318 | id 62 319 | name "Courfeyrac" 320 | ] 321 | node 322 | [ 323 | id 63 324 | name "Bahorel" 325 | ] 326 | node 327 | [ 328 | id 64 329 | name "Bossuet" 330 | ] 331 | node 332 | [ 333 | id 65 334 | name "Joly" 335 | ] 336 | node 337 | [ 338 | id 66 339 | name "Grantaire" 340 | ] 341 | node 342 | [ 343 | id 67 344 | name "MotherPlutarch" 345 | ] 346 | node 347 | [ 348 | id 68 349 | name "Gueulemer" 350 | ] 351 | node 352 | [ 353 | id 69 354 | name "Babet" 355 | ] 356 | node 357 | [ 358 | id 70 359 | name "Claquesous" 360 | ] 361 | node 362 | [ 363 | id 71 364 | name "Montparnasse" 365 | ] 366 | node 367 | [ 368 | id 72 369 | name "Toussaint" 370 | ] 371 | node 372 | [ 373 | id 73 374 | name "Child1" 375 | ] 376 | node 377 | [ 378 | id 74 379 | name "Child2" 380 | ] 381 | node 382 | [ 383 | id 75 384 | name "Brujon" 385 | ] 386 | node 387 | [ 388 | id 76 389 | name "MmeHucheloup" 390 | ] 391 | edge 392 | [ 393 | source 1 394 | target 0 395 | value 1 396 | ] 397 | edge 398 | [ 399 | source 2 400 | target 0 401 | value 8 402 | ] 403 | edge 404 | [ 405 | source 3 406 | target 0 407 | value 10 408 | ] 409 | edge 410 | [ 411 | source 3 412 | target 2 413 | value 6 414 | ] 415 | edge 416 | [ 417 | source 4 418 | target 0 419 | value 1 420 | ] 421 | edge 422 | [ 423 | source 5 424 | target 0 425 | value 1 426 | ] 427 | edge 428 | [ 429 | source 6 430 | target 0 431 | value 1 432 | ] 433 | edge 434 | [ 435 | source 7 436 | target 0 437 | value 1 438 | ] 439 | edge 440 | [ 441 | source 8 442 | target 0 443 | value 2 444 | ] 445 | edge 446 | [ 447 | source 9 448 | target 0 449 | value 1 450 | ] 451 | edge 452 | [ 453 | source 11 454 | target 10 455 | value 1 456 | ] 457 | edge 458 | [ 459 | source 11 460 | target 3 461 | value 3 462 | ] 463 | edge 464 | [ 465 | source 11 466 | target 2 467 | value 3 468 | ] 469 | edge 470 | [ 471 | source 11 472 | target 0 473 | value 5 474 | ] 475 | edge 476 | [ 477 | source 12 478 | target 11 479 | value 1 480 | ] 481 | edge 482 | [ 483 | source 13 484 | target 11 485 | value 1 486 | ] 487 | edge 488 | [ 489 | source 14 490 | target 11 491 | value 1 492 | ] 493 | edge 494 | [ 495 | source 15 496 | target 11 497 | value 1 498 | ] 499 | edge 500 | [ 501 | source 17 502 | target 16 503 | value 4 504 | ] 505 | edge 506 | [ 507 | source 18 508 | target 16 509 | value 4 510 | ] 511 | edge 512 | [ 513 | source 18 514 | target 17 515 | value 4 516 | ] 517 | edge 518 | [ 519 | source 19 520 | target 16 521 | value 4 522 | ] 523 | edge 524 | [ 525 | source 19 526 | target 17 527 | value 4 528 | ] 529 | edge 530 | [ 531 | source 19 532 | target 18 533 | value 4 534 | ] 535 | edge 536 | [ 537 | source 20 538 | target 16 539 | value 3 540 | ] 541 | edge 542 | [ 543 | source 20 544 | target 17 545 | value 3 546 | ] 547 | edge 548 | [ 549 | source 20 550 | target 18 551 | value 3 552 | ] 553 | edge 554 | [ 555 | source 20 556 | target 19 557 | value 4 558 | ] 559 | edge 560 | [ 561 | source 21 562 | target 16 563 | value 3 564 | ] 565 | edge 566 | [ 567 | source 21 568 | target 17 569 | value 3 570 | ] 571 | edge 572 | [ 573 | source 21 574 | target 18 575 | value 3 576 | ] 577 | edge 578 | [ 579 | source 21 580 | target 19 581 | value 3 582 | ] 583 | edge 584 | [ 585 | source 21 586 | target 20 587 | value 5 588 | ] 589 | edge 590 | [ 591 | source 22 592 | target 16 593 | value 3 594 | ] 595 | edge 596 | [ 597 | source 22 598 | target 17 599 | value 3 600 | ] 601 | edge 602 | [ 603 | source 22 604 | target 18 605 | value 3 606 | ] 607 | edge 608 | [ 609 | source 22 610 | target 19 611 | value 3 612 | ] 613 | edge 614 | [ 615 | source 22 616 | target 20 617 | value 4 618 | ] 619 | edge 620 | [ 621 | source 22 622 | target 21 623 | value 4 624 | ] 625 | edge 626 | [ 627 | source 23 628 | target 16 629 | value 3 630 | ] 631 | edge 632 | [ 633 | source 23 634 | target 17 635 | value 3 636 | ] 637 | edge 638 | [ 639 | source 23 640 | target 18 641 | value 3 642 | ] 643 | edge 644 | [ 645 | source 23 646 | target 19 647 | value 3 648 | ] 649 | edge 650 | [ 651 | source 23 652 | target 20 653 | value 4 654 | ] 655 | edge 656 | [ 657 | source 23 658 | target 21 659 | value 4 660 | ] 661 | edge 662 | [ 663 | source 23 664 | target 22 665 | value 4 666 | ] 667 | edge 668 | [ 669 | source 23 670 | target 12 671 | value 2 672 | ] 673 | edge 674 | [ 675 | source 23 676 | target 11 677 | value 9 678 | ] 679 | edge 680 | [ 681 | source 24 682 | target 23 683 | value 2 684 | ] 685 | edge 686 | [ 687 | source 24 688 | target 11 689 | value 7 690 | ] 691 | edge 692 | [ 693 | source 25 694 | target 24 695 | value 13 696 | ] 697 | edge 698 | [ 699 | source 25 700 | target 23 701 | value 1 702 | ] 703 | edge 704 | [ 705 | source 25 706 | target 11 707 | value 12 708 | ] 709 | edge 710 | [ 711 | source 26 712 | target 24 713 | value 4 714 | ] 715 | edge 716 | [ 717 | source 26 718 | target 11 719 | value 31 720 | ] 721 | edge 722 | [ 723 | source 26 724 | target 16 725 | value 1 726 | ] 727 | edge 728 | [ 729 | source 26 730 | target 25 731 | value 1 732 | ] 733 | edge 734 | [ 735 | source 27 736 | target 11 737 | value 17 738 | ] 739 | edge 740 | [ 741 | source 27 742 | target 23 743 | value 5 744 | ] 745 | edge 746 | [ 747 | source 27 748 | target 25 749 | value 5 750 | ] 751 | edge 752 | [ 753 | source 27 754 | target 24 755 | value 1 756 | ] 757 | edge 758 | [ 759 | source 27 760 | target 26 761 | value 1 762 | ] 763 | edge 764 | [ 765 | source 28 766 | target 11 767 | value 8 768 | ] 769 | edge 770 | [ 771 | source 28 772 | target 27 773 | value 1 774 | ] 775 | edge 776 | [ 777 | source 29 778 | target 23 779 | value 1 780 | ] 781 | edge 782 | [ 783 | source 29 784 | target 27 785 | value 1 786 | ] 787 | edge 788 | [ 789 | source 29 790 | target 11 791 | value 2 792 | ] 793 | edge 794 | [ 795 | source 30 796 | target 23 797 | value 1 798 | ] 799 | edge 800 | [ 801 | source 31 802 | target 30 803 | value 2 804 | ] 805 | edge 806 | [ 807 | source 31 808 | target 11 809 | value 3 810 | ] 811 | edge 812 | [ 813 | source 31 814 | target 23 815 | value 2 816 | ] 817 | edge 818 | [ 819 | source 31 820 | target 27 821 | value 1 822 | ] 823 | edge 824 | [ 825 | source 32 826 | target 11 827 | value 1 828 | ] 829 | edge 830 | [ 831 | source 33 832 | target 11 833 | value 2 834 | ] 835 | edge 836 | [ 837 | source 33 838 | target 27 839 | value 1 840 | ] 841 | edge 842 | [ 843 | source 34 844 | target 11 845 | value 3 846 | ] 847 | edge 848 | [ 849 | source 34 850 | target 29 851 | value 2 852 | ] 853 | edge 854 | [ 855 | source 35 856 | target 11 857 | value 3 858 | ] 859 | edge 860 | [ 861 | source 35 862 | target 34 863 | value 3 864 | ] 865 | edge 866 | [ 867 | source 35 868 | target 29 869 | value 2 870 | ] 871 | edge 872 | [ 873 | source 36 874 | target 34 875 | value 2 876 | ] 877 | edge 878 | [ 879 | source 36 880 | target 35 881 | value 2 882 | ] 883 | edge 884 | [ 885 | source 36 886 | target 11 887 | value 2 888 | ] 889 | edge 890 | [ 891 | source 36 892 | target 29 893 | value 1 894 | ] 895 | edge 896 | [ 897 | source 37 898 | target 34 899 | value 2 900 | ] 901 | edge 902 | [ 903 | source 37 904 | target 35 905 | value 2 906 | ] 907 | edge 908 | [ 909 | source 37 910 | target 36 911 | value 2 912 | ] 913 | edge 914 | [ 915 | source 37 916 | target 11 917 | value 2 918 | ] 919 | edge 920 | [ 921 | source 37 922 | target 29 923 | value 1 924 | ] 925 | edge 926 | [ 927 | source 38 928 | target 34 929 | value 2 930 | ] 931 | edge 932 | [ 933 | source 38 934 | target 35 935 | value 2 936 | ] 937 | edge 938 | [ 939 | source 38 940 | target 36 941 | value 2 942 | ] 943 | edge 944 | [ 945 | source 38 946 | target 37 947 | value 2 948 | ] 949 | edge 950 | [ 951 | source 38 952 | target 11 953 | value 2 954 | ] 955 | edge 956 | [ 957 | source 38 958 | target 29 959 | value 1 960 | ] 961 | edge 962 | [ 963 | source 39 964 | target 25 965 | value 1 966 | ] 967 | edge 968 | [ 969 | source 40 970 | target 25 971 | value 1 972 | ] 973 | edge 974 | [ 975 | source 41 976 | target 24 977 | value 2 978 | ] 979 | edge 980 | [ 981 | source 41 982 | target 25 983 | value 3 984 | ] 985 | edge 986 | [ 987 | source 42 988 | target 41 989 | value 2 990 | ] 991 | edge 992 | [ 993 | source 42 994 | target 25 995 | value 2 996 | ] 997 | edge 998 | [ 999 | source 42 1000 | target 24 1001 | value 1 1002 | ] 1003 | edge 1004 | [ 1005 | source 43 1006 | target 11 1007 | value 3 1008 | ] 1009 | edge 1010 | [ 1011 | source 43 1012 | target 26 1013 | value 1 1014 | ] 1015 | edge 1016 | [ 1017 | source 43 1018 | target 27 1019 | value 1 1020 | ] 1021 | edge 1022 | [ 1023 | source 44 1024 | target 28 1025 | value 3 1026 | ] 1027 | edge 1028 | [ 1029 | source 44 1030 | target 11 1031 | value 1 1032 | ] 1033 | edge 1034 | [ 1035 | source 45 1036 | target 28 1037 | value 2 1038 | ] 1039 | edge 1040 | [ 1041 | source 47 1042 | target 46 1043 | value 1 1044 | ] 1045 | edge 1046 | [ 1047 | source 48 1048 | target 47 1049 | value 2 1050 | ] 1051 | edge 1052 | [ 1053 | source 48 1054 | target 25 1055 | value 1 1056 | ] 1057 | edge 1058 | [ 1059 | source 48 1060 | target 27 1061 | value 1 1062 | ] 1063 | edge 1064 | [ 1065 | source 48 1066 | target 11 1067 | value 1 1068 | ] 1069 | edge 1070 | [ 1071 | source 49 1072 | target 26 1073 | value 3 1074 | ] 1075 | edge 1076 | [ 1077 | source 49 1078 | target 11 1079 | value 2 1080 | ] 1081 | edge 1082 | [ 1083 | source 50 1084 | target 49 1085 | value 1 1086 | ] 1087 | edge 1088 | [ 1089 | source 50 1090 | target 24 1091 | value 1 1092 | ] 1093 | edge 1094 | [ 1095 | source 51 1096 | target 49 1097 | value 9 1098 | ] 1099 | edge 1100 | [ 1101 | source 51 1102 | target 26 1103 | value 2 1104 | ] 1105 | edge 1106 | [ 1107 | source 51 1108 | target 11 1109 | value 2 1110 | ] 1111 | edge 1112 | [ 1113 | source 52 1114 | target 51 1115 | value 1 1116 | ] 1117 | edge 1118 | [ 1119 | source 52 1120 | target 39 1121 | value 1 1122 | ] 1123 | edge 1124 | [ 1125 | source 53 1126 | target 51 1127 | value 1 1128 | ] 1129 | edge 1130 | [ 1131 | source 54 1132 | target 51 1133 | value 2 1134 | ] 1135 | edge 1136 | [ 1137 | source 54 1138 | target 49 1139 | value 1 1140 | ] 1141 | edge 1142 | [ 1143 | source 54 1144 | target 26 1145 | value 1 1146 | ] 1147 | edge 1148 | [ 1149 | source 55 1150 | target 51 1151 | value 6 1152 | ] 1153 | edge 1154 | [ 1155 | source 55 1156 | target 49 1157 | value 12 1158 | ] 1159 | edge 1160 | [ 1161 | source 55 1162 | target 39 1163 | value 1 1164 | ] 1165 | edge 1166 | [ 1167 | source 55 1168 | target 54 1169 | value 1 1170 | ] 1171 | edge 1172 | [ 1173 | source 55 1174 | target 26 1175 | value 21 1176 | ] 1177 | edge 1178 | [ 1179 | source 55 1180 | target 11 1181 | value 19 1182 | ] 1183 | edge 1184 | [ 1185 | source 55 1186 | target 16 1187 | value 1 1188 | ] 1189 | edge 1190 | [ 1191 | source 55 1192 | target 25 1193 | value 2 1194 | ] 1195 | edge 1196 | [ 1197 | source 55 1198 | target 41 1199 | value 5 1200 | ] 1201 | edge 1202 | [ 1203 | source 55 1204 | target 48 1205 | value 4 1206 | ] 1207 | edge 1208 | [ 1209 | source 56 1210 | target 49 1211 | value 1 1212 | ] 1213 | edge 1214 | [ 1215 | source 56 1216 | target 55 1217 | value 1 1218 | ] 1219 | edge 1220 | [ 1221 | source 57 1222 | target 55 1223 | value 1 1224 | ] 1225 | edge 1226 | [ 1227 | source 57 1228 | target 41 1229 | value 1 1230 | ] 1231 | edge 1232 | [ 1233 | source 57 1234 | target 48 1235 | value 1 1236 | ] 1237 | edge 1238 | [ 1239 | source 58 1240 | target 55 1241 | value 7 1242 | ] 1243 | edge 1244 | [ 1245 | source 58 1246 | target 48 1247 | value 7 1248 | ] 1249 | edge 1250 | [ 1251 | source 58 1252 | target 27 1253 | value 6 1254 | ] 1255 | edge 1256 | [ 1257 | source 58 1258 | target 57 1259 | value 1 1260 | ] 1261 | edge 1262 | [ 1263 | source 58 1264 | target 11 1265 | value 4 1266 | ] 1267 | edge 1268 | [ 1269 | source 59 1270 | target 58 1271 | value 15 1272 | ] 1273 | edge 1274 | [ 1275 | source 59 1276 | target 55 1277 | value 5 1278 | ] 1279 | edge 1280 | [ 1281 | source 59 1282 | target 48 1283 | value 6 1284 | ] 1285 | edge 1286 | [ 1287 | source 59 1288 | target 57 1289 | value 2 1290 | ] 1291 | edge 1292 | [ 1293 | source 60 1294 | target 48 1295 | value 1 1296 | ] 1297 | edge 1298 | [ 1299 | source 60 1300 | target 58 1301 | value 4 1302 | ] 1303 | edge 1304 | [ 1305 | source 60 1306 | target 59 1307 | value 2 1308 | ] 1309 | edge 1310 | [ 1311 | source 61 1312 | target 48 1313 | value 2 1314 | ] 1315 | edge 1316 | [ 1317 | source 61 1318 | target 58 1319 | value 6 1320 | ] 1321 | edge 1322 | [ 1323 | source 61 1324 | target 60 1325 | value 2 1326 | ] 1327 | edge 1328 | [ 1329 | source 61 1330 | target 59 1331 | value 5 1332 | ] 1333 | edge 1334 | [ 1335 | source 61 1336 | target 57 1337 | value 1 1338 | ] 1339 | edge 1340 | [ 1341 | source 61 1342 | target 55 1343 | value 1 1344 | ] 1345 | edge 1346 | [ 1347 | source 62 1348 | target 55 1349 | value 9 1350 | ] 1351 | edge 1352 | [ 1353 | source 62 1354 | target 58 1355 | value 17 1356 | ] 1357 | edge 1358 | [ 1359 | source 62 1360 | target 59 1361 | value 13 1362 | ] 1363 | edge 1364 | [ 1365 | source 62 1366 | target 48 1367 | value 7 1368 | ] 1369 | edge 1370 | [ 1371 | source 62 1372 | target 57 1373 | value 2 1374 | ] 1375 | edge 1376 | [ 1377 | source 62 1378 | target 41 1379 | value 1 1380 | ] 1381 | edge 1382 | [ 1383 | source 62 1384 | target 61 1385 | value 6 1386 | ] 1387 | edge 1388 | [ 1389 | source 62 1390 | target 60 1391 | value 3 1392 | ] 1393 | edge 1394 | [ 1395 | source 63 1396 | target 59 1397 | value 5 1398 | ] 1399 | edge 1400 | [ 1401 | source 63 1402 | target 48 1403 | value 5 1404 | ] 1405 | edge 1406 | [ 1407 | source 63 1408 | target 62 1409 | value 6 1410 | ] 1411 | edge 1412 | [ 1413 | source 63 1414 | target 57 1415 | value 2 1416 | ] 1417 | edge 1418 | [ 1419 | source 63 1420 | target 58 1421 | value 4 1422 | ] 1423 | edge 1424 | [ 1425 | source 63 1426 | target 61 1427 | value 3 1428 | ] 1429 | edge 1430 | [ 1431 | source 63 1432 | target 60 1433 | value 2 1434 | ] 1435 | edge 1436 | [ 1437 | source 63 1438 | target 55 1439 | value 1 1440 | ] 1441 | edge 1442 | [ 1443 | source 64 1444 | target 55 1445 | value 5 1446 | ] 1447 | edge 1448 | [ 1449 | source 64 1450 | target 62 1451 | value 12 1452 | ] 1453 | edge 1454 | [ 1455 | source 64 1456 | target 48 1457 | value 5 1458 | ] 1459 | edge 1460 | [ 1461 | source 64 1462 | target 63 1463 | value 4 1464 | ] 1465 | edge 1466 | [ 1467 | source 64 1468 | target 58 1469 | value 10 1470 | ] 1471 | edge 1472 | [ 1473 | source 64 1474 | target 61 1475 | value 6 1476 | ] 1477 | edge 1478 | [ 1479 | source 64 1480 | target 60 1481 | value 2 1482 | ] 1483 | edge 1484 | [ 1485 | source 64 1486 | target 59 1487 | value 9 1488 | ] 1489 | edge 1490 | [ 1491 | source 64 1492 | target 57 1493 | value 1 1494 | ] 1495 | edge 1496 | [ 1497 | source 64 1498 | target 11 1499 | value 1 1500 | ] 1501 | edge 1502 | [ 1503 | source 65 1504 | target 63 1505 | value 5 1506 | ] 1507 | edge 1508 | [ 1509 | source 65 1510 | target 64 1511 | value 7 1512 | ] 1513 | edge 1514 | [ 1515 | source 65 1516 | target 48 1517 | value 3 1518 | ] 1519 | edge 1520 | [ 1521 | source 65 1522 | target 62 1523 | value 5 1524 | ] 1525 | edge 1526 | [ 1527 | source 65 1528 | target 58 1529 | value 5 1530 | ] 1531 | edge 1532 | [ 1533 | source 65 1534 | target 61 1535 | value 5 1536 | ] 1537 | edge 1538 | [ 1539 | source 65 1540 | target 60 1541 | value 2 1542 | ] 1543 | edge 1544 | [ 1545 | source 65 1546 | target 59 1547 | value 5 1548 | ] 1549 | edge 1550 | [ 1551 | source 65 1552 | target 57 1553 | value 1 1554 | ] 1555 | edge 1556 | [ 1557 | source 65 1558 | target 55 1559 | value 2 1560 | ] 1561 | edge 1562 | [ 1563 | source 66 1564 | target 64 1565 | value 3 1566 | ] 1567 | edge 1568 | [ 1569 | source 66 1570 | target 58 1571 | value 3 1572 | ] 1573 | edge 1574 | [ 1575 | source 66 1576 | target 59 1577 | value 1 1578 | ] 1579 | edge 1580 | [ 1581 | source 66 1582 | target 62 1583 | value 2 1584 | ] 1585 | edge 1586 | [ 1587 | source 66 1588 | target 65 1589 | value 2 1590 | ] 1591 | edge 1592 | [ 1593 | source 66 1594 | target 48 1595 | value 1 1596 | ] 1597 | edge 1598 | [ 1599 | source 66 1600 | target 63 1601 | value 1 1602 | ] 1603 | edge 1604 | [ 1605 | source 66 1606 | target 61 1607 | value 1 1608 | ] 1609 | edge 1610 | [ 1611 | source 66 1612 | target 60 1613 | value 1 1614 | ] 1615 | edge 1616 | [ 1617 | source 67 1618 | target 57 1619 | value 3 1620 | ] 1621 | edge 1622 | [ 1623 | source 68 1624 | target 25 1625 | value 5 1626 | ] 1627 | edge 1628 | [ 1629 | source 68 1630 | target 11 1631 | value 1 1632 | ] 1633 | edge 1634 | [ 1635 | source 68 1636 | target 24 1637 | value 1 1638 | ] 1639 | edge 1640 | [ 1641 | source 68 1642 | target 27 1643 | value 1 1644 | ] 1645 | edge 1646 | [ 1647 | source 68 1648 | target 48 1649 | value 1 1650 | ] 1651 | edge 1652 | [ 1653 | source 68 1654 | target 41 1655 | value 1 1656 | ] 1657 | edge 1658 | [ 1659 | source 69 1660 | target 25 1661 | value 6 1662 | ] 1663 | edge 1664 | [ 1665 | source 69 1666 | target 68 1667 | value 6 1668 | ] 1669 | edge 1670 | [ 1671 | source 69 1672 | target 11 1673 | value 1 1674 | ] 1675 | edge 1676 | [ 1677 | source 69 1678 | target 24 1679 | value 1 1680 | ] 1681 | edge 1682 | [ 1683 | source 69 1684 | target 27 1685 | value 2 1686 | ] 1687 | edge 1688 | [ 1689 | source 69 1690 | target 48 1691 | value 1 1692 | ] 1693 | edge 1694 | [ 1695 | source 69 1696 | target 41 1697 | value 1 1698 | ] 1699 | edge 1700 | [ 1701 | source 70 1702 | target 25 1703 | value 4 1704 | ] 1705 | edge 1706 | [ 1707 | source 70 1708 | target 69 1709 | value 4 1710 | ] 1711 | edge 1712 | [ 1713 | source 70 1714 | target 68 1715 | value 4 1716 | ] 1717 | edge 1718 | [ 1719 | source 70 1720 | target 11 1721 | value 1 1722 | ] 1723 | edge 1724 | [ 1725 | source 70 1726 | target 24 1727 | value 1 1728 | ] 1729 | edge 1730 | [ 1731 | source 70 1732 | target 27 1733 | value 1 1734 | ] 1735 | edge 1736 | [ 1737 | source 70 1738 | target 41 1739 | value 1 1740 | ] 1741 | edge 1742 | [ 1743 | source 70 1744 | target 58 1745 | value 1 1746 | ] 1747 | edge 1748 | [ 1749 | source 71 1750 | target 27 1751 | value 1 1752 | ] 1753 | edge 1754 | [ 1755 | source 71 1756 | target 69 1757 | value 2 1758 | ] 1759 | edge 1760 | [ 1761 | source 71 1762 | target 68 1763 | value 2 1764 | ] 1765 | edge 1766 | [ 1767 | source 71 1768 | target 70 1769 | value 2 1770 | ] 1771 | edge 1772 | [ 1773 | source 71 1774 | target 11 1775 | value 1 1776 | ] 1777 | edge 1778 | [ 1779 | source 71 1780 | target 48 1781 | value 1 1782 | ] 1783 | edge 1784 | [ 1785 | source 71 1786 | target 41 1787 | value 1 1788 | ] 1789 | edge 1790 | [ 1791 | source 71 1792 | target 25 1793 | value 1 1794 | ] 1795 | edge 1796 | [ 1797 | source 72 1798 | target 26 1799 | value 2 1800 | ] 1801 | edge 1802 | [ 1803 | source 72 1804 | target 27 1805 | value 1 1806 | ] 1807 | edge 1808 | [ 1809 | source 72 1810 | target 11 1811 | value 1 1812 | ] 1813 | edge 1814 | [ 1815 | source 73 1816 | target 48 1817 | value 2 1818 | ] 1819 | edge 1820 | [ 1821 | source 74 1822 | target 48 1823 | value 2 1824 | ] 1825 | edge 1826 | [ 1827 | source 74 1828 | target 73 1829 | value 3 1830 | ] 1831 | edge 1832 | [ 1833 | source 75 1834 | target 69 1835 | value 3 1836 | ] 1837 | edge 1838 | [ 1839 | source 75 1840 | target 68 1841 | value 3 1842 | ] 1843 | edge 1844 | [ 1845 | source 75 1846 | target 25 1847 | value 3 1848 | ] 1849 | edge 1850 | [ 1851 | source 75 1852 | target 48 1853 | value 1 1854 | ] 1855 | edge 1856 | [ 1857 | source 75 1858 | target 41 1859 | value 1 1860 | ] 1861 | edge 1862 | [ 1863 | source 75 1864 | target 70 1865 | value 1 1866 | ] 1867 | edge 1868 | [ 1869 | source 75 1870 | target 71 1871 | value 1 1872 | ] 1873 | edge 1874 | [ 1875 | source 76 1876 | target 64 1877 | value 1 1878 | ] 1879 | edge 1880 | [ 1881 | source 76 1882 | target 65 1883 | value 1 1884 | ] 1885 | edge 1886 | [ 1887 | source 76 1888 | target 66 1889 | value 1 1890 | ] 1891 | edge 1892 | [ 1893 | source 76 1894 | target 63 1895 | value 1 1896 | ] 1897 | edge 1898 | [ 1899 | source 76 1900 | target 62 1901 | value 1 1902 | ] 1903 | edge 1904 | [ 1905 | source 76 1906 | target 48 1907 | value 1 1908 | ] 1909 | edge 1910 | [ 1911 | source 76 1912 | target 58 1913 | value 1 1914 | ] 1915 | ] 1916 | -------------------------------------------------------------------------------- /inst/files/lesmis.net: -------------------------------------------------------------------------------- 1 | *Vertices 77 2 | 1 "Myriel" 3 | 2 "Napoleon" 4 | 3 "MlleBaptistine" 5 | 4 "MmeMagloire" 6 | 5 "CountessDeLo" 7 | 6 "Geborand" 8 | 7 "Champtercier" 9 | 8 "Cravatte" 10 | 9 "Count" 11 | 10 "OldMan" 12 | 11 "Labarre" 13 | 12 "Valjean" 14 | 13 "Marguerite" 15 | 14 "MmeDeR" 16 | 15 "Isabeau" 17 | 16 "Gervais" 18 | 17 "Tholomyes" 19 | 18 "Listolier" 20 | 19 "Fameuil" 21 | 20 "Blacheville" 22 | 21 "Favourite" 23 | 22 "Dahlia" 24 | 23 "Zephine" 25 | 24 "Fantine" 26 | 25 "MmeThenardier" 27 | 26 "Thenardier" 28 | 27 "Cosette" 29 | 28 "Javert" 30 | 29 "Fauchelevent" 31 | 30 "Bamatabois" 32 | 31 "Perpetue" 33 | 32 "Simplice" 34 | 33 "Scaufflaire" 35 | 34 "Woman1" 36 | 35 "Judge" 37 | 36 "Champmathieu" 38 | 37 "Brevet" 39 | 38 "Chenildieu" 40 | 39 "Cochepaille" 41 | 40 "Pontmercy" 42 | 41 "Boulatruelle" 43 | 42 "Eponine" 44 | 43 "Anzelma" 45 | 44 "Woman2" 46 | 45 "MotherInnocent" 47 | 46 "Gribier" 48 | 47 "Jondrette" 49 | 48 "MmeBurgon" 50 | 49 "Gavroche" 51 | 50 "Gillenormand" 52 | 51 "Magnon" 53 | 52 "MlleGillenormand" 54 | 53 "MmePontmercy" 55 | 54 "MlleVaubois" 56 | 55 "LtGillenormand" 57 | 56 "Marius" 58 | 57 "BaronessT" 59 | 58 "Mabeuf" 60 | 59 "Enjolras" 61 | 60 "Combeferre" 62 | 61 "Prouvaire" 63 | 62 "Feuilly" 64 | 63 "Courfeyrac" 65 | 64 "Bahorel" 66 | 65 "Bossuet" 67 | 66 "Joly" 68 | 67 "Grantaire" 69 | 68 "MotherPlutarch" 70 | 69 "Gueulemer" 71 | 70 "Babet" 72 | 71 "Claquesous" 73 | 72 "Montparnasse" 74 | 73 "Toussaint" 75 | 74 "Child1" 76 | 75 "Child2" 77 | 76 "Brujon" 78 | 77 "MmeHucheloup" 79 | *Edges 80 | 1 2 81 | 1 3 82 | 1 4 83 | 3 4 84 | 1 5 85 | 1 6 86 | 1 7 87 | 1 8 88 | 1 9 89 | 1 10 90 | 11 12 91 | 4 12 92 | 3 12 93 | 1 12 94 | 12 13 95 | 12 14 96 | 12 15 97 | 12 16 98 | 17 18 99 | 17 19 100 | 18 19 101 | 17 20 102 | 18 20 103 | 19 20 104 | 17 21 105 | 18 21 106 | 19 21 107 | 20 21 108 | 17 22 109 | 18 22 110 | 19 22 111 | 20 22 112 | 21 22 113 | 17 23 114 | 18 23 115 | 19 23 116 | 20 23 117 | 21 23 118 | 22 23 119 | 17 24 120 | 18 24 121 | 19 24 122 | 20 24 123 | 21 24 124 | 22 24 125 | 23 24 126 | 13 24 127 | 12 24 128 | 24 25 129 | 12 25 130 | 25 26 131 | 24 26 132 | 12 26 133 | 25 27 134 | 12 27 135 | 17 27 136 | 26 27 137 | 12 28 138 | 24 28 139 | 26 28 140 | 25 28 141 | 27 28 142 | 12 29 143 | 28 29 144 | 24 30 145 | 28 30 146 | 12 30 147 | 24 31 148 | 31 32 149 | 12 32 150 | 24 32 151 | 28 32 152 | 12 33 153 | 12 34 154 | 28 34 155 | 12 35 156 | 30 35 157 | 12 36 158 | 35 36 159 | 30 36 160 | 35 37 161 | 36 37 162 | 12 37 163 | 30 37 164 | 35 38 165 | 36 38 166 | 37 38 167 | 12 38 168 | 30 38 169 | 35 39 170 | 36 39 171 | 37 39 172 | 38 39 173 | 12 39 174 | 30 39 175 | 26 40 176 | 26 41 177 | 25 42 178 | 26 42 179 | 42 43 180 | 26 43 181 | 25 43 182 | 12 44 183 | 27 44 184 | 28 44 185 | 29 45 186 | 12 45 187 | 29 46 188 | 47 48 189 | 48 49 190 | 26 49 191 | 28 49 192 | 12 49 193 | 27 50 194 | 12 50 195 | 50 51 196 | 25 51 197 | 50 52 198 | 27 52 199 | 12 52 200 | 52 53 201 | 40 53 202 | 52 54 203 | 52 55 204 | 50 55 205 | 27 55 206 | 52 56 207 | 50 56 208 | 40 56 209 | 55 56 210 | 27 56 211 | 12 56 212 | 17 56 213 | 26 56 214 | 42 56 215 | 49 56 216 | 50 57 217 | 56 57 218 | 56 58 219 | 42 58 220 | 49 58 221 | 56 59 222 | 49 59 223 | 28 59 224 | 58 59 225 | 12 59 226 | 59 60 227 | 56 60 228 | 49 60 229 | 58 60 230 | 49 61 231 | 59 61 232 | 60 61 233 | 49 62 234 | 59 62 235 | 61 62 236 | 60 62 237 | 58 62 238 | 56 62 239 | 56 63 240 | 59 63 241 | 60 63 242 | 49 63 243 | 58 63 244 | 42 63 245 | 62 63 246 | 61 63 247 | 60 64 248 | 49 64 249 | 63 64 250 | 58 64 251 | 59 64 252 | 62 64 253 | 61 64 254 | 56 64 255 | 56 65 256 | 63 65 257 | 49 65 258 | 64 65 259 | 59 65 260 | 62 65 261 | 61 65 262 | 60 65 263 | 58 65 264 | 12 65 265 | 64 66 266 | 65 66 267 | 49 66 268 | 63 66 269 | 59 66 270 | 62 66 271 | 61 66 272 | 60 66 273 | 58 66 274 | 56 66 275 | 65 67 276 | 59 67 277 | 60 67 278 | 63 67 279 | 66 67 280 | 49 67 281 | 64 67 282 | 62 67 283 | 61 67 284 | 58 68 285 | 26 69 286 | 12 69 287 | 25 69 288 | 28 69 289 | 49 69 290 | 42 69 291 | 26 70 292 | 69 70 293 | 12 70 294 | 25 70 295 | 28 70 296 | 49 70 297 | 42 70 298 | 26 71 299 | 70 71 300 | 69 71 301 | 12 71 302 | 25 71 303 | 28 71 304 | 42 71 305 | 59 71 306 | 28 72 307 | 70 72 308 | 69 72 309 | 71 72 310 | 12 72 311 | 49 72 312 | 42 72 313 | 26 72 314 | 27 73 315 | 28 73 316 | 12 73 317 | 49 74 318 | 49 75 319 | 74 75 320 | 70 76 321 | 69 76 322 | 26 76 323 | 49 76 324 | 42 76 325 | 71 76 326 | 72 76 327 | 65 77 328 | 66 77 329 | 67 77 330 | 64 77 331 | 63 77 332 | 49 77 333 | 59 77 334 | -------------------------------------------------------------------------------- /inst/upgrade.R: -------------------------------------------------------------------------------- 1 | library(igraph, warn.conflicts = FALSE) 2 | 3 | upgrade <- function(x) { 4 | if (inherits(x, "igraph")) { 5 | upgrade_graph(x) 6 | } else { 7 | # foodwebs 8 | lapply(x, upgrade_graph) 9 | } 10 | } 11 | 12 | for (f in fs::dir_ls("data")) local({ 13 | load(f) 14 | print(ls()) 15 | assign(ls(), upgrade(get(ls()))) 16 | save(list = ls(), file = f, compress = "xz", version = 2) 17 | }) 18 | -------------------------------------------------------------------------------- /man/Koenigsberg.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Koenigsberg.R 3 | \docType{data} 4 | \name{Koenigsberg} 5 | \alias{Koenigsberg} 6 | \title{Bridges of Koenigsberg from Euler's times} 7 | \format{ 8 | An undirected \code{igraph} graph object with vertex attributes 9 | \sQuote{name} and \sQuote{Euler_letter}, the latter is the notation 10 | from Eulers original paper; and edge attributes \sQuote{name} (the name 11 | of the bridge) and \sQuote{Euler_letter}, again, Euler's notation 12 | from his paper. 13 | 14 | This dataset is in the public domain. 15 | } 16 | \source{ 17 | Wikipedia, 18 | \url{https://en.wikipedia.org/wiki/Seven_Bridges_of_K\%C3\%B6nigsberg} 19 | } 20 | \usage{ 21 | Koenigsberg 22 | } 23 | \description{ 24 | The Seven Bridges of Koenigsberg is a notable historical problem in 25 | mathematics. Its negative resolution by Leonhard Euler in 1735 laid 26 | the foundations of graph theory and presaged the idea of topology. 27 | 28 | The city of Koenigsberg in Prussia (now Kaliningrad, Russia) was set on 29 | both sides of the Pregel River, and included two large islands which 30 | were connected to each other and the mainland by seven bridges 31 | 32 | The problem was to find a walk through the city that would cross each 33 | bridge once and only once. The islands could not be reached by any route 34 | other than the bridges, and every bridge must have been crossed 35 | completely every time (one could not walk half way onto the bridge and 36 | then turn around and later cross the other half from the other side). 37 | 38 | Euler proved that the problem has no solution. 39 | } 40 | \references{ 41 | Leonhard Euler, “Solutio problematis ad geometriam situs pertinensis” 42 | Commentarii Academiae Scientarum Imperialis Petropolitanae, 8 (1736), 128–140 + Plate VIII. 43 | } 44 | \keyword{datasets} 45 | -------------------------------------------------------------------------------- /man/UKfaculty.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/UKfaculty.R 3 | \docType{data} 4 | \name{UKfaculty} 5 | \alias{UKfaculty} 6 | \title{Friendship network of a UK university faculty} 7 | \format{ 8 | A directed \code{igraph} graph object with vertex attribute 9 | \sQuote{Group}, the numeric id of the school affiliation, and edge 10 | attribute \sQuote{weight}, i.e. the graph is weighted. 11 | 12 | This dataset is licensed under a Creative Commons 13 | Attribution-Share Alike 2.0 UK: England & Wales License, 14 | see \url{http://creativecommons.org/licenses/by-sa/2.0/uk/} for details. 15 | Please cite the reference below if you use this dataset. 16 | } 17 | \source{ 18 | See reference below. 19 | } 20 | \usage{ 21 | UKfaculty 22 | } 23 | \description{ 24 | The personal friendship network of a faculty of a UK 25 | university, consisting of 81 vertices (individuals) and 817 directed 26 | and weighted connections. The school affiliation of each individual is 27 | stored as a vertex attribute. This dataset can serve as a testbed for 28 | community detection algorithms. 29 | } 30 | \references{ 31 | Nepusz T., Petroczi A., Negyessy L., Bazso F.: Fuzzy 32 | communities and the concept of bridgeness in complex 33 | networks. Physical Review E 77:016107, 2008. 34 | \doi{10.1103/PhysRevE.77.016107} 35 | } 36 | \keyword{datasets} 37 | -------------------------------------------------------------------------------- /man/USairports.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/USairports.R 3 | \docType{data} 4 | \name{USairports} 5 | \alias{USairports} 6 | \title{US airport network, 2010 December} 7 | \format{ 8 | A directed \code{igraph} graph object, with multiple edges. It has a 9 | \sQuote{name} graph attribute, and several vertex and edge 10 | attributes. The vertex attributes: 11 | \describe{ 12 | \item{name}{Symbolic vertex name, this is the three letter IATA 13 | airport code.} 14 | \item{City}{City and state, where the airport is located.} 15 | \item{Position}{Position of the airport, in WGS coordinates.} 16 | } 17 | 18 | Edge attributes: 19 | \describe{ 20 | \item{Carrier}{Name of the airline. The network includes both 21 | domestic and international carriers that performed at least one 22 | flight in December of 2010.} 23 | \item{Departures}{The number of departures (for a given airline and 24 | aircraft type.} 25 | \item{Seats}{The total number of seats available on the flights 26 | carried out by a given airline, using a given aircraft type.} 27 | \item{Passengers}{The total number of passangers on the flights 28 | carried out by a given airline, using a given aircraft type.} 29 | \item{Aircraft}{Type of the aircraft.} 30 | \item{Distance}{The distance between the two airports, in miles.} 31 | } 32 | } 33 | \source{ 34 | Most of this information was downloaded from The Research and 35 | Innovative Technology Administration (RITA). See 36 | \url{http://www.rita.dot.gov/about_rita/} for details. The airport 37 | position information was collected from Wikipedia and other public 38 | online sources. 39 | } 40 | \usage{ 41 | USairports 42 | } 43 | \description{ 44 | The network of passanger flights between airports in the United 45 | States. The data set was compiled based on flights in 2010 46 | December. This network is directed and edge directions correspond to 47 | flight directions. Each edge is specific to a single carrier aircraft 48 | type. Multiple carriers between the same two airports are denoted by 49 | multiple edges. 50 | 51 | See information about the included meta-data below. 52 | } 53 | \keyword{datasets} 54 | -------------------------------------------------------------------------------- /man/enron.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/enron.R 3 | \docType{data} 4 | \name{enron} 5 | \alias{enron} 6 | \title{Enron Email Network} 7 | \format{ 8 | A directed \code{igraph} graph object. 9 | 10 | Graph attributes: \itemize{ 11 | \item \sQuote{LDC_names} The names of the 32 LDC catagories the emails 12 | are classfied into by Michael W. Berry 13 | (\url{http://www.cis.jhu.edu/~parky/Enron/Anno_Topic_exp_LDC.pdf}) 14 | \item \sQuote{LDC_desc} Longer descriptions of the 32 LDC 15 | categories. 16 | \item \sQuote{Citation} Additionally, see also the references below. 17 | \item \sQuote{name} 18 | } 19 | 20 | Vertex attributes: \itemize{ 21 | \item \sQuote{Email} Email address. 22 | \item \sQuote{Name} Real name. 23 | \item \sQuote{Note} E.g. position at Enron. 24 | } 25 | 26 | Edge attributes: \itemize{ 27 | \item \sQuote{Time} When the email was sent. Note that some time 28 | labels are from 1979, these are certainly wrong and you might want 29 | to remove them before analyses that include time. 30 | \item \sQuote{Reciptype} Recipient type, \sQuote{to}, \sQuote{cc} or 31 | \sQuote{bcc}. 32 | \item \sQuote{Topic} Assigned based on 3-means clustering of 33 | randomly selected 3,120 out of all 125,409 messages, then NN 34 | classification for the whole corpus. Note that topic 0 means an 35 | outlier, e.g., too few words or all meaningless numbers in the 36 | message body. 37 | \item \sQuote{LDC_topic} Assigned based on Michael W. Berry's 2001 38 | \dQuote{Annotated (by Topic) Enron Email Data Set.} 39 | (\url{http://www.cis.jhu.edu/~parky/Enron/Anno_Topic_exp_LDC.pdf}) 40 | There are 32 topics. Topic "0" means an outlier, e.g., too few words 41 | or all meaningless numbers in the message body, etc. Topic "-1" 42 | means there is no matching topic. 43 | } 44 | } 45 | \source{ 46 | \url{http://www.cis.jhu.edu/~parky/Enron/} 47 | } 48 | \usage{ 49 | enron 50 | } 51 | \description{ 52 | An Enron email dataset has been made public by the U.S. Department of Justice. 53 | } 54 | \references{ 55 | C.E. Priebe, J.M. Conroy, D.J. Marchette, and Y. Park, 56 | Scan Statistics on Enron Graphs Computational and Mathematical 57 | Organization Theory, Volume 11, Number 3, p229 - 247, October 2005, 58 | Springer Science+Business Media B.V. \doi{10.1007/s10588-005-5378-z} 59 | 60 | C.E. Priebe, J.M. Conroy, D.J. Marchette, and Y. Park, 61 | Scan Statistics on Enron Graphs, SIAM International Conference on 62 | Data Mining, Workshop on Link Analysis, Counterterrorism and Security, 63 | Newport Beach, California, April 23, 2005. 64 | 65 | Gina Kolata, Enron Offers an Unlikely Boost to E-Mail Surveillance, 66 | New York Times, Week in Review, May 22, 2005. 67 | 68 | C.E. Priebe, Scan Statistics on Enron Graphs, IPAM Summer Graduate 69 | School: Intelligent Extraction of Information from Graphs and High 70 | Dimensional Data, UCLA, July 11-29, 2005. 71 | 72 | C.E. Priebe, Scan Statistics on Enron Graphs, 2005 Fall Department 73 | of Applied Mathematics and Statistics Seminars, September 15, 2005, 74 | The Johns Hopkins University. 75 | 76 | Y. Park, C.E. Priebe, D.J. Marchette, Scan Statistics on Enron 77 | Hypergraphs, Interface 2008, Durham, North Carolina, May 21, 2008, 78 | 79 | Y. Park, C.E. Priebe, D.J. Marchette, Anomaly Detection using Scan 80 | Statistics on Enron Graphs and Hypergraphs, The Satellite Workshop of 81 | the IASC 2008 Conference, Seoul, Korea, December 1-3, 2008. 82 | 83 | Y. Park, C.E. Priebe, D.J. Marchette, A. Youssef, Anomaly Detection 84 | using Scan Statistics on Time Series of Hypergraphs, Workshop on Link 85 | Analysis, Counterterrorism and Security at the SIAM International 86 | Conference on Data Mining, Sparks, Nevada, May 1-3, 2009, 87 | 88 | Y. Park, C.E. Priebe, A. Youssef, Anomaly Detection in Time Series of 89 | Graphs using Fusion of Invariants, Computational and Mathematical 90 | Organization Theory, submitted, 2010. \doi{10.1109/JSTSP.2012.2233712} 91 | } 92 | -------------------------------------------------------------------------------- /man/foodwebs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/foodweb.R 3 | \docType{data} 4 | \name{foodwebs} 5 | \alias{foodwebs} 6 | \title{A collection of food webs} 7 | \format{ 8 | A named list of directed \code{igraph} graph objects. Here are the 9 | list of the graphs included: 10 | \describe{ 11 | \item{\sQuote{ChesLower}}{Lower Chesapeake Bay in Summer. 12 | 13 | Reference: Hagy, J.D. (2002) Eutrophication, hypoxia and 14 | trophic transfer efficiency in Chesapeake Bay PhD Dissertation, 15 | University of Maryland at College Park (USA), 446 pp.} 16 | \item{\sQuote{ChesMiddle}}{Middle Chesapeake Bay in Summer. 17 | 18 | Reference: same as for \sQuote{ChesLower}.} 19 | \item{\sQuote{ChesUpper}}{Upper Chesapeake Bay in Summer. 20 | 21 | Reference: same as for \sQuote{ChesLower}.} 22 | \item{\sQuote{Chesapeake}}{Chesapeake Bay Mesohaline Network. 23 | 24 | Reference: Baird D. & Ulanowicz R.E. (1989) The seasonal dynamics 25 | of the Chesapeake Bay ecosystem. Ecological Monographs 59:329-364.} 26 | \item{\sQuote{CrystalC}}{Crystal River Creek (Control). 27 | 28 | Reference: Homer, M. and W.M. Kemp. Unpublished Ms. See also 29 | Ulanowicz, R.E. 1986. Growth and Development: Ecosystems 30 | Phenomenology. Springer, New York. pp 69-79.} 31 | \item{\sQuote{CrystalD}}{Crystal River Creek (Delta Temp). 32 | 33 | Reference: same as for \sQuote{CrystalD}.} 34 | \item{\sQuote{Maspalomas}}{Charca de Maspalomas. 35 | 36 | Reference: Almunia, J., G. Basterretxea, J. Aristegui, and 37 | R.E. Ulanowicz. (1999) Benthic- Pelagic switching in a coastal 38 | subtropical lagoon. Estuarine, Coastal and Shelf Science 39 | 49:363-384.} 40 | \item{\sQuote{Michigan}}{Lake Michigan Control network. 41 | 42 | Reference: Krause, A. and D. Mason. (In preparation.) A. Krause, 43 | PhD. Dissertation, Michigan State University. Ann Arbor, MI. USA.} 44 | \item{\sQuote{Mondego}}{Mondego Estuary - Zostrea site. 45 | 46 | Reference: Patricio, J. (In Preparation) Master's 47 | Thesis. University of Coimbra, Coimbra, Portugal.} 48 | \item{\sQuote{Narragan}}{Narragansett Bay Model. 49 | 50 | Reference: Monaco, M.E. and R.E. Ulanowicz. (1997) Comparative 51 | ecosystem trophic structure of three U.S. Mid-Atlantic 52 | estuaries. Mar. Ecol. Prog. Ser. 161:239-254.} 53 | \item{\sQuote{Rhode}}{Rhode River Watershed - Water Budget. 54 | 55 | Reference: Correll, D. (Unpublished manuscript) Smithsonian 56 | Institute, Chesapeake Bay Center for Environmental Research, 57 | Edgewater, Maryland 21037-0028 USA.} 58 | \item{\sQuote{StMarks}}{St. Marks River (Florida) Flow network. 59 | 60 | Reference: Baird, D., J. Luczkovich and R. R. Christian. (1998) 61 | Assessment of spatial and temporal variability in ecosystem 62 | attributes of the St Marks National Wildlife Refuge, Apalachee Bay, 63 | Florida. Estuarine, Coastal, and Shelf Science 47: 329-349.} 64 | \item{\sQuote{baydry}}{Florida Bay Trophic Exchange Matrix, dry season. 65 | 66 | Reference: Ulanowicz, R. E., C. Bondavalli, and 67 | M. S. Egnotovich. 1998. Network analysis of trophic dynamics in 68 | South Florida ecosystems, FY 97: the Florida Bay ecosystem. Annual 69 | Report to the United States Geological Service Biological Resources 70 | Division, University of Miami Coral Gables, [UM-CES] CBL 98-123, 71 | Maryland System Center for Environmental Science, Chesapeake 72 | Biological Laboratory, Maryland, USA.} 73 | \item{\sQuote{baywet}}{Florida Bay Trophic Exchange Matrix, wet season. 74 | 75 | Reference: same as for \sQuote{baydry}.} 76 | \item{\sQuote{cypdry}}{Cypress, dry season. 77 | 78 | Reference: Ulanowicz, R. E., C. Bondavalli, and 79 | M. S. Egnotovich. 1997. Network analysis of trophic dynamics in 80 | South Florida ecosystems, FY 96: the cypress wetland 81 | ecosystem. Annual Report to the United States Geological Service 82 | Biological Resources Division, University of Miami Coral Gables, 83 | [UM-CES] CBL 97-075, Maryland System Center for Environmental 84 | Science, Chesapeake Biological Laboratory.} 85 | \item{\sQuote{cypwet}}{Cypress, wet season. 86 | 87 | Reference: same as for \sQuote{cypdry}.} 88 | \item{\sQuote{gramdry}}{Everglades Graminoids - Dry Season. 89 | 90 | Reference: Ulanowicz, R. E., J. J. Heymans, and 91 | M. S. Egnotovich. 2000. Network analysis of trophic dynamics in 92 | South Florida ecosystems, FY 99: the graminoid ecosystem. Technical 93 | Report TS-191-99, Maryland System Center for Environmental Science, 94 | Chesapeake Biological Laboratory, Maryland, USA.} 95 | \item{\sQuote{gramwet}}{Everglades Graminoids - Wet Season. 96 | 97 | Reference: same as for \sQuote{gramdry}.} 98 | \item{\sQuote{mangdry}}{Mangrove Estuary, Dry Season. 99 | 100 | Reference: Ulanowicz, R. E., C. Bondavalli, J. J. Heymans, and 101 | M. S. Egnotovich. 1999. Network analysis of trophic dynamics in 102 | South Florida ecosystems, FY 98: the mangrove ecosystem. Technical 103 | Report TS-191-99, Maryland System Center for Environmental Science, 104 | Chesapeake Biological Laboratory, Maryland, USA.} 105 | \item{\sQuote{mangwet}}{Mangrove Estuary, Wet Season. 106 | 107 | Reference: same as for \sQuote{mangdry}.} 108 | } 109 | 110 | Each graph has the following vertex attributes: \sQuote{name} is the 111 | name of the species, \sQuote{ECO} is the type of the node, and 112 | integer value between one and five, meaning: 113 | \enumerate{ 114 | \item Living/producing compartment 115 | \item Other compartment 116 | \item Input 117 | \item Output 118 | \item Respiration. 119 | } 120 | The \sQuote{Biomass} vertex attribute contains the biomass of the 121 | species. 122 | 123 | Edges are weighted, and the weights denote energy flux between the 124 | species involved. 125 | 126 | The graphs also contain some informative graph attributes: 127 | \sQuote{Author}, \sQuote{Citation}, \sQuote{URL}, and 128 | \sQuote{name}. 129 | } 130 | \source{ 131 | See references for the individual webs above. The data itself 132 | was downloaded from 133 | \url{http://vlado.fmf.uni-lj.si/pub/networks/data/bio/foodweb/foodweb.htm}. 134 | } 135 | \usage{ 136 | foodwebs 137 | } 138 | \description{ 139 | A list of graphs. Each one is a food web, i.e. a directed 140 | graph of predator-prey relationships. 141 | } 142 | \references{ 143 | See them above. 144 | } 145 | \keyword{datasets} 146 | -------------------------------------------------------------------------------- /man/igraphdata-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/igraphdata-package.R 3 | \docType{package} 4 | \name{igraphdata-package} 5 | \alias{igraphdata} 6 | \alias{igraphdata-package} 7 | \title{igraphdata: A Collection of Network Data Sets for the 'igraph' Package} 8 | \description{ 9 | A small collection of various network data sets, to use with the 'igraph' package: the Enron email network, various food webs, interactions in the immunoglobulin protein, the karate club network, Koenigsberg's bridges, visuotactile brain areas of the macaque monkey, UK faculty friendship network, domestic US flights network, etc. Also provides access to the API of \url{https://networks.skewed.de/}. 10 | } 11 | \seealso{ 12 | Useful links: 13 | \itemize{ 14 | \item \url{http://igraph.org} 15 | \item Report bugs at \url{https://github.com/igraph/igraphdata/issues} 16 | } 17 | 18 | } 19 | \author{ 20 | \strong{Maintainer}: Kirill Müller \email{kirill@cynkra.com} (\href{https://orcid.org/0000-0002-1416-3412}{ORCID}) 21 | 22 | Authors: 23 | \itemize{ 24 | \item Gábor Csárdi (\href{https://orcid.org/0000-0001-7098-9676}{ORCID}) 25 | \item David Schoch (\href{https://orcid.org/0000-0003-2952-4812}{ORCID}) 26 | } 27 | 28 | Other contributors: 29 | \itemize{ 30 | \item Szabolcs Horvát (\href{https://orcid.org/0000-0002-3100-523X}{ORCID}) [contributor] 31 | \item Maëlle Salmon (\href{https://orcid.org/0000-0002-2815-0399}{ORCID}) [contributor] 32 | \item Chan Zuckerberg Initiative [funder] 33 | } 34 | 35 | } 36 | \keyword{internal} 37 | -------------------------------------------------------------------------------- /man/immuno.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/immuno.R 3 | \docType{data} 4 | \name{immuno} 5 | \alias{immuno} 6 | \title{Immunoglobulin interaction network} 7 | \format{ 8 | An undirected \code{igraph} graph object. 9 | 10 | Graph attributes: \sQuote{name}, \sQuote{Citation}, \sQuote{Author}. 11 | } 12 | \source{ 13 | See reference below. 14 | } 15 | \usage{ 16 | immuno 17 | } 18 | \description{ 19 | The undirected and connected network of interactions 20 | in the immunoglobulin protein. It is made up of 1316 vertices 21 | representing amino-acids and an edge is drawn between two 22 | amino-acids if the shortest distance between their C_alpha atoms 23 | is smaller than the threshold value \eqn{\theta=8}{theta=8} Angstrom. 24 | } 25 | \references{ 26 | D. Gfeller, Simplifying complex networks: from a clustering to a 27 | coarse graining strategy, \emph{PhD Thesis EPFL}, no 3888, 2007. 28 | \url{http://library.epfl.ch/theses/?nr=3888} 29 | } 30 | \keyword{datasets} 31 | -------------------------------------------------------------------------------- /man/karate.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/karate.R 3 | \docType{data} 4 | \name{karate} 5 | \alias{karate} 6 | \title{Zachary's karate club network} 7 | \format{ 8 | An undirected \code{igraph} graph object. Vertex no. 1 is Mr. Hi, 9 | vertex no. 34 corresponds to John A. 10 | 11 | Graph attributes: \sQuote{name}, \sQuote{Citation}, \sQuote{Author}. 12 | 13 | Vertex attributes: \sQuote{name}, \sQuote{Faction}, \sQuote{color} is 14 | the same as \sQuote{Faction}, \sQuote{label} are short labels for plotting. 15 | 16 | Edge attribute: \sQuote{weight}. 17 | } 18 | \source{ 19 | See reference below. 20 | } 21 | \usage{ 22 | karate 23 | } 24 | \description{ 25 | Social network between members of a university karate club, led by 26 | president John A. and karate instructor Mr. Hi (pseudonyms). 27 | 28 | The edge weights are the number of common activities the club 29 | members took part of. These activities were: 30 | \enumerate{ 31 | \item Association in and between academic classes at the university. 32 | \item Membership in Mr. Hi's private karate studio on the east side 33 | of the city where Mr. Hi taught nights as a part-time instructor. 34 | \item Membership in Mr. Hi's private karate studio on the east side 35 | of the city, where many of his supporters worked out on weekends. 36 | \item Student teaching at the east-side karate studio referred to in 37 | (2). This is different from (2) in that student teachers interacted 38 | with each other, but were prohibited from interacting with their 39 | students. 40 | \item Interaction at the university rathskeller, located in the same 41 | basement as the karate club's workout area. 42 | \item Interaction at a student-oriented bar located across the 43 | street from the university campus. 44 | \item Attendance at open karate tournaments held through the area at 45 | private karate studios. 46 | \item Attendance at intercollegiate karate tournaments held at local 47 | universities. Since both open and intercollegiate tournaments were 48 | held on Saturdays, attendance at both was impossible. 49 | } 50 | 51 | Zachary studied conflict and fission in this network, as the karate 52 | club was split into two separate clubs, after long disputes between 53 | two factions of the club, one led by John A., the other by Mr. Hi. 54 | 55 | The \sQuote{Faction} vertex attribute gives the faction memberships of 56 | the actors. After the split of the club, club members chose their 57 | new clubs based on their factions, except actor no. 9, who was in John 58 | A.'s faction but chose Mr. Hi's club. 59 | } 60 | \references{ 61 | Wayne W. Zachary. An Information Flow Model for Conflict and Fission 62 | in Small Groups. \emph{Journal of Anthropological Research} Vol. 33, 63 | No. 4 452-473 64 | } 65 | \keyword{datasets} 66 | -------------------------------------------------------------------------------- /man/kite.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/kite.R 3 | \docType{data} 4 | \name{kite} 5 | \alias{kite} 6 | \title{Krackhardt's kite} 7 | \format{ 8 | An undirected igraph graph with graph attributes \code{name}, 9 | \code{layout}, \code{Citation}, \code{Author}, \code{URL}, and vertex 10 | attributes \code{label}, \code{name} and \code{Firstname}. 11 | } 12 | \source{ 13 | \url{http://www.orgnet.com/sna.html} 14 | } 15 | \usage{ 16 | kite 17 | } 18 | \description{ 19 | Krackhardt's kite is a fictional social network with ten actors. 20 | It is a small (though not the smallest possible) graph for which the most 21 | central actors are different according to the three classic centrality 22 | measures: degree, closeness and betweenness. 23 | } 24 | \references{ 25 | Assessing the Political Landscape: Structure, Cognition, and Power in 26 | Organizations. David Krackhardt. \emph{Admin. Sci. Quart.} 35, 342-369, 27 | 1990. \doi{10.2307/2393394} 28 | } 29 | \keyword{datasets} 30 | -------------------------------------------------------------------------------- /man/lesmis.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/files.R 3 | \name{lesmis} 4 | \alias{lesmis} 5 | \alias{lesmis_gml} 6 | \alias{lesmis_graphml} 7 | \alias{lesmis_pajek} 8 | \title{Example files} 9 | \usage{ 10 | lesmis_gml() 11 | 12 | lesmis_graphml() 13 | 14 | lesmis_pajek() 15 | } 16 | \value{ 17 | A string indicating an absolute path to a file. 18 | } 19 | \description{ 20 | Functions that return paths to example files of the "Les Miserables" example network, 21 | in the GML, GraphML or Pajek format. 22 | } 23 | \references{ 24 | D. E. Knuth, The Stanford GraphBase: A Platform for Combinatorial Computing, Addison-Wesley, Reading, MA (1993). 25 | \url{https://www-cs-faculty.stanford.edu/~knuth/sgb.html} 26 | } 27 | -------------------------------------------------------------------------------- /man/macaque.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/macaque.R 3 | \docType{data} 4 | \name{macaque} 5 | \alias{macaque} 6 | \title{Visuotactile brain areas and connections} 7 | \format{ 8 | A directed \code{igraph} graph object with vertex attributes 9 | \sQuote{name} and \sQuote{shape}. 10 | 11 | This dataset is licensed under a Creative Commons 12 | Attribution-Share Alike 2.0 UK: England & Wales License, 13 | see \url{http://creativecommons.org/licenses/by-sa/2.0/uk/} for details. 14 | Please cite the reference below if you use this dataset. 15 | } 16 | \source{ 17 | See reference below. 18 | } 19 | \usage{ 20 | macaque 21 | } 22 | \description{ 23 | Graph model of the visuotactile brain areas and connections of the 24 | macaque monkey. The model consists of 45 areas and 463 directed 25 | connections. 26 | } 27 | \references{ 28 | Negyessy L., Nepusz T., Kocsis L., Bazso F.: Prediction of 29 | the main cortical areas and connections involved in the tactile 30 | function of the visual cortex by network analysis. \emph{European 31 | Journal of Neuroscience}, 23(7): 1919-1930, 2006. 32 | \doi{10.1111/j.1460-9568.2006.04678.x} 33 | } 34 | \keyword{datasets} 35 | -------------------------------------------------------------------------------- /man/netzschleuder.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/netzschleuder.R 3 | \name{ns_metadata} 4 | \alias{ns_metadata} 5 | \alias{ns_df} 6 | \alias{ns_graph} 7 | \title{Download and Convert Graph Data from Netzschleuder} 8 | \usage{ 9 | ns_metadata(name, collection = FALSE) 10 | 11 | ns_df(name, token = NULL, size_limit = 1) 12 | 13 | ns_graph(name, token = NULL, size_limit = 1) 14 | } 15 | \arguments{ 16 | \item{name}{Character. The name of the network dataset. To get a network from a collection, 17 | use the format \verb{/}.} 18 | 19 | \item{collection}{Logical. If TRUE, get the metadata of a whole collection of networks.} 20 | 21 | \item{token}{Character. Some networks have restricted access and require a token.} 22 | 23 | \item{size_limit}{Numeric. Maximum allowed file size in GB. Larger files will be prevented from being downloaded. 24 | See \url{https://networks.skewed.de/restricted}.} 25 | } 26 | \value{ 27 | \describe{ 28 | \item{\code{ns_metadata()}}{A list containing metadata for the dataset.} 29 | \item{\code{ns_df()}}{A named list with \code{nodes}, \code{edges}, \code{gprops}, and \code{meta}.} 30 | \item{\code{ns_graph()}}{An \code{igraph} object.} 31 | } 32 | } 33 | \description{ 34 | These functions provide tools to interact with the Netzschleuder network dataset archive. 35 | Netzschleuder (\url{https://networks.skewed.de/}) is a large online repository for network datasets, 36 | aimed at aiding scientific research. 37 | \describe{ 38 | \item{\code{ns_metadata()}}{ retrieves metadata about a network or network collection.} 39 | \item{\code{ns_df()}}{downloads the graph data as data frames (nodes, edges, and graph properties).} 40 | \item{\code{ns_graph()}}{creates an \code{igraph} object directly from Netzschleuder.} 41 | } 42 | } 43 | \examples{ 44 | \dontrun{ 45 | # Get metadata 46 | ns_metadata("copenhagen/calls") 47 | 48 | # Download network as data frames 49 | graph_data <- ns_df("copenhagen/calls") 50 | 51 | # Create an igraph object 52 | g <- ns_graph("copenhagen/calls") 53 | } 54 | 55 | } 56 | \seealso{ 57 | \url{https://networks.skewed.de/} 58 | } 59 | -------------------------------------------------------------------------------- /man/rfid.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rfid.R 3 | \docType{data} 4 | \name{rfid} 5 | \alias{rfid} 6 | \title{Hospital encounter network data} 7 | \format{ 8 | An igraph graph with graph attributes \sQuote{name} and 9 | \sQuote{Citation}, vertex attribute \sQuote{Status} and edge attribute 10 | \sQuote{Time}. 11 | 12 | \sQuote{Status} is the status of the person. Status codes: 13 | administrative staff (ADM), medical doctor (MED), paramedical staff, 14 | such as nurses or nurses' aides (NUR), and patients (PAT). 15 | 16 | \sQuote{Time} is the time of the encounter, it is the second when the 17 | 20 second encounter terminated. 18 | } 19 | \source{ 20 | See the reference below. 21 | Please cite it if you use this dataset in your work. 22 | } 23 | \usage{ 24 | rfid 25 | } 26 | \description{ 27 | Records of contacts among patients and various types of health care 28 | workers in the geriatric unit of a hospital in Lyon, France, in 29 | 2010, from 1pm on Monday, December 6 to 2pm on Friday, December 30 | 10. Each of the 75 people in this study consented to wear RFID 31 | sensors on small identification badges during this period, which made 32 | it possible to record when any two of them were in face-to-face 33 | contact with each other (i.e., within 1-1.5 m of each other) during 34 | a 20-second interval of time. 35 | } 36 | \references{ 37 | P. Vanhems, A. Barrat, C. Cattuto, J.-F. Pinton, N. Khanafer, 38 | C. Regis, B.-a. Kim, B. Comte, N. Voirin: Estimating potential 39 | infection transmission routes in hospital wards using wearable 40 | proximity sensors. PloS One 8(9), e73970 306 (2013). 41 | \doi{10.1371/journal.pone.0073970} 42 | } 43 | \keyword{datasets} 44 | -------------------------------------------------------------------------------- /man/yeast.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/yeast.R 3 | \docType{data} 4 | \name{yeast} 5 | \alias{yeast} 6 | \title{Yeast protein interaction network} 7 | \format{ 8 | An undirected \code{igraph} graph object. Its graph attributes: 9 | \sQuote{name}, \sQuote{Citation}, \sQuote{Author}, 10 | \sQuote{URL}. \sQuote{Classes}. The \sQuote{Classes} 11 | attribute contain the key for the classification labels of the 12 | proteins, in a data frame, the original MIPS categories are given 13 | after the semicolon: 14 | \describe{ 15 | \item{E}{energy production; energy} 16 | \item{G}{aminoacid metabolism; aminoacid metabolism} 17 | \item{M}{other metabolism; all remaining metabolism categories} 18 | \item{P}{translation; protein synthesis} 19 | \item{T}{transcription; transcription, but without subcategory 20 | \sQuote{transcriptional control}} 21 | \item{B}{transcriptional control; subcategory 22 | \sQuote{transcriptional control}} 23 | \item{F}{protein fate; protein fate (folding, modification, 24 | destination)} 25 | \item{O}{cellular organization; cellular transport and transport 26 | mechanisms} 27 | \item{A}{transport and sensing; categories \sQuote{transport 28 | facilitation} and \sQuote{regulation of / interaction with 29 | cellular environment}} 30 | \item{R}{stress and defense; cell rescue, defense and virulence} 31 | \item{D}{genome maintenance; DNA processing and cell cycle} 32 | \item{C}{cellular fate / organization; categories \sQuote{cell fate} 33 | and \sQuote{cellular communication / signal transduction} and 34 | \sQuote{control of cellular organization}} 35 | \item{U}{uncharacterized; categories \sQuote{not yet clear-cut} and 36 | \sQuote{uncharacterized}} 37 | } 38 | 39 | Vertex attributes: \sQuote{name}, \sQuote{Description}, 40 | \sQuote{Class}, the last one contains the class of the protein, 41 | accoring to the classification above. 42 | 43 | Note that some proteins in the network did not appear in the 44 | annotation files, the \sQuote{Class} and \sQuote{Description} 45 | attributes are \code{NA} for these. 46 | } 47 | \source{ 48 | The data was downloaded from 49 | \url{http://www.nature.com/nature/journal/v417/n6887/suppinfo/nature750.html}. 50 | } 51 | \usage{ 52 | yeast 53 | } 54 | \description{ 55 | Comprehensive protein-protein interaction maps promise to reveal many 56 | aspects of the complex regulatory network underlying cellular 57 | function. 58 | 59 | This data set was compiled by von Mering et al. (see reference below), 60 | combining various sources. Only the interactions that have 61 | \sQuote{high} and \sQuote{medium} confidence are included here. 62 | } 63 | \references{ 64 | Comparative assessment of large-scale data sets of protein-protein 65 | interactions. Christian von Mering, Roland Krause, Berend Snel, 66 | Michael Cornell, Stephen G. Oliver, Stanley Fields and Peer 67 | Bork. \emph{Nature} 417, 399-403 (2002) 68 | } 69 | \keyword{datasets} 70 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | # This file is part of the standard setup for testthat. 2 | # It is recommended that you do not modify it. 3 | # 4 | # Where should you do additional test configuration? 5 | # Learn more about the roles of various files in: 6 | # * https://r-pkgs.org/tests.html 7 | # * https://testthat.r-lib.org/reference/test_package.html#special-files 8 | 9 | library(testthat) 10 | library(igraphdata) 11 | 12 | test_check("igraphdata") 13 | -------------------------------------------------------------------------------- /tests/testthat/_snaps/data.md: -------------------------------------------------------------------------------- 1 | # Koenigsberg snapshot 2 | 3 | Code 4 | Koenigsberg 5 | Output 6 | IGRAPH UN-- 4 7 -- The seven bidges of Koenigsberg 7 | + attr: name (g/c), name (v/c), Euler_letter (v/c), Euler_letter (e/c), 8 | | name (e/c) 9 | + edges (vertex names): 10 | [1] Altstadt-Loebenicht--Kneiphof 11 | [2] Altstadt-Loebenicht--Kneiphof 12 | [3] Altstadt-Loebenicht--Lomse 13 | [4] Kneiphof --Lomse 14 | [5] Vorstadt-Haberberg --Lomse 15 | [6] Kneiphof --Vorstadt-Haberberg 16 | [7] Kneiphof --Vorstadt-Haberberg 17 | 18 | # UKfaculty snapshot 19 | 20 | Code 21 | UKfaculty 22 | Output 23 | IGRAPH D-W- 81 817 -- 24 | + attr: Type (g/c), Date (g/c), Citation (g/c), Author (g/c), Group 25 | | (v/n), weight (e/n) 26 | + edges: 27 | [1] 57->52 76->42 12->69 43->34 28->47 58->51 7->29 40->71 5->37 48->55 28 | [11] 6->58 21-> 8 28->69 43->21 67->58 65->42 5->67 52->75 37->64 4->36 29 | [21] 12->49 19->46 37-> 9 74->36 62-> 1 15-> 2 72->49 46->62 2->29 40->12 30 | [31] 22->29 71->69 4-> 3 37->69 5-> 6 77->13 23->49 52->35 20->14 62->70 31 | [41] 34->35 76->72 7->42 37->42 51->80 38->45 62->64 36->53 62->77 17->61 32 | [51] 7->68 46->29 44->53 18->58 12->16 72->42 52->32 58->21 38->17 15->51 33 | [61] 22-> 7 22->69 5->13 29-> 2 77->12 37->35 18->46 10->71 22->47 20->19 34 | + ... omitted several edges 35 | 36 | # USairports snapshot 37 | 38 | Code 39 | USairports 40 | Output 41 | IGRAPH DN-- 755 23473 -- US airports 42 | + attr: name (g/c), name (v/c), City (v/c), Position (v/c), Carrier 43 | | (e/c), Departures (e/n), Seats (e/n), Passengers (e/n), Aircraft 44 | | (e/n), Distance (e/n) 45 | + edges (vertex names): 46 | [1] BGR->JFK BGR->JFK BOS->EWR ANC->JFK JFK->ANC LAS->LAX MIA->JFK EWR->ANC 47 | [9] BJC->MIA MIA->BJC TEB->ANC JFK->LAX LAX->JFK LAX->SFO AEX->LAS BFI->SBA 48 | [17] ELM->PIT GEG->SUN ICT->PBI LAS->LAX LAS->PBI LAS->SFO LAX->LAS PBI->AEX 49 | [25] PBI->ICT PIT->VCT SFO->LAX VCT->DWH IAD->JFK ABE->CLT ABE->HPN AGS->CLT 50 | [33] AGS->CLT AVL->CLT AVL->CLT AVP->CLT AVP->PHL BDL->CLT BHM->CLT BHM->CLT 51 | [41] BNA->CLT BNA->CLT BNA->DCA BNA->PHL BTR->CLT BUF->CLT BUF->DCA BUF->PHL 52 | + ... omitted several edges 53 | 54 | # enron snapshot 55 | 56 | Code 57 | enron 58 | Output 59 | IGRAPH D--- 184 125409 -- Enron email network 60 | + attr: LDC_names (g/c), LDC_desc (g/c), name (g/c), Citation (g/c), 61 | | Email (v/c), Name (v/c), Note (v/c), Time (e/c), Reciptype (e/c), 62 | | Topic (e/n), LDC_topic (e/n) 63 | + edges: 64 | [1] 25->154 25->154 30-> 30 30-> 30 30-> 30 30-> 30 39-> 39 52-> 67 65 | [9] 52-> 67 52-> 67 52-> 67 61->100 61->100 61->163 61->163 61->166 66 | [17] 61->166 61->170 64-> 59 64-> 59 64-> 64 64-> 64 64->147 64->147 67 | [25] 64->164 64->164 64->168 66-> 66 66-> 66 67->129 67->129 67->129 68 | [33] 67->129 93-> 10 93-> 10 93-> 10 93-> 10 93-> 39 93-> 39 93-> 93 69 | [41] 93-> 93 93-> 93 93-> 93 93->124 93->124 100-> 61 100-> 61 115->115 70 | + ... omitted several edges 71 | 72 | # foodwebs snapshot 73 | 74 | Code 75 | foodwebs 76 | Output 77 | $ChesLower 78 | IGRAPH DNW- 37 178 -- Lower Chesapeake Bay in Summer 79 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 80 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 81 | + edges (vertex names): 82 | [1] Input ->Net Phytoplankton Input ->Picoplankton 83 | [3] Input ->Microphytobenthos Input ->SAV 84 | [5] Input ->Oysters Input ->Blue Crab 85 | [7] Input ->Herrings and Shads Input ->White Perch 86 | [9] Input ->Spot Input ->American eel 87 | [11] Input ->Catfish Input ->DOC 88 | [13] Input ->Sediment POC Oysters ->Output 89 | + ... omitted several edges 90 | 91 | $ChesMiddle 92 | IGRAPH DNW- 37 209 -- Middle Chesapeake Bay in Summer 93 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 94 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 95 | + edges (vertex names): 96 | [1] Input ->Net Phytoplankton Input ->Picoplankton 97 | [3] Input ->Microphytobenthos Input ->SAV 98 | [5] Input ->Deposit Feeding Benthos Input ->Suspension Feeding Benthos 99 | [7] Input ->Oysters Input ->Blue Crab 100 | [9] Input ->Herrings and Shads Input ->American eel 101 | [11] Input ->Sediment POC Oysters ->Output 102 | [13] Blue Crab->Output Menhaden ->Output 103 | + ... omitted several edges 104 | 105 | $ChesUpper 106 | IGRAPH DNW- 37 215 -- Upper Chesapeake Bay in Summer 107 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 108 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 109 | + edges (vertex names): 110 | [1] Input ->Net Phytoplankton Input ->Picoplankton 111 | [3] Input ->Microphytobenthos Input ->SAV 112 | [5] Input ->Oysters Input ->Blue Crab 113 | [7] Input ->American Eel Input ->DOC 114 | [9] Input ->Sediment POC Input ->POC 115 | [11] Oysters ->Output Blue Crab ->Output 116 | [13] Menhaden ->Output Bay anchovy->Output 117 | + ... omitted several edges 118 | 119 | $Chesapeake 120 | IGRAPH DNW- 39 177 -- Chesapeake Bay Mesohaline Network 121 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 122 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 123 | + edges (vertex names): 124 | [1] Input ->phytoplankton 125 | [2] Input ->benthic diatoms 126 | [3] Input ->dissolved organic carbon 127 | [4] Input ->suspended particulate org 128 | [5] zooplankton ->Output 129 | [6] mya arenaria ->Output 130 | [7] oysters ->Output 131 | + ... omitted several edges 132 | 133 | $CrystalC 134 | IGRAPH DNW- 24 125 -- Crystal River Creek (Control) 135 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 136 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 137 | + edges (vertex names): 138 | [1] Input ->macrophytes Input ->bay anchovy 139 | [3] Input ->needlefish Input ->gulf killifish 140 | [5] Input ->pinfish zooplankton ->Output 141 | [7] benthic invertebrates->Output blacktip shark ->Output 142 | [9] stingray ->Output striped anchovy ->Output 143 | [11] bay anchovy ->Output needlefish ->Output 144 | [13] sheepshead killifish ->Output goldspotted killifish->Output 145 | + ... omitted several edges 146 | 147 | $CrystalD 148 | IGRAPH DNW- 24 100 -- Crystal River Creek (Delta Temp) 149 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 150 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 151 | + edges (vertex names): 152 | [1] Input ->macrophytes Input ->pinfish 153 | [3] macrophytes ->Output zooplankton ->Output 154 | [5] benthic invertebrates->Output bay anchovy ->Output 155 | [7] catfish ->Output needlefish ->Output 156 | [9] goldspotted killifish->Output gulf killifish ->Output 157 | [11] longnosed killifish ->Output molly ->Output 158 | [13] silverside ->Output moharra ->Output 159 | + ... omitted several edges 160 | 161 | $Maspalomas 162 | IGRAPH DNW- 24 82 -- Charca de Maspalomas 163 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 164 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 165 | + edges (vertex names): 166 | [1] Input ->Cyanobacteria Input ->Eukaryotic Phyto 167 | [3] Input ->Chara globularis Input ->Ruppia Maritima 168 | [5] Input ->Cladophora Input ->Periphyton 169 | [7] Gallinula chloropus->Output DOC ->Output 170 | [9] Sedimented POC ->Output Cyanobacteria ->Respiration 171 | [11] Eukaryotic Phyto ->Respiration Chara globularis ->Respiration 172 | [13] Ruppia Maritima ->Respiration Cladophora ->Respiration 173 | + ... omitted several edges 174 | 175 | $Michigan 176 | IGRAPH DNW- 39 221 -- Lake Michigan Control network 177 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 178 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 179 | + edges (vertex names): 180 | [1] Input ->Flagellates Input ->Blue-greenGree 181 | [3] Input ->Diatoms Input ->Bythotrephes 182 | [5] Input ->Zebra mussels Bythotrephes ->Output 183 | [7] Zebra mussels ->Output Bloater ->Output 184 | [9] Rainbow smelt ->Output Slimy sculpin ->Output 185 | [11] Deepwater sculp->Output Lake Whitefish ->Output 186 | [13] Yellow perch ->Output Burbot ->Output 187 | + ... omitted several edges 188 | 189 | $Mondego 190 | IGRAPH DNW- 46 400 -- Mondego Estuary - Zostrea site 191 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 192 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 193 | + edges (vertex names): 194 | [1] Input ->Phytoplankton Input ->Enteromorpha sp 195 | [3] Input ->Ulva lactuca Input ->Zostera 196 | [5] Input ->Epiphytes Input ->Gracilaria 197 | [7] Input ->Macrofauna predators Input ->Larus ridibundus 198 | [9] Input ->Larus fuscus Detritus ->Output 199 | [11] Phytoplankton ->Respiration Enteromorpha sp->Respiration 200 | [13] Ulva lactuca ->Respiration Zostera ->Respiration 201 | + ... omitted several edges 202 | 203 | $Narragan 204 | IGRAPH DNW- 35 220 -- Narragansett Bay Model 205 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 206 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 207 | + edges (vertex names): 208 | [1] Input ->Benthic Alage Input ->Phytoplankton 209 | [3] Input ->Detritus Bluefish ->Output 210 | [5] Striped Bass ->Output Winter Flounder->Output 211 | [7] Windowpane ->Output Scup ->Output 212 | [9] Tautog ->Output Dogfish ->Output 213 | [11] Skates ->Output Longfin Squid ->Output 214 | [13] Butterfish ->Output Menhaden ->Output 215 | + ... omitted several edges 216 | 217 | $Rhode 218 | IGRAPH DNW- 20 53 -- Rhode River Watershed - Water Budget 219 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 220 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 221 | + edges (vertex names): 222 | [1] Input->crop land Input->pasture land 223 | [3] Input->upland forest Input->riparian forest adj. crop 224 | [5] Input->riparian forest adj. past Input->riparian forest adj. upla 225 | [7] Input->flooded swamp forest Input->herbaceous wetland 226 | [9] Input->floodplain forest Input->low marsh adj. north fork 227 | [11] Input->low marsh adj. main fork Input->muddy creek 228 | [13] Input->mud flat Input->high marsh 229 | + ... omitted several edges 230 | 231 | $StMarks 232 | IGRAPH DNW- 54 356 -- St. Marks River (Florida) Flow network 233 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 234 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 235 | + edges (vertex names): 236 | [1] Input->Phytoplankton Input->Halodule 237 | [3] Input->Micro-epiphytes Input->Macro-epiphytes 238 | [5] Input->Benthic algae Input->Zooplankton 239 | [7] Input->Epiphyte-graz amphipods Input->suspension-feed molluscs 240 | [9] Input->Suspension-feed polychts Input->Benthic bact 241 | [11] Input->Microfauna Input->Deposit feed amphipods 242 | [13] Input->Herbivorous shrimp Input->Deposit-feed gastropod 243 | + ... omitted several edges 244 | 245 | $baydry 246 | IGRAPH DNW- 128 2137 -- Florida Bay Trophic Exchange Matrix, dry season 247 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 248 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 249 | + edges (vertex names): 250 | [1] Input->2um Spherical Phytoplankt Input->Synedococcus 251 | [3] Input->Oscillatoria Input->Small Diatoms (<20um) 252 | [5] Input->Big Diatoms (>20um) Input->Dinoflagellates 253 | [7] Input->Other Phytoplankton Input->Benthic Phytoplankton 254 | [9] Input->Thalassia Input->Halodule 255 | [11] Input->Syringodium Input->Roots 256 | [13] Input->Drift Algae Input->Epiphytes 257 | + ... omitted several edges 258 | 259 | $baywet 260 | IGRAPH DNW- 128 2106 -- Florida Bay Trophic Exchange Matrix, wet season 261 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 262 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 263 | + edges (vertex names): 264 | [1] Input->2um Spherical Phytoplankt Input->Synedococcus 265 | [3] Input->Oscillatoria Input->Small Diatoms (<20um) 266 | [5] Input->Big Diatoms (>20um) Input->Dinoflagellates 267 | [7] Input->Other Phytoplankton Input->Benthic Phytoplankton 268 | [9] Input->Thalassia Input->Halodule 269 | [11] Input->Syringodium Input->Roots 270 | [13] Input->Drift Algae Input->Epiphytes 271 | + ... omitted several edges 272 | 273 | $cypdry 274 | IGRAPH DNW- 71 640 -- Cypress Dry Season 275 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 276 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 277 | + edges (vertex names): 278 | [1] Input->Living POC Input->Phytoplankton 279 | [3] Input->Float. vegetation Input->Periphyton/Macroalgae 280 | [5] Input->Macrophytes Input->Epiphytes 281 | [7] Input->Understory Input->Vine Leaves 282 | [9] Input->Hardwoods Leaves Input->Cypress Leaves 283 | [11] Input->Cypress Wood Input->HW Wood 284 | [13] Input->Roots Input->Egrets 285 | + ... omitted several edges 286 | 287 | $cypwet 288 | IGRAPH DNW- 71 631 -- Cypress Wet Season 289 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 290 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 291 | + edges (vertex names): 292 | [1] Input->Living POC Input->Phytoplankton Input->Float Veg. 293 | [4] Input->Periphyton Input->Macrophytes Input->Epiphytes 294 | [7] Input->Understory Input->Vine L Input->Hardwood L 295 | [10] Input->Cypress L Input->Cypress W Input->Hardwood W 296 | [13] Input->Roots Input->Egrets Input->GB Heron 297 | [16] Input->Other Herons Input->Wood stork Input->White ibis 298 | [19] Input->Refractory Det. Input->Liable Det. 299 | + ... omitted several edges 300 | 301 | $gramdry 302 | IGRAPH DNW- 69 915 -- Everglades Graminoids - Dry Season 303 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 304 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 305 | + edges (vertex names): 306 | [1] Input ->Periphyton Input ->Macrophytes 307 | [3] Input ->Utricularia Input ->Floating Veg. 308 | [5] Input ->Lizards Apple snail ->Output 309 | [7] Freshwater Prawn ->Output Mesoinverts ->Output 310 | [9] Other Macroinverts ->Output Large Aquatic Insects->Output 311 | [11] Gar ->Output Shiners & Minnows ->Output 312 | [13] Chubsuckers ->Output Catfish ->Output 313 | + ... omitted several edges 314 | 315 | $gramwet 316 | IGRAPH DNW- 69 916 -- Everglades Graminoids - Wet Season 317 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 318 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 319 | + edges (vertex names): 320 | [1] Input ->Periphyton Input ->Macrophytes 321 | [3] Input ->Utricularia Input ->Floating Veg. 322 | [5] Input ->Lizards Living POC ->Output 323 | [7] Apple snail ->Output Freshwater Prawn ->Output 324 | [9] Mesoinverts ->Output Other Macroinverts ->Output 325 | [11] Large Aquatic Insects->Output Gar ->Output 326 | [13] Shiners & Minnows ->Output Chubsuckers ->Output 327 | + ... omitted several edges 328 | 329 | $mangdry 330 | IGRAPH DNW- 97 1491 -- Mangrove Estuary, Dry Season 331 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 332 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 333 | + edges (vertex names): 334 | [1] Input->PHY Input->OTH. PP Input->LEAF Input->WOOD 335 | [5] Input->ROOT Input->MERO Input->L & G Input->PELC 336 | [9] Input->CORM Input->BH & E Input->SE & E Input->IBIS 337 | [13] Input->DUCK1 Input->DUCK2 Input->DUCK3 Input->VULT 338 | [17] Input->K & H Input->MRAPT Input->GUIF Input->SSBIRDS 339 | [21] Input->G & T Input->C & C Input->OWLS Input->WOODP 340 | [25] Input->PASSOMN Input->PASSPERD Input->POC Input->DOC 341 | + ... omitted several edges 342 | 343 | $mangwet 344 | IGRAPH DNW- 97 1492 -- Mangrove Estuary, Wet Season 345 | + attr: Citation (g/c), Author (g/c), URL (g/c), name (g/c), name 346 | | (v/c), ECO (v/n), Biomass (v/n), weight (e/n) 347 | + edges (vertex names): 348 | [1] Input->PHY Input->OTH. PP Input->LEAF Input->WOOD 349 | [5] Input->ROOT Input->MERO Input->L & G Input->PELC 350 | [9] Input->CORM Input->BH & E Input->SE & E Input->IBIS 351 | [13] Input->DUCK1 Input->DUCK2 Input->DUCK3 Input->VULT 352 | [17] Input->K & H Input->MRAPT Input->GUIF Input->SSBIRDS 353 | [21] Input->G & T Input->C & C Input->OWLS Input->WOODP 354 | [25] Input->PASSOMN Input->PASSPERD Input->POC Input->DOC 355 | + ... omitted several edges 356 | 357 | 358 | # immuno snapshot 359 | 360 | Code 361 | immuno 362 | Output 363 | IGRAPH U--- 1316 6300 -- immunoglobuline network 364 | + attr: name (g/c), Citation (g/c), Author (g/c) 365 | + edges: 366 | [1] 1-- 2 1-- 3 1-- 94 1-- 95 1-- 97 2-- 3 2-- 4 2-- 25 2-- 26 367 | [10] 2-- 27 2-- 97 3-- 4 3-- 5 3-- 25 3-- 26 3-- 97 3-- 98 3-- 99 368 | [19] 4-- 5 4-- 6 4-- 23 4-- 24 4-- 25 4-- 26 4-- 88 4-- 89 4-- 90 369 | [28] 4-- 97 4-- 98 4-- 99 4--100 5-- 6 5-- 7 5-- 23 5-- 24 5-- 25 370 | [37] 5-- 99 5--100 6-- 7 6-- 8 6-- 9 6-- 21 6-- 22 6-- 23 6-- 24 371 | [46] 6-- 87 6-- 88 6-- 99 6--100 6--101 6--102 7-- 8 7-- 9 7-- 21 372 | [55] 7-- 22 7-- 23 7--101 7--102 8-- 9 8-- 10 8-- 11 8-- 21 8-- 22 373 | [64] 8--102 9-- 10 9-- 11 9--101 9--102 9--103 10-- 11 10-- 12 10--102 374 | + ... omitted several edges 375 | 376 | # karate snapshot 377 | 378 | Code 379 | karate 380 | Output 381 | IGRAPH UNW- 34 78 -- Zachary's karate club network 382 | + attr: name (g/c), Citation (g/c), Author (g/c), Faction (v/n), name 383 | | (v/c), label (v/c), color (v/n), weight (e/n) 384 | + edges (vertex names): 385 | [1] Mr Hi --Actor 2 Mr Hi --Actor 3 Mr Hi --Actor 4 Mr Hi --Actor 5 386 | [5] Mr Hi --Actor 6 Mr Hi --Actor 7 Mr Hi --Actor 8 Mr Hi --Actor 9 387 | [9] Mr Hi --Actor 11 Mr Hi --Actor 12 Mr Hi --Actor 13 Mr Hi --Actor 14 388 | [13] Mr Hi --Actor 18 Mr Hi --Actor 20 Mr Hi --Actor 22 Mr Hi --Actor 32 389 | [17] Actor 2--Actor 3 Actor 2--Actor 4 Actor 2--Actor 8 Actor 2--Actor 14 390 | [21] Actor 2--Actor 18 Actor 2--Actor 20 Actor 2--Actor 22 Actor 2--Actor 31 391 | [25] Actor 3--Actor 4 Actor 3--Actor 8 Actor 3--Actor 9 Actor 3--Actor 10 392 | + ... omitted several edges 393 | 394 | # kite snapshot 395 | 396 | Code 397 | kite 398 | Output 399 | IGRAPH UN-- 10 18 -- Krackhardt's kite 400 | + attr: name (g/c), layout (g/n), Citation (g/c), Author (g/c), URL 401 | | (g/c), label (v/c), Firstname (v/c), name (v/c) 402 | + edges (vertex names): 403 | [1] A--B A--C A--D A--F B--D B--E B--G C--D C--F D--E D--F D--G E--G F--G F--H 404 | [16] G--H H--I I--J 405 | 406 | # macaque snapshot 407 | 408 | Code 409 | macaque 410 | Output 411 | IGRAPH DN-- 45 463 -- 412 | + attr: Citation (g/c), Author (g/c), shape (v/c), name (v/c) 413 | + edges (vertex names): 414 | [1] V1 ->V2 V1 ->V3 V1 ->V3A V1 ->V4 V1 ->V4t V1 ->MT 415 | [7] V1 ->PO V1 ->PIP V2 ->V1 V2 ->V3 V2 ->V3A V2 ->V4 416 | [13] V2 ->V4t V2 ->VOT V2 ->VP V2 ->MT V2 ->MSTd/p V2 ->MSTl 417 | [19] V2 ->PO V2 ->PIP V2 ->VIP V2 ->FST V2 ->FEF V3 ->V1 418 | [25] V3 ->V2 V3 ->V3A V3 ->V4 V3 ->V4t V3 ->MT V3 ->MSTd/p 419 | [31] V3 ->PO V3 ->LIP V3 ->PIP V3 ->VIP V3 ->FST V3 ->TF 420 | [37] V3 ->FEF V3A->V1 V3A->V2 V3A->V3 V3A->V4 V3A->VP 421 | [43] V3A->MT V3A->MSTd/p V3A->MSTl V3A->PO V3A->LIP V3A->DP 422 | + ... omitted several edges 423 | 424 | # rfid snapshot 425 | 426 | Code 427 | rfid 428 | Output 429 | IGRAPH U--- 75 32424 -- RFID hospital encounter network 430 | + attr: name (g/c), Citation (g/c), Status (v/c), Time (e/n) 431 | + edges: 432 | [1] 15--31 15--22 15--16 15--16 16--22 16--22 16--22 16--22 16--22 11--16 433 | [11] 11--22 11--22 11--22 11--22 11--22 11--22 11--22 11--22 11--22 11--22 434 | [21] 11--22 15--16 11--22 11--16 15--16 11--16 15--16 11--16 11--16 14--22 435 | [31] 14--22 14--22 3--37 3--37 15--22 15--22 15--22 3--37 3--37 5--37 436 | [41] 3--37 3-- 6 3--37 5-- 7 5-- 7 5--37 1--20 3-- 5 3--37 1--17 437 | [51] 3--37 8--17 17--37 31--37 3--37 5--17 8--17 8--37 5--31 8--17 438 | [61] 5--31 6--37 23--31 5--31 8--17 5--23 23--37 10--13 5--31 1-- 6 439 | [71] 8--17 5--37 23--37 8--23 17--23 8--17 23--37 8--23 17--37 17--23 440 | + ... omitted several edges 441 | 442 | # yeast snapshot 443 | 444 | Code 445 | yeast 446 | Output 447 | IGRAPH UN-- 2617 11855 -- Yeast protein interactions, von Mering et al. 448 | + attr: name (g/c), Citation (g/c), Author (g/c), URL (g/c), Classes 449 | | (g/x), name (v/c), Class (v/c), Description (v/c), Confidence (e/c) 450 | + edges (vertex names): 451 | [1] YLR197W--YDL014W YOR039W--YOR061W YDR473C--YPR178W YOR332W--YLR447C 452 | [5] YER090W--YKL211C YDR394W--YGR232W YER021W--YPR108W YPR029C--YKL135C 453 | [9] YIL106W--YGR092W YKL166C--YIL033C YGL026C--YKL211C YOR061W--YGL019W 454 | [13] YGL115W--YER027C YGL049C--YGR162W YDR394W--YOR117W YDL140C--YML010W 455 | [17] YLR291C--YKR026C YGR158C--YDL111C YDR328C--YDL132W YOL094C--YNL290W 456 | [21] YDR460W--YPR025C YBR154C--YOR341W YBR154C--YOR116C YIL062C--YKL013C 457 | [25] YBR154C--YOR207C YBR154C--YPR010C YER027C--YDR477W YLR291C--YGR083C 458 | + ... omitted several edges 459 | 460 | -------------------------------------------------------------------------------- /tests/testthat/test-data.R: -------------------------------------------------------------------------------- 1 | test_that("Koenigsberg snapshot", { 2 | # Side effect: load package 3 | skip_if_not_installed("igraph") 4 | 5 | data(Koenigsberg, package = "igraphdata") 6 | old <- igraph::igraph_options(print.id = FALSE) 7 | on.exit(do.call(igraph::igraph_options, old)) 8 | expect_snapshot({ 9 | Koenigsberg 10 | }) 11 | }) 12 | 13 | test_that("UKfaculty snapshot", { 14 | # Side effect: load package 15 | skip_if_not_installed("igraph") 16 | 17 | data(UKfaculty, package = "igraphdata") 18 | old <- igraph::igraph_options(print.id = FALSE) 19 | on.exit(do.call(igraph::igraph_options, old)) 20 | expect_snapshot({ 21 | UKfaculty 22 | }) 23 | }) 24 | 25 | test_that("USairports snapshot", { 26 | # Side effect: load package 27 | skip_if_not_installed("igraph") 28 | 29 | data(USairports, package = "igraphdata") 30 | old <- igraph::igraph_options(print.id = FALSE) 31 | on.exit(do.call(igraph::igraph_options, old)) 32 | expect_snapshot({ 33 | USairports 34 | }) 35 | }) 36 | 37 | test_that("enron snapshot", { 38 | # Side effect: load package 39 | skip_if_not_installed("igraph") 40 | 41 | data(enron, package = "igraphdata") 42 | old <- igraph::igraph_options(print.id = FALSE) 43 | on.exit(do.call(igraph::igraph_options, old)) 44 | expect_snapshot({ 45 | enron 46 | }) 47 | }) 48 | 49 | test_that("foodwebs snapshot", { 50 | # Side effect: load package 51 | skip_if_not_installed("igraph") 52 | 53 | data(foodwebs, package = "igraphdata") 54 | old <- igraph::igraph_options(print.id = FALSE) 55 | on.exit(do.call(igraph::igraph_options, old)) 56 | expect_snapshot({ 57 | foodwebs 58 | }) 59 | }) 60 | 61 | test_that("immuno snapshot", { 62 | # Side effect: load package 63 | skip_if_not_installed("igraph") 64 | 65 | data(immuno, package = "igraphdata") 66 | old <- igraph::igraph_options(print.id = FALSE) 67 | on.exit(do.call(igraph::igraph_options, old)) 68 | expect_snapshot({ 69 | immuno 70 | }) 71 | }) 72 | 73 | test_that("karate snapshot", { 74 | # Side effect: load package 75 | skip_if_not_installed("igraph") 76 | 77 | data(karate, package = "igraphdata") 78 | old <- igraph::igraph_options(print.id = FALSE) 79 | on.exit(do.call(igraph::igraph_options, old)) 80 | expect_snapshot({ 81 | karate 82 | }) 83 | }) 84 | 85 | test_that("kite snapshot", { 86 | # Side effect: load package 87 | skip_if_not_installed("igraph") 88 | 89 | data(kite, package = "igraphdata") 90 | old <- igraph::igraph_options(print.id = FALSE) 91 | on.exit(do.call(igraph::igraph_options, old)) 92 | expect_snapshot({ 93 | kite 94 | }) 95 | }) 96 | 97 | test_that("macaque snapshot", { 98 | # Side effect: load package 99 | skip_if_not_installed("igraph") 100 | 101 | data(macaque, package = "igraphdata") 102 | old <- igraph::igraph_options(print.id = FALSE) 103 | on.exit(do.call(igraph::igraph_options, old)) 104 | expect_snapshot({ 105 | macaque 106 | }) 107 | }) 108 | 109 | test_that("rfid snapshot", { 110 | # Side effect: load package 111 | skip_if_not_installed("igraph") 112 | 113 | data(rfid, package = "igraphdata") 114 | old <- igraph::igraph_options(print.id = FALSE) 115 | on.exit(do.call(igraph::igraph_options, old)) 116 | expect_snapshot({ 117 | rfid 118 | }) 119 | }) 120 | 121 | test_that("yeast snapshot", { 122 | # Side effect: load package 123 | skip_if_not_installed("igraph") 124 | 125 | data(yeast, package = "igraphdata") 126 | old <- igraph::igraph_options(print.id = FALSE) 127 | on.exit(do.call(igraph::igraph_options, old)) 128 | expect_snapshot({ 129 | yeast 130 | }) 131 | }) 132 | -------------------------------------------------------------------------------- /tests/testthat/test-files.R: -------------------------------------------------------------------------------- 1 | test_that("paths return a string", { 2 | expect_type(lesmis_gml(), "character") 3 | expect_length(lesmis_gml(), 1) 4 | expect_type(lesmis_graphml(), "character") 5 | expect_length(lesmis_graphml(), 1) 6 | expect_type(lesmis_pajek(), "character") 7 | expect_length(lesmis_pajek(), 1) 8 | }) 9 | --------------------------------------------------------------------------------