Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
50a8fd6
#1 cidadeciclavel.mubi.pt reviews accidental commit
gmatosferreira May 15, 2026
3c97af7
#1 package creation kick-off
gmatosferreira Aug 5, 2026
0065be0
#1 methods to retrieve ODs from INE Census API
gmatosferreira Aug 5, 2026
0d66d3b
#1 methods to retrieve ODs from INE Census API
gmatosferreira Aug 5, 2026
57ff015
#1 methods to retrieve tools costs from Infraestruturas de Portugal
gmatosferreira Aug 5, 2026
30c2b6c
#1 methods to retrieve postal code European db and coordinates
gmatosferreira Aug 5, 2026
cd4f6e2
#1 package docs
gmatosferreira Aug 5, 2026
8b729d4
#1 devtools::check to prepare release
gmatosferreira Aug 5, 2026
5493d26
#1 github actions set up
gmatosferreira Aug 5, 2026
8fdb515
#1 devtools::check to prepare release
gmatosferreira Aug 5, 2026
1482fcd
#1 CITATION
gmatosferreira Aug 5, 2026
30291b5
#1 LICENSE
gmatosferreira Aug 5, 2026
e9a178d
#1 devtools::check to prepare release
gmatosferreira Aug 5, 2026
739d863
#1 tests and examples passing if offline to avoid build checks failur…
gmatosferreira Aug 6, 2026
70209a9
#1 tests and examples passing if offline to avoid build checks failur…
gmatosferreira Aug 6, 2026
e33fc77
#1 tests and examples passing if offline to avoid build checks failur…
gmatosferreira Aug 6, 2026
e6aca13
#1 tests and examples passing if offline to avoid build checks failur…
gmatosferreira Aug 6, 2026
e76b587
#1 tools costs from Infraestruturas de Portugal realistic example
gmatosferreira Aug 6, 2026
4f27ee8
#1 ine.pt timeout increase
gmatosferreira Aug 6, 2026
f8e8b17
#1 tools costs from Infraestruturas de Portugal returning named list
gmatosferreira Aug 6, 2026
0abd508
#1 data sources refactoring to improve legibility
gmatosferreira Aug 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
^MobilityDataPT\.Rproj$
^\.Rproj\.user$
^docs$
^pkgdown$
^experiments$
^vignettes/articles$
^_pkgdown\.yml$
^\.github$
LICENSE.md
CITATION.cff
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
51 changes: 51 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:

name: R-CMD-check.yaml

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
50 changes: 50 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:
release:
types: [published]
workflow_dispatch:

name: pkgdown.yaml

permissions: read-all

jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
MOBILITY_DATABASE: ${{ secrets.MOBILITY_DATABASE }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
folder: docs
105 changes: 105 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
pull_request:
branches: [main, master]

name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
MOBILITY_DATABASE: ${{ secrets.MOBILITY_DATABASE }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
# testthat is Suggests (optional) in DESCRIPTION so it is not
# guaranteed to be installed automatically — list it explicitly.
extra-packages: any::covr, any::xml2, any::testthat, local::.
needs: coverage

- name: Run tests and compute coverage
run: |
install_path <- file.path(
normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package"
)

# Helper: print the .Rout.fail file so the actual test error is visible
# in the CI log instead of just a path reference.
dump_rout_fail <- function() {
fail_files <- list.files(install_path, pattern = "\\.Rout\\.fail$",
recursive = TRUE, full.names = TRUE)
if (length(fail_files) == 0) {
message("No .Rout.fail file found.")
return(invisible(NULL))
}
for (f in fail_files) {
message("\n========== ", basename(f), " ==========")
cat(readLines(f, warn = FALSE), sep = "\n")
message("============================================\n")
}
}

cov <- tryCatch(
covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = install_path
),
error = function(e) {
message("\n--- Test suite failed. Dumping .Rout.fail for diagnosis ---\n")
dump_rout_fail()
stop(e) # re-throw so the job still fails
}
)

# Print summary to the log
print(cov)

# Generate Cobertura XML report for Codecov upload
covr::to_cobertura(cov, filename = "coverage.xml")

# Compute total coverage percentage and write to GITHUB_ENV
pct <- covr::percent_coverage(cov)
message("Total coverage: ", round(pct, 2), "%")
writeLines(paste0("COVERAGE_PCT=", round(pct, 2)), Sys.getenv("GITHUB_ENV"))
shell: Rscript {0}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false # don't fail the PR if Codecov is unreachable

- name: Upload Cobertura XML as workflow artifact
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage.xml

- name: Enforce minimum coverage threshold
run: |
pct <- as.numeric(Sys.getenv("COVERAGE_PCT"))
threshold <- 0 # Set your desired minimum coverage % here (e.g. 60)
if (!is.na(pct) && pct < threshold) {
stop(paste0(
"Coverage (", round(pct, 2), "%) is below the required threshold of ",
threshold, "%."
))
} else {
message("Coverage check passed: ", round(pct, 2), "%")
}
shell: Rscript {0}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.Rproj.user
*.html
database/*
*cache/
docs/*
17 changes: 17 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: MobilityDataPT
message: 'If you use this software, please cite it as below.'
type: software
authors:
- family-names: Matos
given-names: Gonçalo F.
orcid: 'https://orcid.org/0009-0001-3489-1732'
repository-code: 'https://github.com/U-Shift/MobilityDataPT'
url: 'https://u-shift.github.io/MobilityDataPT/'
abstract: 'This package provides a collection of methods to get mobility related data for Portugal.'
license: GPL-3.0
version: '0.0'
date-released: '2026-08-05'
27 changes: 27 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Package: MobilityDataPT
Title: Get mobility related data for Portugal
Version: 0.0
Authors@R:
person(c("Gonçalo", "F."), "Matos", , "goncaloafmatos@tecnico.pt", role = c("aut", "cre"),
comment = c(ORCID = "0009-0001-3489-1732"))
Description: This package provides a collection of methods to get mobility related data for Portugal.
License: GPL
URL: https://github.com/U-Shift/MobilityDataPT,
https://u-shift.github.io/MobilityDataPT/
Depends:
R (>= 4.1.0)
Imports:
dplyr,
tidyselect,
httr,
jsonlite,
sf
Suggests:
curl,
spelling,
testthat,
withr
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.3
Loading
Loading