Skip to content

FSK2R

0.2.0Package record

An Interface Between the 'FSKX' Standard and 'R'

0packages depend
3.3Kdownloads / year
20.1%test coverage
13/13flavors OK

Overview

About

Functions for importing, creating, editing and exporting 'FSK' files https://foodrisklabs.bfr.bund.de/fskx-food-safety-knowledge-exchange-format/ using the 'R' programming environment. Furthermore, it enables users to run simulations contained in the 'FSK' files and visualize the results.

Changes in 0.2.0

Major New Features

  • **Dynamic Script Detection**: import_fsk() now dynamically detects model and visualization script filenames from metadata.rdf instead of hardcoding "model.r" and "visualization.r". This enables support for FSKX files with non-standard script names.
  • **Complete Temporary Folder Execution**: run_simulation() now executes models in their unpacked temporary directory, solving file loading issues for models that depend on CSV, Excel, and other data files (e.g., QMRA models).
  • **Workspace Copying Functionality**: Added optional workspace copying with intelligent directory naming:
  • New parameters: copy_workspace and workspace_mode in run_simulation() and run_all_simulations()
  • Creates directories named: fsk_workspace_[model_name]_[simulation_name]/
  • Three copy modes: "all" (complete workspace), "generated" (new files only), "modified" (changed files only)
  • **Model Chaining Support**: Added inject_to_global parameter enabling seamless model chaining workflows:
  • New parameter: inject_to_global in run_simulation() and run_all_simulations()
  • When TRUE, simulation variables are injected directly into the user's global environment
  • Enables users to access simulation results directly without complex variable extraction
  • Facilitates model chaining: use results from Model A as inputs to Model B
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
  • Maintains backward compatibility (FALSE by default)

Bug Fixes and Improvements

  • Cross-platform line endings: All textual files exported into FSKX archives now use LF line endings on every OS (including Windows). This applies to:
  • README.txt, metaData.json, packages.json, manifest.xml, metadata.rdf
  • model and visualization scripts
  • workspace.r
  • sim.sedml and model.sbml
  • Other files: R scripts included via other_files are normalized to LF on export; other file types are copied unchanged.
  • Encoding: All textual exports are written as UTF-8 (no BOM).
  • Internal: Introduced write_text_lf() helper to normalize line endings and write via binary connections; XML writers now use binary connections; zipping uses utils::zip to preserve directory structure.
  • **File Loading Fix**: Models that load external files (CSV, Excel, etc.) now work correctly by executing in the proper temporary directory with automatic working directory restoration.
  • **Enhanced Return Values**: run_simulation() now returns all user-created variables with preserved data types (scalars, vectors, data frames, lists, matrices) .
  • **Improved Visualization Handling**: Enhanced automatic display of ggplot objects created by visualization scripts.
  • **Package Build Optimization**: Added comprehensive .Rbuildignore file to exclude development files (test projects, debug scripts, session artifacts) from package builds.
  • **Robust Error Handling**: Added proper error handling and cleanup for working directory management and workspace copying operations.
  • **Updated Documentation**: Enhanced function documentation to reflect new parameters and capabilities.

Breaking Changes

  • None - all changes are backward compatible with existing workflows.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 2.3 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.2.0
READMEYes · 113 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 0.2.0Citation fileYes · cites a publicationWebsitenot declared in DESCRIPTION
Help pages
61
Examples that run
0%12 only when donttest examples are enabled (R CMD check --as-cran)
Exported functions with examples
32%
Documented parameters
100%
Return-value docs
74%
Help pages citing references
0%

Downloads

3.3K
CRAN downloads in the past year
Rank #13,108 · ~9/day · ~278/mo
Daily download trend is not available in this view yet.
33030 days
88490 days
3.3K1 year
Compare downloads with other packages →
Also on87 r2u

Dependencies

Declared dependencies
15 external dependencies (excludes base and recommended)

Installing FSK2R adds 75 packages (47 with compiled code, 61 MB of source tarballs). Heaviest: stringi 11 MB, data.table 5.7 MB, bslib 5.6 MB.

Depends (0)
none
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (5)
Author, Maintainer since 0.1.1 (2020)
Author · added in 0.2.0
Releases (4)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 0.2.0Latest
    record
    2025-10-10 · current release · diff ↗ ·
    added 21 exports
    FSKAuthor, FSKCreator, FSKDataBackground, FSKGeneralInformation, FSKMetadata, FSKModelCategory, FSKModelMath, FSKParameter, FSKReference, FSKScope, clean_empty_values, read_R_model, read_fsk_json_metadata, read_fsk_manifest, read_fsk_model, read_fsk_packages, read_fsk_rdf_metadata, read_fsk_readme, read_fsk_sim, read_other_files, read_visualization
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • R
    R 4.2.0 released · 2022-04-22
  • 0.1.3
    record
    2022-02-25 · diff ↗ ·
    removed 2 exports
    download_metadata_schema, read_fsk_metadata
  • R
    R 4.1.0 released · 2021-05-18
  • 0.1.2
    record
    2020-10-06 · diff ↗
  • 0.1.1
    record
    2020-05-13
  • R
    R 4.0.0 released · 2020-04-24

Package metadata

First published
2020-05-13
Total releases
4 / 6 yrs
License
GPL-3 OSI
Download size
1.2 MB

Cite

Cite this package

Run in R for the authors' entry:

citation("FSK2R")

The package provides a citation file, so citation() returns the authors' own entry.

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 FSK2R version 0.2.0 [Data set]. HJJB, LLC. Data release v2026-10-26. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-26, 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