Skip to content
CRAN requires the check problems on this package to be fixed before Oct 21 or it will be archived. See the check details

Get Data from the Swiss Federal Statistical Office

0packages depend
6.8Kdownloads / year
82.3%test coverage
12/13flavors OK

Overview

About

Search and download data from the Swiss Federal Statistical Office (BFS) APIs https://www.bfs.admin.ch/.

Changes in 0.7.2
  • wrap the network-dependent examples of bfs_get_sse_data() and bfs_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

CRAN checks
1ERROR12OK
Check messages
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

CRAN check page ↗

Slowest check: 8.2 min · r-oldrel-macos-x86_64
Status changes
  • 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
Advisories

none known

Documentation

In release 0.7.2
READMEYes · 3,011 wordsVignettesNoNEWSYes · 67% structured · mentions 0.7.2Citation fileNoWebsiteYes

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

6.8K
CRAN downloads in the past year
Rank #4,714 · ~19/day · ~568/mo
Daily download trend is not available in this view yet.
64830 days
1.7K90 days
6.8K1 year
Compare downloads with other packages →
Also on397 r2u51 autocran

Repository

28Stars
9Forks
5Open issues
0Open PRs
7Releases
444Commits
11Commit identities
rr-packageswitzerland
License file reads as GPL-3.0 · 444 commits · Last activity 2026-10-19 · +7.7% stars, 30d · Default branch at 0.8.0, ahead of CRAN 0.7.2 (checked 2026-10-18)
Responsiveness
How these are sampled
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

2025-10-12 · 222026-08-18 · 26
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (1)
Code of conduct
Docs source (2)
README.Rmdpkgdown
Coverage (1)
Coverage reporting (Codecov)
Show all practicesHide 3 practices
Reproducibility and dev environment (1)
data-raw/
Research and citation (1)
codemeta.json
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen on or before 2026-10-17
    Commits: at least 29 crediting it in the message
Models named in its commits
  • Claude Opus 5.529 commits · Oct 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
18 external dependencies (excludes base and recommended)

Installing BFS adds 41 packages (25 with compiled code, 27 MB of source tarballs). Heaviest: stringi 11 MB, pxweb 2.6 MB, fs 1.4 MB.

Depends (1)
R >= 3.4
LinkingTo (0)
none
Suggests (3)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (5)
Author, Maintainer since 0.2.1 (2019), Copyright holder
Contributor · added in 0.5.5
Contributor · added in 0.5.2
Contributor · added in 0.7.0
Contributor · added in 0.5.5
Listed in earlier versions (1)
no longer listed · 0.2.4 to 0.3.0
Releases (32)

Pick two releases to compare their code metrics.

  • 0.7.2Latest
    record
    2026-07-03 · current release · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • 0.7.1
    record
    2026-02-05 · diff ↗
  • 0.7.0
    record
    2025-11-03 · diff ↗ ·
    added 2 exports
    bfs_get_sse_data, bfs_get_sse_metadata
  • 0.6.0
    record
    2025-06-09 · diff ↗
  • 0.5.13
    record
    2025-04-29 · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • 0.5.12
    record
    2024-12-09 · diff ↗
  • 0.5.11
    record
    2024-11-27 · diff ↗
  • 0.5.10
    record
    2024-09-27 · diff ↗
  • 0.5.9
    record
    2024-09-26 · diff ↗
  • R
    R 4.4.0 released · 2024-04-24
  • unarchivedReturned to CRAN
    2024-02-24
  • 0.5.8
    record
    2024-02-24 · diff ↗
  • archivedRemoved from CRAN
    2024-02-17
    policy violation On Internet access (429 error)
  • unarchivedReturned to CRAN
    2024-02-02
Show 30 earlier eventsHide 30 earlier events
  • 0.5.7
    record
    2024-02-02 · diff ↗
  • archivedRemoved from CRAN
    2024-01-24
    requires archived package 'pxweb'
  • 0.5.6
    record
    2024-01-08 · diff ↗
  • 0.5.5
    record
    2023-09-20 · diff ↗
  • 0.5.4
    record
    2023-09-13 · diff ↗
  • 0.5.3
    record
    2023-08-19 · diff ↗ ·
    added 1 export
    bfs_get_base_maps
  • 0.5.2
    record
    2023-08-11 · diff ↗ ·
    added 2 exports
    bfs_download_asset, bfs_get_asset_metadata
  • 0.5.1
    record
    2023-06-09 · diff ↗
  • 0.5
    record
    2023-06-08 · diff ↗ ·
    added 2 exports
    bfs_download_geodata, bfs_get_catalog_geodata
  • 0.4.8
    record
    2023-05-31 · diff ↗
  • 0.4.7
    record
    2023-05-19 · diff ↗ ·
    added 1 export
    bfs_get_metadata
  • R
    R 4.3.0 released · 2023-04-21
  • 0.4.6
    record
    2023-03-30 · diff ↗
  • 0.4.5
    record
    2023-02-27 · diff ↗
  • 0.4.4
    record
    2022-12-14 · diff ↗ ·
    removed 2 exports
    bfs_get_dataset, bfs_get_metadata
  • unarchivedReturned to CRAN
    2022-09-07
  • 0.4.3
    record
    2022-09-07 · diff ↗
  • archivedRemoved from CRAN
    2022-06-14
    check problems were not corrected in time
  • R
    R 4.2.0 released · 2022-04-22
  • 0.4.1
    record
    2021-10-09 · diff ↗
  • 0.4.0
    record
    2021-10-06 · diff ↗ ·
    removed 2 exports
    bfs_open_dir, bfs_search
    added 4 exports
    bfs_get_catalog_data, bfs_get_catalog_tables, bfs_get_data, bfs_get_data_comments
  • R
    R 4.1.0 released · 2021-05-18
  • 0.3.1
    record
    2021-05-10 · diff ↗
  • 0.3.0
    record
    2021-03-23 · diff ↗ ·
    added 2 exports
    %>%, bfs_get_catalog
  • R
    R 4.0.0 released · 2020-04-24
  • 0.2.5
    record
    2020-03-25 · diff ↗
  • 0.2.4
    record
    2020-03-16 · diff ↗ ·
    added 1 export
    bfs_open_dir
  • 0.2.2
    record
    2019-10-21 · diff ↗
  • 0.2.1
    record
    2019-10-16
  • R
    R 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")
Luginbuhl, F., Baumann, P., Brenzel-Weiss, J., Hodel, M., & Martins, J. (2026). BFS: Get Data from the Swiss Federal Statistical Office (Version 0.7.2) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for BFS version 0.7.2 [Data set]. HJJB, LLC. Data release v2026-10-20. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy