Get Data from the Swiss Federal Statistical Office
Overview
Search and download data from the Swiss Federal Statistical Office (BFS) APIs https://www.bfs.admin.ch/.
- wrap the network-dependent examples of
bfs_get_sse_data()andbfs_get_sse_metadata()in\donttest{}to avoid CRAN/CI check failures when the Swiss Stats Explorer API is unreachable or times out.
From NEWS.md in the release
Install
Health
ERRORtestsr-devel-linux-x86_64-fedora-gcc
Running ‘testthat.R’ [13s/157s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> # This file is part of the standard setup for testthat.
> # It is recommended that you do not modify it.
> #
> # Where should you do additional test configuration?
> # Learn more about the roles of various files in:
> # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
> # * https://testthat.r-lib.org/articles/special-files.html
>
> library(testthat)
> library(BFS)
>
> test_check("BFS")
=>----------------------------- 2% | ETA: 2m
==>---------------------------- 8% | ETA: 1m
====>-------------------------- 13% | ETA: 1m
=====>------------------------- 18% | ETA: 1m
=======>----------------------- 24% | ETA: 46s
=========>--------------------- 30% | ETA: 41s
==========>-------------------- 34% | ETA: 39s
============>------------------ 39% | ETA: 36s
=============>----------------- 45% | E
...[truncated]...
e.
Backtrace:
▆
1. ├─BFS::bfs_get_data_comments(...) at test-bfs_get_data_comments.R:16:3
2. │ └─... %>% httr2::resp_body_json(simplifyVector = TRUE)
3. ├─httr2::resp_body_json(., simplifyVector = TRUE)
4. │ └─httr2:::check_response(resp)
5. │ └─httr2:::is_response(resp)
6. └─httr2::req_perform(.)
7. └─httr2:::handle_resp(req, resp, error_call = error_call)
8. └─httr2:::resp_failure_cnd(req, resp, error_call = error_call)
9. ├─rlang::catch_cnd(...)
10. │ ├─rlang::eval_bare(...)
11. │ ├─base::tryCatch(...)
12. │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
13. │ │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
14. │ │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
15. │ └─base::force(expr)
16. └─rlang::abort(...)
[ FAIL 3 | WARN 0 | SKIP 9 | PASS 48 ]
Error:
! Test failures.
Execution halted- ERROR12 OK, 1 ERROR2026-10-19
- OK13 OK2026-10-05
- ERROR12 OK, 1 ERROR2026-09-30
- OK13 OK2026-09-20
- ERROR12 OK, 1 ERROR2026-09-19
Show 15 earlier changesHide 15 earlier changes
- OK13 OK2026-09-11
- ERROR12 OK, 1 ERROR2026-09-08
- OK13 OK2026-08-28
- ERROR11 OK, 2 ERROR2026-08-22
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-07-30
- ERROR12 OK, 1 ERROR2026-07-29
- OK13 OK2026-07-18
- ERROR12 OK, 1 ERROR2026-07-17
- OK13 OK2026-07-04
- ERROR13 OK, 1 ERROR2026-03-30
- OK14 OK2026-03-28
- ERROR12 OK, 2 ERROR2026-03-25
- OK14 OK2026-03-10
Documentation
The repository also keeps web-only articles.
- Help pages
- 23 (2 internal)includes a package overview page
- Examples that run
- 0%4 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 29%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 88%
- Median days to close, 50 most recently updated closed issues
- 8
- Median days to close, 50 most recently updated closed PRs
- 2
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
9 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/lgnbhl/bfs on 2026-10-18.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Show all practicesHide 3 practices
This repository shows signs of AI coding tools.
- Claude Codefirst seen on or before 2026-10-17Commits: at least 29 crediting it in the message
- Claude Opus 5.529 commits · Oct 2026
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 0.7.2Latest
- RR 4.6.0 released · 2026-04-24
- 0.7.12026-02-05 · diff ↗
- 0.7.0
- 0.6.02025-06-09 · diff ↗
- 0.5.132025-04-29 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 0.5.122024-12-09 · diff ↗
- 0.5.112024-11-27 · diff ↗
- 0.5.102024-09-27 · diff ↗
- 0.5.92024-09-26 · diff ↗
- RR 4.4.0 released · 2024-04-24
- unarchivedReturned to CRAN2024-02-24
- 0.5.82024-02-24 · diff ↗
- archivedRemoved from CRAN2024-02-17policy violation On Internet access (429 error)
- unarchivedReturned to CRAN2024-02-02
Show 30 earlier eventsHide 30 earlier events
- 0.5.72024-02-02 · diff ↗
- archivedRemoved from CRAN2024-01-24requires archived package 'pxweb'
- 0.5.62024-01-08 · diff ↗
- 0.5.52023-09-20 · diff ↗
- 0.5.42023-09-13 · diff ↗
- 0.5.3
- 0.5.2
- 0.5.12023-06-09 · diff ↗
- 0.5
- 0.4.82023-05-31 · diff ↗
- 0.4.7
- RR 4.3.0 released · 2023-04-21
- 0.4.62023-03-30 · diff ↗
- 0.4.52023-02-27 · diff ↗
- 0.4.4
- unarchivedReturned to CRAN2022-09-07
- 0.4.32022-09-07 · diff ↗
- archivedRemoved from CRAN2022-06-14check problems were not corrected in time
- RR 4.2.0 released · 2022-04-22
- 0.4.12021-10-09 · diff ↗
- 0.4.02021-10-06 · diff ↗ ·
removed 2 exports
bfs_open_dir, bfs_searchadded 4 exports
bfs_get_catalog_data, bfs_get_catalog_tables, bfs_get_data, bfs_get_data_comments - RR 4.1.0 released · 2021-05-18
- 0.3.12021-05-10 · diff ↗
- 0.3.0
- RR 4.0.0 released · 2020-04-24
- 0.2.52020-03-25 · diff ↗
- 0.2.4
- 0.2.22019-10-21 · diff ↗
- 0.2.12019-10-16
- RR 3.6.0 released · 2019-04-26
Package metadata
- First published
- 2019-10-16
- Total releases
- 32 / 7 yrs
- License
- GPL (>= 3) OSI · relicensed from MIT + file LICENSE in 0.5.6
- Minimum R
- ≥ 3.4
- Bundled data
- 29 KB / 6 files
- Download size
- 956 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("BFS")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-20, which the citation names so these numbers can be found later. More on citing and the projects behind them.