From 105619a0f68f2e5e2a896291c5d06045f5b1a722 Mon Sep 17 00:00:00 2001 From: jogaudard Date: Mon, 9 Feb 2026 11:15:04 +0100 Subject: [PATCH 01/11] adding readosense --- README.Rmd | 4 ++++ README.md | 8 ++++++++ vignettes/data-prep.Rmd | 1 + 3 files changed, 13 insertions(+) diff --git a/README.Rmd b/README.Rmd index 3fcb54dd..17092d9e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -128,6 +128,10 @@ fluxes_gpp The [`licoread` R package](https://jogaudard.github.io/licoread/index.html), developed in collaboration with [LI-COR](https://www.licor.com/), provides an easy way to import raw files from LI-COR gas analyzers as R objects that can be used directly with the `fluxible` R package. +### `readosense` R package + +The [`readosense` R package](https://jogaudard.github.io/readosense/index.html) provides an easy way to import raw files from [Eosense](https://eosense.com/) multi chamber ecosystem gas flux setups as R objects that can be used directly with the `fluxible` R package. + ## Further developments ### Segmentation tool diff --git a/README.md b/README.md index 9a306a6d..3f43ec25 100644 --- a/README.md +++ b/README.md @@ -196,6 +196,14 @@ collaboration with [LI-COR](https://www.licor.com/), provides an easy way to import raw files from LI-COR gas analyzers as R objects that can be used directly with the `fluxible` R package. +### `readosense` R package + +The [`readosense` R +package](https://jogaudard.github.io/readosense/index.html) provides an +easy way to import raw files from [Eosense](https://eosense.com/) multi +chamber ecosystem gas flux setups as R objects that can be used directly +with the `fluxible` R package. + ## Further developments ### Segmentation tool diff --git a/vignettes/data-prep.Rmd b/vignettes/data-prep.Rmd index 469cc96b..c9432ed3 100644 --- a/vignettes/data-prep.Rmd +++ b/vignettes/data-prep.Rmd @@ -23,6 +23,7 @@ The `readr::read_delim` [@readr2024] function works perfectly in most cases, giv We provide here examples on how to use `read_delim` to prepare your raw data files for the `fluxible` R package. For users of Li-COR instruments, the [`licoread` R package](https://jogaudard.github.io/licoread/index.html), developed in collaboration with Li-COR, is designed to read 82z and 81x files and import them as `fluxible`-friendly objets. +Eosense ecosystem gas flux chambers users can also use the [`readosense` R package](https://jogaudard.github.io/readosense/) to read their raw files and import them as `fluxible`-friendly objects. ## Checklists for inputs From 5e836e91948ebfbf76fce0abb95a730728120096 Mon Sep 17 00:00:00 2001 From: jogaudard Date: Fri, 13 Mar 2026 17:03:57 +0100 Subject: [PATCH 02/11] trying to get arrange_cols to work --- R/flux_fortify.R | 5 +++-- R/flux_plot.R | 10 ++++++++-- dev/dev.R | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/R/flux_fortify.R b/R/flux_fortify.R index 24babf0f..a8a06f37 100644 --- a/R/flux_fortify.R +++ b/R/flux_fortify.R @@ -22,7 +22,8 @@ flux_fortify <- function(slopes_df, f_ylim_upper, f_ylim_lower, f_facetid, - y_text_position) { + y_text_position, + arrange_cols) { args_ok <- flux_fun_check(list( f_ylim_upper = f_ylim_upper, @@ -115,7 +116,7 @@ flux_fortify <- function(slopes_df, sep = " " ) |> mutate( - f_facetid = fct_reorder(f_facetid, {{f_datetime}}) + f_facetid = fct_reorder(f_facetid, arrange_cols) ) # testing if f_facetid is unique, otherwise facet will make a mess diff --git a/R/flux_plot.R b/R/flux_plot.R index 5b5fd1ec..856020eb 100644 --- a/R/flux_plot.R +++ b/R/flux_plot.R @@ -99,9 +99,14 @@ flux_plot <- function(slopes_df, y_text_position = 500, print_plot = "FALSE", output = "print_only", - ggsave_args = list()) { + ggsave_args = list(), + arrange_cols = c()) { # fortify data + if (missing(arrange_cols)) { + arrange_cols <- f_datetime + } + slopes_params <- flux_fortify( slopes_df = slopes_df, f_conc = {{f_conc}}, @@ -109,7 +114,8 @@ flux_plot <- function(slopes_df, f_ylim_upper = f_ylim_upper, f_ylim_lower = f_ylim_lower, f_facetid = f_facetid, - y_text_position = y_text_position + y_text_position = y_text_position, + arrange_cols = arrange_cols ) slopes_df <- slopes_params$slopes_df diff --git a/dev/dev.R b/dev/dev.R index 49683084..f56cb492 100644 --- a/dev/dev.R +++ b/dev/dev.R @@ -27,7 +27,7 @@ devtools::load_all() # autoimport::autoimport() devtools::document() -devtools::test(filter = "flux_calc") +devtools::test(filter = "flux_plot") devtools::test() devtools::run_examples() devtools::check() From 0abc5d616935b299c059d49df836b2e27c5ecd12 Mon Sep 17 00:00:00 2001 From: jogaudard Date: Fri, 13 Mar 2026 17:09:53 +0100 Subject: [PATCH 03/11] problem with labl of f_datetime --- R/flux_plot.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/flux_plot.R b/R/flux_plot.R index 856020eb..62f480d7 100644 --- a/R/flux_plot.R +++ b/R/flux_plot.R @@ -104,7 +104,7 @@ flux_plot <- function(slopes_df, # fortify data if (missing(arrange_cols)) { - arrange_cols <- f_datetime + arrange_cols <- as_label(enquo(f_datetime)) } slopes_params <- flux_fortify( From d3a8e6df8de9bd87942a993d07a60ca7a9427fc9 Mon Sep 17 00:00:00 2001 From: jogaudard Date: Tue, 17 Mar 2026 15:00:35 +0100 Subject: [PATCH 04/11] works with current tests --- R/flux_fortify.R | 6 +++++- R/flux_plot.R | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/R/flux_fortify.R b/R/flux_fortify.R index a8a06f37..7fcc715d 100644 --- a/R/flux_fortify.R +++ b/R/flux_fortify.R @@ -116,7 +116,11 @@ flux_fortify <- function(slopes_df, sep = " " ) |> mutate( - f_facetid = fct_reorder(f_facetid, arrange_cols) + f_facetid = if (is.null(arrange_cols)) { + fct_reorder(f_facetid, {{f_datetime}}) + } else { + fct_reorder(f_facetid, {{arrange_cols}}) + } ) # testing if f_facetid is unique, otherwise facet will make a mess diff --git a/R/flux_plot.R b/R/flux_plot.R index 62f480d7..ba505675 100644 --- a/R/flux_plot.R +++ b/R/flux_plot.R @@ -103,9 +103,7 @@ flux_plot <- function(slopes_df, arrange_cols = c()) { # fortify data - if (missing(arrange_cols)) { - arrange_cols <- as_label(enquo(f_datetime)) - } + slopes_params <- flux_fortify( slopes_df = slopes_df, From bc9f9c89945a2650e06956c3ad5b9a3e673eb5db Mon Sep 17 00:00:00 2001 From: jogaudard Date: Tue, 17 Mar 2026 15:09:56 +0100 Subject: [PATCH 05/11] doc --- R/flux_plot.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/flux_plot.R b/R/flux_plot.R index ba505675..c6a1f52f 100644 --- a/R/flux_plot.R +++ b/R/flux_plot.R @@ -40,6 +40,8 @@ #' measurement. Default is `f_fluxid` #' @param longpdf_args arguments for longpdf in the form #' `list(ncol, width (in cm), ratio)` +#' @param arrange_cols character vector of columns to use to reorder the facets. +#' If NULL (default), facets are ordered by the datetime of the measurement. #' @return plots of fluxes, with raw concentration data points, fit, slope, #' and color code indicating quality flags and cuts. The plots are organized #' in facets according to flux ID, and a text box display the quality flag and From 501e3f44f902dc91e27252c1f54e42489e533473 Mon Sep 17 00:00:00 2001 From: jogaudard Date: Tue, 17 Mar 2026 15:10:20 +0100 Subject: [PATCH 06/11] new test --- tests/testthat/test-flux_plot.R | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/testthat/test-flux_plot.R b/tests/testthat/test-flux_plot.R index 47b184bb..f41b6329 100644 --- a/tests/testthat/test-flux_plot.R +++ b/tests/testthat/test-flux_plot.R @@ -515,3 +515,27 @@ test_that("slope crosses fit at tz with quadratic", { ) ) }) + +test_that("facet ordering", { + slopes30lin_flag <- suppressWarnings(flux_fitting( + co2_conc, + conc, + datetime, + fit_type = "linear", + end_cut = 30 + )) |> + flux_quality( + conc + ) |> + mutate( + plotID = c("C", "D", "A", "E", "B", "A") + ) + + plot_object <- flux_plot( + slopes30lin_flag, + conc, + datetime, + arrange_cols = plotID + ) + vdiffr::expect_doppelganger("facet ordering", plot_object) +}) From cb89c1507f01a4d982967d99c1fe91ea6a4a4ea2 Mon Sep 17 00:00:00 2001 From: jogaudard Date: Tue, 17 Mar 2026 15:14:50 +0100 Subject: [PATCH 07/11] corrected test prep --- tests/testthat/test-flux_plot.R | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-flux_plot.R b/tests/testthat/test-flux_plot.R index f41b6329..bb7bc306 100644 --- a/tests/testthat/test-flux_plot.R +++ b/tests/testthat/test-flux_plot.R @@ -528,7 +528,15 @@ test_that("facet ordering", { conc ) |> mutate( - plotID = c("C", "D", "A", "E", "B", "A") + plotID = f_fluxid, + plotID = case_when( + plotID == 1 ~ "b", + plotID == 2 ~ "c", + plotID == 3 ~ "a", + plotID == 4 ~ "f", + plotID == 5 ~ "m", + plotID == 6 ~ "f" + ) ) plot_object <- flux_plot( From 333b552842bac72670721d5d2d80544916152a05 Mon Sep 17 00:00:00 2001 From: jogaudard Date: Tue, 17 Mar 2026 16:07:12 +0100 Subject: [PATCH 08/11] passing --- R/flux_fortify.R | 22 +- R/flux_plot.R | 2 +- .../_snaps/flux_plot/facet-ordering.svg | 1774 +++++++++++++++++ tests/testthat/test-flux_plot.R | 2 + 4 files changed, 1793 insertions(+), 7 deletions(-) create mode 100644 tests/testthat/_snaps/flux_plot/facet-ordering.svg diff --git a/R/flux_fortify.R b/R/flux_fortify.R index 7fcc715d..060d5126 100644 --- a/R/flux_fortify.R +++ b/R/flux_fortify.R @@ -45,6 +45,7 @@ flux_fortify <- function(slopes_df, select( {{f_conc}}, {{f_datetime}}, + {{arrange_cols}}, all_of(f_facetid), any_of(c( "f_quality_flag", @@ -109,19 +110,28 @@ flux_fortify <- function(slopes_df, nb_fluxid <- n_distinct(slopes_df$f_fluxid) # customize facet ID + slopes_df <- slopes_df |> unite( col = "f_facetid", all_of(f_facetid), - sep = " " + sep = " ", + remove = FALSE ) |> + arrange({{arrange_cols}}, {{f_datetime}}) |> mutate( - f_facetid = if (is.null(arrange_cols)) { - fct_reorder(f_facetid, {{f_datetime}}) - } else { - fct_reorder(f_facetid, {{arrange_cols}}) - } + .by = "f_facetid", + rowid = cur_group_id(), + f_facetid = fct_reorder(f_facetid, .data$rowid) ) + # mutate( + # f_facetid = fct_reorder(f_facetid, {{arrange_cols}}) + # f_facetid = dplyr::if_else( + # {{arrange_cols}} == "", + # fct_reorder(f_facetid, {{f_datetime}}), + # fct_reorder(f_facetid, {{arrange_cols}}) + # ) + # ) # testing if f_facetid is unique, otherwise facet will make a mess nb_fluxid_post <- n_distinct(slopes_df$f_facetid) diff --git a/R/flux_plot.R b/R/flux_plot.R index c6a1f52f..812571af 100644 --- a/R/flux_plot.R +++ b/R/flux_plot.R @@ -115,7 +115,7 @@ flux_plot <- function(slopes_df, f_ylim_lower = f_ylim_lower, f_facetid = f_facetid, y_text_position = y_text_position, - arrange_cols = arrange_cols + arrange_cols = {{arrange_cols}} ) slopes_df <- slopes_params$slopes_df diff --git a/tests/testthat/_snaps/flux_plot/facet-ordering.svg b/tests/testthat/_snaps/flux_plot/facet-ordering.svg new file mode 100644 index 00000000..1b127455 --- /dev/null +++ b/tests/testthat/_snaps/flux_plot/facet-ordering.svg @@ -0,0 +1,1774 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ok +R2 = 0.91 +p-value = 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ok +R2 = 0.95 +p-value = 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ok +R2 = 0.99 +p-value = 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +zero +R2 = 0.01 +p-value = 0.283588 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ok +R2 = 1 +p-value = 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +ok +R2 = 0.94 +p-value = 0 + + + + + + + + + + + + +6 f + + + + + + + + + + +5 m + + + + + + + + + + +3 a + + + + + + + + + + +1 b + + + + + + + + + + +2 c + + + + + + + + + + +4 f + + + + + + +29/07 + 00:07 +29/07 + 00:08 +29/07 + 00:09 +29/07 + 00:10 + + + + +29/07 + 00:03 +29/07 + 00:04 +29/07 + 00:05 +29/07 + 00:06 + + + + +28/07 + 23:52 +28/07 + 23:53 +28/07 + 23:54 +28/07 + 23:55 + + + + +28/07 + 23:44 +28/07 + 23:45 +28/07 + 23:46 +28/07 + 23:47 + + + + +28/07 + 23:48 +28/07 + 23:49 +28/07 + 23:50 +28/07 + 23:51 + + + + +29/07 + 00:00 +29/07 + 00:01 +29/07 + 00:02 +29/07 + 00:03 +400 +500 +600 +700 +800 + + + + + +400 +500 +600 +700 +800 + + + + + +400 +500 +600 +700 +800 + + + + + +400 +500 +600 +700 +800 + + + + + +400 +500 +600 +700 +800 + + + + + +400 +500 +600 +700 +800 + + + + + +Datetime +Concentration + +Quality flags + + + + + + +cut +ok +zero + +Fits + + +f_fit_slope +linear model +Fluxes quality assessment + + diff --git a/tests/testthat/test-flux_plot.R b/tests/testthat/test-flux_plot.R index bb7bc306..fddf8816 100644 --- a/tests/testthat/test-flux_plot.R +++ b/tests/testthat/test-flux_plot.R @@ -537,12 +537,14 @@ test_that("facet ordering", { plotID == 5 ~ "m", plotID == 6 ~ "f" ) + # plotID = factor(plotID, levels = c("a", "b", "c", "f", "m")) ) plot_object <- flux_plot( slopes30lin_flag, conc, datetime, + f_facetid = c("f_fluxid", "plotID"), arrange_cols = plotID ) vdiffr::expect_doppelganger("facet ordering", plot_object) From 38af7c789e9226f44ee35ea3b30fb80ddf78f9e3 Mon Sep 17 00:00:00 2001 From: jogaudard Date: Tue, 17 Mar 2026 16:08:58 +0100 Subject: [PATCH 09/11] cleaning --- R/flux_fortify.R | 8 -------- tests/testthat/test-flux_plot.R | 1 - 2 files changed, 9 deletions(-) diff --git a/R/flux_fortify.R b/R/flux_fortify.R index 060d5126..7bb1fa17 100644 --- a/R/flux_fortify.R +++ b/R/flux_fortify.R @@ -124,14 +124,6 @@ flux_fortify <- function(slopes_df, rowid = cur_group_id(), f_facetid = fct_reorder(f_facetid, .data$rowid) ) - # mutate( - # f_facetid = fct_reorder(f_facetid, {{arrange_cols}}) - # f_facetid = dplyr::if_else( - # {{arrange_cols}} == "", - # fct_reorder(f_facetid, {{f_datetime}}), - # fct_reorder(f_facetid, {{arrange_cols}}) - # ) - # ) # testing if f_facetid is unique, otherwise facet will make a mess nb_fluxid_post <- n_distinct(slopes_df$f_facetid) diff --git a/tests/testthat/test-flux_plot.R b/tests/testthat/test-flux_plot.R index fddf8816..34659dd0 100644 --- a/tests/testthat/test-flux_plot.R +++ b/tests/testthat/test-flux_plot.R @@ -537,7 +537,6 @@ test_that("facet ordering", { plotID == 5 ~ "m", plotID == 6 ~ "f" ) - # plotID = factor(plotID, levels = c("a", "b", "c", "f", "m")) ) plot_object <- flux_plot( From f1ace636eed7ddc13e12d0089fb8b9a62c246bc7 Mon Sep 17 00:00:00 2001 From: jogaudard Date: Tue, 17 Mar 2026 16:30:58 +0100 Subject: [PATCH 10/11] news, version number, typo --- DESCRIPTION | 4 ++-- NEWS.md | 4 ++++ R/flux_fortify.R | 6 +++--- R/flux_plot.R | 6 +++--- man/flux_fortify.Rd | 3 ++- man/flux_plot.Rd | 6 +++++- tests/testthat/test-flux_plot.R | 2 +- 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a722f627..5483e807 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: fluxible Title: Ecosystem Gas Fluxes Calculations for Closed Loop Chamber Setup -Version: 1.3.6 -Date: 2026-02-05 +Version: 1.3.7 +Date: 2026-03-17 Authors@R: c(person(given = "Joseph", family = "Gaudard", , "joseph.gaudard@pm.me", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6989-7624")), diff --git a/NEWS.md b/NEWS.md index 727580b1..a4752e55 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# fluxible 1.3.7 + +* `flux_plot`: argument `arrange_col` allows to customize the order of the factes + # fluxible 1.3.6 * fixed the use of `case_when()` to avoid warnings with `dplyr 1.2.0`. diff --git a/R/flux_fortify.R b/R/flux_fortify.R index 7bb1fa17..e074bf59 100644 --- a/R/flux_fortify.R +++ b/R/flux_fortify.R @@ -23,7 +23,7 @@ flux_fortify <- function(slopes_df, f_ylim_lower, f_facetid, y_text_position, - arrange_cols) { + arrange_col) { args_ok <- flux_fun_check(list( f_ylim_upper = f_ylim_upper, @@ -45,7 +45,7 @@ flux_fortify <- function(slopes_df, select( {{f_conc}}, {{f_datetime}}, - {{arrange_cols}}, + {{arrange_col}}, all_of(f_facetid), any_of(c( "f_quality_flag", @@ -118,7 +118,7 @@ flux_fortify <- function(slopes_df, sep = " ", remove = FALSE ) |> - arrange({{arrange_cols}}, {{f_datetime}}) |> + arrange({{arrange_col}}, {{f_datetime}}) |> mutate( .by = "f_facetid", rowid = cur_group_id(), diff --git a/R/flux_plot.R b/R/flux_plot.R index 812571af..87f6e60a 100644 --- a/R/flux_plot.R +++ b/R/flux_plot.R @@ -40,7 +40,7 @@ #' measurement. Default is `f_fluxid` #' @param longpdf_args arguments for longpdf in the form #' `list(ncol, width (in cm), ratio)` -#' @param arrange_cols character vector of columns to use to reorder the facets. +#' @param arrange_col character vector of columns to use to reorder the facets. #' If NULL (default), facets are ordered by the datetime of the measurement. #' @return plots of fluxes, with raw concentration data points, fit, slope, #' and color code indicating quality flags and cuts. The plots are organized @@ -102,7 +102,7 @@ flux_plot <- function(slopes_df, print_plot = "FALSE", output = "print_only", ggsave_args = list(), - arrange_cols = c()) { + arrange_col = c()) { # fortify data @@ -115,7 +115,7 @@ flux_plot <- function(slopes_df, f_ylim_lower = f_ylim_lower, f_facetid = f_facetid, y_text_position = y_text_position, - arrange_cols = {{arrange_cols}} + arrange_col = {{arrange_col}} ) slopes_df <- slopes_params$slopes_df diff --git a/man/flux_fortify.Rd b/man/flux_fortify.Rd index d2a08408..9fdd25c9 100644 --- a/man/flux_fortify.Rd +++ b/man/flux_fortify.Rd @@ -11,7 +11,8 @@ flux_fortify( f_ylim_upper, f_ylim_lower, f_facetid, - y_text_position + y_text_position, + arrange_col ) } \arguments{ diff --git a/man/flux_plot.Rd b/man/flux_plot.Rd index 89134651..9d0dd71f 100644 --- a/man/flux_plot.Rd +++ b/man/flux_plot.Rd @@ -23,7 +23,8 @@ flux_plot( y_text_position = 500, print_plot = "FALSE", output = "print_only", - ggsave_args = list() + ggsave_args = list(), + arrange_col = c() ) } \arguments{ @@ -78,6 +79,9 @@ but will take time depending on the size of the dataset} \item{ggsave_args}{list of arguments for \link[ggplot2:ggsave]{ggsave} (in case \code{output = "ggsave"})} + +\item{arrange_col}{character vector of columns to use to reorder the facets. +If NULL (default), facets are ordered by the datetime of the measurement.} } \value{ plots of fluxes, with raw concentration data points, fit, slope, diff --git a/tests/testthat/test-flux_plot.R b/tests/testthat/test-flux_plot.R index 34659dd0..bca39ebd 100644 --- a/tests/testthat/test-flux_plot.R +++ b/tests/testthat/test-flux_plot.R @@ -544,7 +544,7 @@ test_that("facet ordering", { conc, datetime, f_facetid = c("f_fluxid", "plotID"), - arrange_cols = plotID + arrange_col = plotID ) vdiffr::expect_doppelganger("facet ordering", plot_object) }) From 5ccb4b9ca35165406390b96e8cbd3eed0336c3f2 Mon Sep 17 00:00:00 2001 From: jogaudard Date: Tue, 17 Mar 2026 16:32:04 +0100 Subject: [PATCH 11/11] typo in news --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index a4752e55..ffdd2bd6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # fluxible 1.3.7 -* `flux_plot`: argument `arrange_col` allows to customize the order of the factes +* `flux_plot`: argument `arrange_col` allows to customize the order of the facets # fluxible 1.3.6