diff --git a/DESCRIPTION b/DESCRIPTION index c637020c..3d784d79 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: flextable Type: Package Title: Functions for Tabular Reporting -Version: 0.9.5.009 +Version: 0.9.5.010 Authors@R: c( person("David", "Gohel", role = c("aut", "cre"), email = "david.gohel@ardata.fr"), diff --git a/NEWS.md b/NEWS.md index 8088c290..4f2f13fc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,7 @@ - `summarizor()` don't stop anymore if table only contain discrete columns. - `as_flextable.data.frame()` supports 'data.table' - `footnote()` handle undefined `ref_symbols` argument +- `delete_rows()` does not delete rows if the row selection is empty ## Changes diff --git a/R/augment_rows.R b/R/augment_rows.R index 20c02925..5cebda68 100644 --- a/R/augment_rows.R +++ b/R/augment_rows.R @@ -185,6 +185,9 @@ delete_rows <- function(x, i = NULL, part = "body") { check_formula_i_and_part(i, part) i <- get_rows_id(x[[part]], i) + if (length(i) < 1) { + return(x) + } x[[part]] <- delete_rows_from_part(x[[part]], i = i) x }