diff --git a/.github/workflows/rhub.yaml b/.github/workflows/rhub.yaml new file mode 100644 index 0000000..48b12a4 --- /dev/null +++ b/.github/workflows/rhub.yaml @@ -0,0 +1,79 @@ +# R-hub's genetic GitHub Actions workflow file. It's canonical location is at +# https://github.com/r-hub/rhub2/blob/v1/inst/workflow/rhub.yaml +# You can update this file to a newer version using the rhub2 package: +# +# rhub2::rhub_setup() +# +# It is unlikely that you need to modify this file manually. + +name: R-hub +run-name: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }} (${{ github.event.inputs.id }}) + +on: + workflow_dispatch: + inputs: + config: + description: 'A comma separated list of R-hub platforms to use.' + type: string + default: 'linux,windows,macos' + name: + description: 'Run name. You can leave this empty now.' + type: string + id: + description: 'Unique ID. You can leave this empty now.' + type: string + +jobs: + + setup: + runs-on: ubuntu-latest + outputs: + containers: ${{ steps.rhub-setup.outputs.containers }} + platforms: ${{ steps.rhub-setup.outputs.platforms }} + + steps: + # NO NEED TO CHECKOUT HERE + - uses: r-hub/rhub2/actions/rhub-setup@v1 + with: + config: ${{ github.event.inputs.config }} + id: rhub-setup + + linux-containers: + needs: setup + if: ${{ needs.setup.outputs.containers != '[]' }} + runs-on: ubuntu-latest + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.containers) }} + container: + image: ${{ matrix.config.container }} + + steps: + - uses: actions/checkout@v3 + - uses: r-hub/rhub2/actions/rhub-check@v1 + with: + token: ${{ secrets.RHUB_TOKEN }} + job-config: ${{ matrix.config.job-config }} + + other-platforms: + needs: setup + if: ${{ needs.setup.outputs.platforms != '[]' }} + runs-on: ${{ matrix.config.os }} + name: ${{ matrix.config.label }} + strategy: + fail-fast: false + matrix: + config: ${{ fromJson(needs.setup.outputs.platforms) }} + + steps: + - uses: actions/checkout@v3 + - uses: r-hub/rhub2/actions/rhub-setup-r@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} + - uses: r-hub/rhub2/actions/rhub-check@v1 + with: + job-config: ${{ matrix.config.job-config }} + token: ${{ secrets.RHUB_TOKEN }} diff --git a/NAMESPACE b/NAMESPACE index c45084f..bc9ccad 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -6,10 +6,13 @@ export("%>%") export(as_flextable) export(as_paragraph_md) export(colformat_md) +export(flextable) export(footnote_options) export(separate_header) export(span_header) +export(split_header) export(with_blanks) importFrom(flextable,as_flextable) +importFrom(flextable,flextable) importFrom(magrittr,"%>%") importFrom(rlang,.data) diff --git a/NEWS.md b/NEWS.md index 4a983a6..4ae5074 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# ftExtra 0.6.1 + +* Deprecated functions masking the corresponding ones from the **flextable** package (#95) + +* Renamed `separate_header` to `split_header` (#95) + +* Fixed a wrong escape regex in the `sep` parameter of `split_header`, `span_header`, and `separate_header` (#95) + # ftExtra 0.6.0 * Fix `footnote_options` not controlling reference symbols correctly. Formerly, only symbols in the cells used the `prefix` and the `suffix` arguments. Now, footnote texts also respects them (#88). diff --git a/R/as-flextable.R b/R/as-flextable.R index 8a7d5c2..a780e18 100644 --- a/R/as-flextable.R +++ b/R/as-flextable.R @@ -51,7 +51,7 @@ as_flextable.grouped_df <- function( x %>% dplyr::ungroup() %>% flextable::as_grouped_data(g) %>% - as_flextable(...) + flextable::as_flextable(...) ) } @@ -79,6 +79,16 @@ as_flextable.grouped_df <- function( #' as_flextable() #' @export as_flextable.data.frame <- function(x, col_keys = names(x), ...) { + .Deprecated( + "flextable:::as_flextable.data.frame", + msg = paste( + "ftExtra:::as_flextable.data.frame is deprecated", + "and will be removed in the future release.", + "Consider using flextalbe's implementation by running", + '`.S3method("as_flextable", "data.frame",', + "flextable:::as_flextable.data.frame)`" + ) + ) if (is.function(col_keys)) col_keys <- col_keys(x) flextable::flextable(x, col_keys = col_keys, ...) } diff --git a/R/footnote.R b/R/footnote.R index 7cbe5ad..7533dda 100644 --- a/R/footnote.R +++ b/R/footnote.R @@ -22,7 +22,7 @@ #' #' @examples #' # A examole flextable with unprocessed markdown footnotes -#' ft <- as_flextable(tibble::tibble( +#' ft <- flextable(tibble::tibble( #' "header1^[note a]" = c("x^[note 1]", "y"), #' "header2" = c("a", "b^[note 2]") #' )) diff --git a/R/ftExtra.R b/R/ftExtra.R index 40a3184..54ad6b2 100644 --- a/R/ftExtra.R +++ b/R/ftExtra.R @@ -2,3 +2,7 @@ #' @importFrom magrittr %>% #' @export magrittr::`%>%` + +#' @importFrom flextable flextable +#' @export +flextable::flextable diff --git a/R/header-transform.R b/R/header-transform.R index b503053..b95ae30 100644 --- a/R/header-transform.R +++ b/R/header-transform.R @@ -59,7 +59,10 @@ transform_header <- function( flextable::fix_border_issues() } -#' Separate the header based on delimiters +#' Split the header based on delimiters +#' +#' @note +#' `split_header` is a rename of `separate_header` and the latter will be removed in the future release. #' #' @param x A `flextable` object` #' @inheritParams tidyr::separate @@ -72,12 +75,12 @@ transform_header <- function( #' #' @examples #' iris %>% -#' as_flextable() %>% +#' flextable() %>% #' separate_header() #' @export -separate_header <- function( +split_header <- function( x, - sep = "[_\\.]", + sep = "[_.]", theme_fun = NULL, ... ) { @@ -86,6 +89,27 @@ separate_header <- function( sep = sep, theme_fun = theme_fun, .fill = FALSE, .merge = FALSE, ... ) } + +#' @rdname split_header +#' @export +separate_header <- function( + x, + sep = "[_.]", + theme_fun = NULL, + ... +) { + .Deprecated( + "split_header", + msg = paste( + "ftExtra::separate_header will be removed in the future release", + "to avoid masking `flextable::separate_header`.", + "Instead, use ftExtra::split_header which is a copy of", + "ftExtra::separate_header." + ) + ) + split_header(x, sep, theme_fun, ...) +} + #' Span the header based on delimiters #' #' @inherit separate_header @@ -94,12 +118,12 @@ separate_header <- function( #' #' @examples #' iris %>% -#' as_flextable() %>% +#' flextable() %>% #' span_header() #' @export span_header <- function( x, - sep = "[_\\.]", + sep = "[_.]", theme_fun = NULL, ... ) { diff --git a/R/utils.R b/R/utils.R index 8a01add..5291750 100644 --- a/R/utils.R +++ b/R/utils.R @@ -16,3 +16,7 @@ drop_na <- function(x) { last <- function(x) { x[[length(x)]] } + +.Deprecated <- function(...) { + if (!getOption("ftExtra.ignore.deprecation", FALSE)) base::.Deprecated(...) +} diff --git a/R/with-blanks.R b/R/with-blanks.R index 4967fbb..26cf29d 100644 --- a/R/with-blanks.R +++ b/R/with-blanks.R @@ -6,7 +6,7 @@ insert_blanks <- function(after = NULL, before = NULL, data) { names(data), sprintf("..after%s", seq_along(.after)), sprintf("..before%s", seq_along(.before)) - )[order(c(seq(length(data)), .after, .before))] + )[order(c(seq_along(data), .after, .before))] } #' Specify blank columns easily via `col_keys` @@ -20,6 +20,9 @@ insert_blanks <- function(after = NULL, before = NULL, data) { #' as_flextable(col_keys = with_blanks(dplyr::ends_with("Width"))) #' @export with_blanks <- function(after = NULL, before = NULL) { + .Deprecated(msg = paste( + "This is a result of deprecating ftExtra:::as_flextable.data.frame" + )) after <- rlang::enquo(after) before <- rlang::enquo(before) function(data) insert_blanks(after = after, before = before, data = data) diff --git a/docs/articles/format_columns.html b/docs/articles/format_columns.html index 5e4b61f..023b0be 100644 --- a/docs/articles/format_columns.html +++ b/docs/articles/format_columns.html @@ -135,12 +135,12 @@

Why markdown?) )
- - - + +

Oxide

+ - - + +

Oxide

SiO2

Al2O3

SiO2

Al2O3

@@ -187,12 +187,12 @@

Why markdown?} ft
- - - + +

Oxide

+ - - + +

Oxide

SiO2

Fe2O3

SiO2

Fe2O3

@@ -204,8 +204,7 @@

Why markdown?
  • Preprocess a data frame to decorate texts with markdown syntax.
  • Convert the data frame into a flextable object with the -flextable function or as_flextable -function.
  • +flextable function or flextable function.
  • Format markdown columns with colformat_md
  • @@ -220,12 +219,12 @@

    Why markdown?flextable::flextable() %>% ftExtra::colformat_md()
    - - - + +

    Oxide

    + - - + +

    Oxide

    SiO2

    Fe2O3

    SiO2

    Fe2O3

    @@ -237,7 +236,7 @@

    Why markdown?
    -readr::read_csv("example.csv") %>%
    +readr::read_csv("example.csv") %>%
       flextable::flextable() %>%
       ftExtra::colformat_md()

    By default, the ftExtra package employs Pandoc’s @@ -261,29 +260,29 @@

    Basic examples ), stringsAsFactors = FALSE ) %>% - as_flextable() %>% + flextable() %>% colformat_md()
    - - + +
    - - - - + + + + - - - - + + + + - - - - + + + +

    a

    b

    c

    d

    a

    b

    c

    d

    bold

    superscript

    code

    ftExtra is

    bold

    superscript

    code

    ftExtra is

    italic

    subscript

    underline

    Cool

    italic

    subscript

    underline

    Cool

    @@ -336,21 +335,21 @@

    Footnotes= "Extensions for 'Flextable'^[Supports of footnotes]", stringsAsFactors = FALSE ) %>% - as_flextable() %>% + flextable() %>% colformat_md() %>% flextable::autofit(add_w = 0.5)

    - - + +
    - - + + - - + + - +

    package

    description

    package

    description

    ftExtra

    Extensions for Flextable1

    ftExtra

    Extensions for Flextable1

    1Supports of footnotes

    1Supports of footnotes

    Reference symbols can be configured by @@ -362,7 +361,7 @@

    Footnotes= "Extensions for 'Flextable'^[Supports of footnotes]", stringsAsFactors = FALSE ) %>% - as_flextable() %>% + flextable() %>% colformat_md( .footnote_options = footnote_options( ref = "i", @@ -375,17 +374,17 @@

    Footnotes) %>% flextable::autofit(add_w = 0.5)
    - - + +
    - - + + - - + + - +

    package

    description

    package

    description

    ftExtra[ii]

    Extensions for Flextable[iii]

    ftExtra[ii]

    Extensions for Flextable[iii]

    [ii]Short of flextable extra; [iii]Supports of footnotes;

    [ii]Short of flextable extra; [iii]Supports of footnotes;

    In order to add multiple footnotes to a cell, use normal footnotes @@ -400,16 +399,16 @@

    Footnotes[^b]: bbb", stringsAsFactors = FALSE ) %>% - as_flextable() %>% + flextable() %>% colformat_md()
    - - - - + +

    x

    foo1, 2

    + + - - + +

    x

    foo1, 2

    1aaa

    2bbb

    1aaa

    2bbb

    @@ -445,7 +444,7 @@

    Footnotes"header1^[note a]" = c("x^[note 1]", "y"), "header2" = c("a", "b^[note 2]") ) %>% - as_flextable() %>% + flextable() %>% # process header first colformat_md( part = "header", .footnote_options = footnote_options(ref = ref) @@ -457,26 +456,26 @@

    Footnotes# tweak width for visibility flextable::autofit(add_w = 0.2)
    - - + +
    - - + + - - + + - - + + - - - + + +

    header1a

    header2

    header1a

    header2

    x1

    a

    x1

    a

    y

    b2

    y

    b2

    a: note a

    1: note 1

    2: note 2

    a: note a

    1: note 1

    2: note 2

    @@ -508,14 +507,14 @@

    Images R = sprintf("![](%s)", file.path(R.home("doc"), "html", "logo.jpg")), stringsAsFactors = FALSE ) %>% - as_flextable() %>% + flextable() %>% colformat_md() %>% flextable::autofit()
    - - - - + +

    R

    + +

    R

    The R logo is distributed by The R Foundation with the CC-BY-SA 4.0 @@ -527,39 +526,39 @@

    Line breaks
     data.frame(linebreak = c("a\nb"), stringsAsFactors = FALSE) %>%
    -  as_flextable() %>%
    +  flextable() %>%
       colformat_md()
    - - - - + +

    linebreak

    a b

    + +

    linebreak

    a b

    Pandoc’s markdown supports hard line breaks by adding a backslash or double spaces at the end of a line.

     data.frame(linebreak = c("a\\\nb"), stringsAsFactors = FALSE) %>%
    -  as_flextable() %>%
    +  flextable() %>%
       colformat_md()
    - - - - + +

    linebreak

    a
    b

    + +

    linebreak

    a
    b

    It is also possible to make \n as a hard line break by extending Pandoc’s Markdown.

     data.frame(linebreak = c("a\nb"), stringsAsFactors = FALSE) %>%
    -  as_flextable() %>%
    +  flextable() %>%
       colformat_md(md_extensions = "+hard_line_breaks")
    - - - - + +

    linebreak

    a
    b

    + +

    linebreak

    a
    b

    Markdown treats continuous linebreaks as a separator of blocks such @@ -569,13 +568,13 @@

    Line breaks
     data.frame(linebreak = c("a\n\nb"), stringsAsFactors = FALSE) %>%
    -  as_flextable() %>%
    +  flextable() %>%
       colformat_md(.sep = "\n\n")
    - - - - + +

    linebreak

    a

    b

    + +

    linebreak

    a

    b

    @@ -589,8 +588,9 @@

    Citations title = {ftExtra: Extensions for Flextable}, author = {Atsushi Yasumoto}, year = {2023}, - note = {https://ftextra.atusy.net}, -} + note = {R package version 0.6.0}, + url = {https://ftextra.atusy.net}, +}

    Second, specify it, and optionally a CSL file, within the YAML front matter.

    ---
    @@ -603,7 +603,7 @@ 

    Citations= c("@R-ftExtra", "[@R-ftExtra]", "[-@R-ftExtra]"), stringsAsFactors = FALSE ) %>% - as_flextable() %>% + flextable() %>% colformat_md() %>% flextable::autofit(add_w = 0.2)

    - - - + +

    Cite

    + - - - + + +

    Cite

    Yasumoto (2023)

    (Yasumoto 2023)

    (2023)

    Yasumoto (2023)

    (Yasumoto 2023)

    (2023)

    @@ -636,14 +636,14 @@

    Math math = "$e^{i\\theta} = \\cos \\theta + i \\sin \\theta$", stringsAsFactors = FALSE ) %>% - as_flextable() %>% + flextable() %>% colformat_md() %>% flextable::autofit(add_w = 0.2)
    - - - - + +

    math

    eiθ = cos θ + isin θ

    + +

    math

    eiθ = cos θ + isin θ

    Note that results can be insufficient. This feature relies on @@ -660,13 +660,13 @@

    Emoji md_extensions="+emoji".

     data.frame(emoji = c(":+1:"), stringsAsFactors = FALSE) %>%
    -  as_flextable() %>%
    +  flextable() %>%
       colformat_md(md_extensions = "+emoji")
    - - - - + +

    emoji

    👍

    + +

    emoji

    👍

    @@ -680,13 +680,13 @@

    Other input formats= "H<sub>2</sub>O", stringsAsFactors = FALSE ) %>% - as_flextable() %>% + flextable() %>% colformat_md(.from = "html")
    - - - - + +

    x

    H2O

    + +

    x

    H2O

    Note that multiple paragraphs are not supported if .from @@ -696,13 +696,13 @@

    Other input formats= "foo\n\nbar", stringsAsFactors = FALSE ) %>% - as_flextable() %>% + flextable() %>% colformat_md(.from = "commonmark")
    - - - - + +

    x

    foobar

    + +

    x

    foobar

    diff --git a/docs/articles/group-rows.html b/docs/articles/group-rows.html index c6aec68..a2f1db4 100644 --- a/docs/articles/group-rows.html +++ b/docs/articles/group-rows.html @@ -119,53 +119,53 @@

    Single grouping columns
     grouped_iris %>% as_flextable()
    - - + +
    - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + +

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    Species: setosa

    Species: setosa

    5.1

    3.5

    1.4

    0.2

    5.1

    3.5

    1.4

    0.2

    4.9

    3.0

    1.4

    0.2

    4.9

    3.0

    1.4

    0.2

    Species: versicolor

    Species: versicolor

    7.0

    3.2

    4.7

    1.4

    7.0

    3.2

    4.7

    1.4

    6.4

    3.2

    4.5

    1.5

    6.4

    3.2

    4.5

    1.5

    Species: virginica

    Species: virginica

    6.3

    3.3

    6.0

    2.5

    6.3

    3.3

    6.0

    2.5

    5.8

    2.7

    5.1

    1.9

    5.8

    2.7

    5.1

    1.9

    @@ -173,53 +173,53 @@

    Single grouping columns
     grouped_iris %>% as_flextable(hide_grouplabel = TRUE)

    - - + +
    - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + +

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    setosa

    setosa

    5.1

    3.5

    1.4

    0.2

    5.1

    3.5

    1.4

    0.2

    4.9

    3.0

    1.4

    0.2

    4.9

    3.0

    1.4

    0.2

    versicolor

    versicolor

    7.0

    3.2

    4.7

    1.4

    7.0

    3.2

    4.7

    1.4

    6.4

    3.2

    4.5

    1.5

    6.4

    3.2

    4.5

    1.5

    virginica

    virginica

    6.3

    3.3

    6.0

    2.5

    6.3

    3.3

    6.0

    2.5

    5.8

    2.7

    5.1

    1.9

    5.8

    2.7

    5.1

    1.9

    @@ -231,53 +231,53 @@

    Multiple grouping columns
     grouped_mtcars %>% as_flextable()

    - - + +
    - - - + + + - - + + - - - + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + +

    model

    mpg

    disp

    model

    mpg

    disp

    am: 1.0

    cyl: 6.0

    am: 1.0

    cyl: 6.0

    Mazda RX4

    21.0

    160

    Mazda RX4

    21.0

    160

    Mazda RX4 Wag

    21.0

    160

    Mazda RX4 Wag

    21.0

    160

    am: 1.0

    cyl: 4.0

    am: 1.0

    cyl: 4.0

    Datsun 710

    22.8

    108

    Datsun 710

    22.8

    108

    am: 0.0

    cyl: 6.0

    am: 0.0

    cyl: 6.0

    Hornet 4 Drive

    21.4

    258

    Hornet 4 Drive

    21.4

    258

    am: 0.0

    cyl: 8.0

    am: 0.0

    cyl: 8.0

    Hornet Sportabout

    18.7

    360

    Hornet Sportabout

    18.7

    360

    am: 0.0

    cyl: 6.0

    am: 0.0

    cyl: 6.0

    Valiant

    18.1

    225

    Valiant

    18.1

    225

    @@ -296,56 +296,59 @@

    Single grouping variable
     grouped_iris %>%
    -  as_flextable(groups_to = "merged")
    + as_flextable(groups_to = "merged") +#> Warning: ftExtra:::as_flextable.data.frame is deprecated and will be removed in +#> the future release. Consider using flextalbe's implementation by running +#> `.S3method("as_flextable", "data.frame", flextable:::as_flextable.data.frame)`

    - - + +
    - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + +

    Species

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    Species

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    setosa

    5.1

    3.5

    1.4

    0.2

    setosa

    5.1

    3.5

    1.4

    0.2

    4.9

    3.0

    1.4

    0.2

    4.9

    3.0

    1.4

    0.2

    versicolor

    7.0

    3.2

    4.7

    1.4

    versicolor

    7.0

    3.2

    4.7

    1.4

    6.4

    3.2

    4.5

    1.5

    6.4

    3.2

    4.5

    1.5

    virginica

    6.3

    3.3

    6.0

    2.5

    virginica

    6.3

    3.3

    6.0

    2.5

    5.8

    2.7

    5.1

    1.9

    5.8

    2.7

    5.1

    1.9

    @@ -356,107 +359,113 @@

    Multiple grouping variables
     grouped_mtcars %>%
    -  as_flextable(groups_to = "merged", groups_arrange = TRUE)

    + as_flextable(groups_to = "merged", groups_arrange = TRUE) +#> Warning: ftExtra:::as_flextable.data.frame is deprecated and will be removed in +#> the future release. Consider using flextalbe's implementation by running +#> `.S3method("as_flextable", "data.frame", flextable:::as_flextable.data.frame)`
    - - + +
    - - - - - + + + + + - - - - - + + + + + - - - + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - + + +

    am

    cyl

    model

    mpg

    disp

    am

    cyl

    model

    mpg

    disp

    0

    6

    Hornet 4 Drive

    21.4

    258

    0

    6

    Hornet 4 Drive

    21.4

    258

    Valiant

    18.1

    225

    Valiant

    18.1

    225

    8

    Hornet Sportabout

    18.7

    360

    8

    Hornet Sportabout

    18.7

    360

    1

    4

    Datsun 710

    22.8

    108

    1

    4

    Datsun 710

    22.8

    108

    6

    Mazda RX4

    21.0

    160

    6

    Mazda RX4

    21.0

    160

    Mazda RX4 Wag

    21.0

    160

    Mazda RX4 Wag

    21.0

    160

     grouped_mtcars %>%
    -  as_flextable(groups_to = "merged", groups_arrange = FALSE)
    + as_flextable(groups_to = "merged", groups_arrange = FALSE) +#> Warning: ftExtra:::as_flextable.data.frame is deprecated and will be removed in +#> the future release. Consider using flextalbe's implementation by running +#> `.S3method("as_flextable", "data.frame", flextable:::as_flextable.data.frame)`
    - - + +
    - - - - - + + + + + - - - - - + + + + + - - - + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + +

    am

    cyl

    model

    mpg

    disp

    am

    cyl

    model

    mpg

    disp

    1

    6

    Mazda RX4

    21.0

    160

    1

    6

    Mazda RX4

    21.0

    160

    Mazda RX4 Wag

    21.0

    160

    Mazda RX4 Wag

    21.0

    160

    4

    Datsun 710

    22.8

    108

    4

    Datsun 710

    22.8

    108

    0

    6

    Hornet 4 Drive

    21.4

    258

    0

    6

    Hornet 4 Drive

    21.4

    258

    8

    Hornet Sportabout

    18.7

    360

    8

    Hornet Sportabout

    18.7

    360

    6

    Valiant

    18.1

    225

    6

    Valiant

    18.1

    225

    @@ -470,54 +479,57 @@

    Position of grouping variables
     grouped_mtcars %>%
       as_flextable(groups_to = "merged", groups_pos = "asis") %>%
    -  flextable::theme_vanilla()

    + flextable::theme_vanilla() +#> Warning: ftExtra:::as_flextable.data.frame is deprecated and will be removed in +#> the future release. Consider using flextalbe's implementation by running +#> `.S3method("as_flextable", "data.frame", flextable:::as_flextable.data.frame)`
    - - + +
    - - - - - + + + + + - - - - - + + + + + - - - + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + +

    model

    cyl

    mpg

    disp

    am

    model

    cyl

    mpg

    disp

    am

    Mazda RX4

    6

    21.0

    160

    1

    Mazda RX4

    6

    21.0

    160

    1

    Mazda RX4 Wag

    21.0

    160

    Mazda RX4 Wag

    21.0

    160

    Datsun 710

    4

    22.8

    108

    Datsun 710

    4

    22.8

    108

    Hornet 4 Drive

    6

    21.4

    258

    0

    Hornet 4 Drive

    6

    21.4

    258

    0

    Hornet Sportabout

    8

    18.7

    360

    Hornet Sportabout

    8

    18.7

    360

    Valiant

    6

    18.1

    225

    Valiant

    6

    18.1

    225

    diff --git a/docs/articles/transform-headers.html b/docs/articles/transform-headers.html index 21aa931..bbbc85f 100644 --- a/docs/articles/transform-headers.html +++ b/docs/articles/transform-headers.html @@ -105,77 +105,77 @@

    Create multi level headers

    Prepare flextable

    -ft <- iris[1:2, ] %>% as_flextable
    +ft <- iris[1:2, ] %>% flextable
     ft
    - - + +
    - - - - - + + + + + - - - - - + + + + + - - - - - + + + + +

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    Species

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    Species

    5.1

    3.5

    1.4

    0.2

    setosa

    5.1

    3.5

    1.4

    0.2

    setosa

    4.9

    3.0

    1.4

    0.2

    setosa

    4.9

    3.0

    1.4

    0.2

    setosa

    -

    Separate headers +

    Split headers

    -

    The separate_header() function generates multi-level +

    The split_header() function generates multi-level headers by separating original headers (row names) by delimiters.

    +ft %>% split_header()
    - - + +
    - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + +

    Sepal

    Sepal

    Petal

    Petal

    Species

    Sepal

    Sepal

    Petal

    Petal

    Species

    Length

    Width

    Length

    Width

    Length

    Width

    Length

    Width

    5.1

    3.5

    1.4

    0.2

    setosa

    5.1

    3.5

    1.4

    0.2

    setosa

    4.9

    3.0

    1.4

    0.2

    setosa

    4.9

    3.0

    1.4

    0.2

    setosa

    @@ -184,47 +184,47 @@

    Separate headers. and _. Let’s see what happens when seop = "e"

    +ft %>% split_header(sep = "e")

    - - + +
    - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + +

    S

    S

    P

    P

    Sp

    S

    S

    P

    P

    Sp

    pal.L

    pal.Width

    tal.L

    tal.Width

    ci

    pal.L

    pal.Width

    tal.L

    tal.Width

    ci

    ngth

    ngth

    s

    ngth

    ngth

    s

    5.1

    3.5

    1.4

    0.2

    setosa

    5.1

    3.5

    1.4

    0.2

    setosa

    4.9

    3.0

    1.4

    0.2

    setosa

    4.9

    3.0

    1.4

    0.2

    setosa

    @@ -234,41 +234,41 @@

    Separate headersSpan headers

    The span_header() function also generates multi-level -headers. Unlike the separate_header() function, the +headers. Unlike the split_header() function, the span_header() function merges adjacent headers if they have same values.

    - - + +
    - - - + + + - - - - + + + + - - - - - + + + + + - - - - - + + + + +

    Sepal

    Petal

    Species

    Sepal

    Petal

    Species

    Length

    Width

    Length

    Width

    Length

    Width

    Length

    Width

    5.1

    3.5

    1.4

    0.2

    setosa

    5.1

    3.5

    1.4

    0.2

    setosa

    4.9

    3.0

    1.4

    0.2

    setosa

    4.9

    3.0

    1.4

    0.2

    setosa

    diff --git a/docs/news/index.html b/docs/news/index.html index 05463fa..93b731f 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -64,7 +64,13 @@

    Changelog

    - + +
    • Deprecated functions masking the corresponding ones from the flextable package (#95)

    • +
    • Renamed separate_header to split_header (#95)

    • +
    • Fixed a wrong escape regex in the sep parameter of split_header, span_header, and separate_header (#95)

    • +
    +
    +
    • Fix footnote_options not controlling reference symbols correctly. Formerly, only symbols in the cells used the prefix and the suffix arguments. Now, footnote texts also respects them (#88).

    • Support fine controls on footnote symbols in two ways. See ?footnote_options for the details (#90).

      @@ -185,7 +191,7 @@

      New features
      • Add colformat_md() which parses markdown text in the body of the flextable object.
      • -
      • Add separate_header() which separates header into multiple rows based on regular expression.
      • +
      • Add separate_header() which separates header into multiple rows based on regular expression.
      • Add span_header() which separates header into multiple rows based on regular expression, and spans them if the adjacent values share the same value.
      • Add with_blanks() which inserts blank columns based on the semantics of dplyr::select.
      • Add as_flextable.data.frame to convert data frames to flextable.
      • diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index f57175b..2c67d72 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,9 +1,9 @@ -pandoc: 3.1.2 +pandoc: 3.1.8 pkgdown: 2.0.7 pkgdown_sha: ~ articles: format_columns: format_columns.html group-rows: group-rows.html transform-headers: transform-headers.html -last_built: 2023-05-29T00:50Z +last_built: 2023-09-19T23:56Z diff --git a/docs/reference/as_flextable_methods.html b/docs/reference/as_flextable_methods.html index b22c30c..a4fa7cd 100644 --- a/docs/reference/as_flextable_methods.html +++ b/docs/reference/as_flextable_methods.html @@ -150,14 +150,17 @@

        Examples

        dplyr::slice(1, 2) as_flextable(grouped_df, groups_to = "titles") -

        Sepal.Length

        Sepal.Width

        Petal.Length

        Petal.Width

        Species: setosa

        5.1

        3.5

        1.4

        0.2

        4.9

        3.0

        1.4

        0.2

        Species: versicolor

        7.0

        3.2

        4.7

        1.4

        6.4

        3.2

        4.5

        1.5

        Species: virginica

        6.3

        3.3

        6.0

        2.5

        5.8

        2.7

        5.1

        1.9

        as_flextable(grouped_df, groups_to = "titles", hide_grouplabel = TRUE) -

        Sepal.Length

        Sepal.Width

        Petal.Length

        Petal.Width

        setosa

        5.1

        3.5

        1.4

        0.2

        4.9

        3.0

        1.4

        0.2

        versicolor

        7.0

        3.2

        4.7

        1.4

        6.4

        3.2

        4.5

        1.5

        virginica

        6.3

        3.3

        6.0

        2.5

        5.8

        2.7

        5.1

        1.9

        as_flextable(grouped_df, groups_to = "merged") -

        Species

        Sepal.Length

        Sepal.Width

        Petal.Length

        Petal.Width

        setosa

        5.1

        3.5

        1.4

        0.2

        4.9

        3.0

        1.4

        0.2

        versicolor

        7.0

        3.2

        4.7

        1.4

        6.4

        3.2

        4.5

        1.5

        virginica

        6.3

        3.3

        6.0

        2.5

        5.8

        2.7

        5.1

        1.9

        as_flextable(grouped_df, groups_to = "asis") -

        Sepal.Length

        Sepal.Width

        Petal.Length

        Petal.Width

        Species

        5.1

        3.5

        1.4

        0.2

        setosa

        4.9

        3.0

        1.4

        0.2

        setosa

        7.0

        3.2

        4.7

        1.4

        versicolor

        6.4

        3.2

        4.5

        1.5

        versicolor

        6.3

        3.3

        6.0

        2.5

        virginica

        5.8

        2.7

        5.1

        1.9

        virginica

        # For data.frame +

        Sepal.Length

        Sepal.Width

        Petal.Length

        Petal.Width

        Species: setosa

        5.1

        3.5

        1.4

        0.2

        4.9

        3.0

        1.4

        0.2

        Species: versicolor

        7.0

        3.2

        4.7

        1.4

        6.4

        3.2

        4.5

        1.5

        Species: virginica

        6.3

        3.3

        6.0

        2.5

        5.8

        2.7

        5.1

        1.9

        as_flextable(grouped_df, groups_to = "titles", hide_grouplabel = TRUE) +

        Sepal.Length

        Sepal.Width

        Petal.Length

        Petal.Width

        setosa

        5.1

        3.5

        1.4

        0.2

        4.9

        3.0

        1.4

        0.2

        versicolor

        7.0

        3.2

        4.7

        1.4

        6.4

        3.2

        4.5

        1.5

        virginica

        6.3

        3.3

        6.0

        2.5

        5.8

        2.7

        5.1

        1.9

        as_flextable(grouped_df, groups_to = "merged") +#> Warning: ftExtra:::as_flextable.data.frame is deprecated and will be removed in the future release. Consider using flextalbe's implementation by running `.S3method("as_flextable", "data.frame", flextable:::as_flextable.data.frame)` +

        Species

        Sepal.Length

        Sepal.Width

        Petal.Length

        Petal.Width

        setosa

        5.1

        3.5

        1.4

        0.2

        4.9

        3.0

        1.4

        0.2

        versicolor

        7.0

        3.2

        4.7

        1.4

        6.4

        3.2

        4.5

        1.5

        virginica

        6.3

        3.3

        6.0

        2.5

        5.8

        2.7

        5.1

        1.9

        as_flextable(grouped_df, groups_to = "asis") +#> Warning: ftExtra:::as_flextable.data.frame is deprecated and will be removed in the future release. Consider using flextalbe's implementation by running `.S3method("as_flextable", "data.frame", flextable:::as_flextable.data.frame)` +

        Sepal.Length

        Sepal.Width

        Petal.Length

        Petal.Width

        Species

        5.1

        3.5

        1.4

        0.2

        setosa

        4.9

        3.0

        1.4

        0.2

        setosa

        7.0

        3.2

        4.7

        1.4

        versicolor

        6.4

        3.2

        4.5

        1.5

        versicolor

        6.3

        3.3

        6.0

        2.5

        virginica

        5.8

        2.7

        5.1

        1.9

        virginica

        # For data.frame iris %>% head() %>% as_flextable() -

        Sepal.Length

        Sepal.Width

        Petal.Length

        Petal.Width

        Species

        5.1

        3.5

        1.4

        0.2

        setosa

        4.9

        3.0

        1.4

        0.2

        setosa

        4.7

        3.2

        1.3

        0.2

        setosa

        4.6

        3.1

        1.5

        0.2

        setosa

        5.0

        3.6

        1.4

        0.2

        setosa

        5.4

        3.9

        1.7

        0.4

        setosa

    +#> Warning: ftExtra:::as_flextable.data.frame is deprecated and will be removed in the future release. Consider using flextalbe's implementation by running `.S3method("as_flextable", "data.frame", flextable:::as_flextable.data.frame)` +

    Sepal.Length

    Sepal.Width

    Petal.Length

    Petal.Width

    Species

    5.1

    3.5

    1.4

    0.2

    setosa

    4.9

    3.0

    1.4

    0.2

    setosa

    4.7

    3.2

    1.3

    0.2

    setosa

    4.6

    3.1

    1.5

    0.2

    setosa

    5.0

    3.6

    1.4

    0.2

    setosa

    5.4

    3.9

    1.7

    0.4

    setosa

    +

    x

    foo bar

    baz

    *qux*

    +

    x

    y

    z

    bold

    superscript

    ftExtra is

    italic

    subscript

    Cool

    -
    span_header(x, sep = "[_\\.]", theme_fun = NULL, ...)
    +
    span_header(x, sep = "[_.]", theme_fun = NULL, ...)
    @@ -99,13 +99,17 @@

    Arguments

    Passed to theme_fun

    +
    +

    Note

    +

    split_header is a rename of separate_header and the latter will be removed in the future release.

    +

    Examples

    iris %>%
    -  as_flextable() %>%
    +  flextable() %>%
       span_header()
    -

    Sepal

    Petal

    Species

    Length

    Width

    Length

    Width

    5.1

    3.5

    1.4

    0.2

    setosa

    4.9

    3.0

    1.4

    0.2

    setosa

    4.7

    3.2

    1.3

    0.2

    setosa

    4.6

    3.1

    1.5

    0.2

    setosa

    5.0

    3.6

    1.4

    0.2

    setosa

    5.4

    3.9

    1.7

    0.4

    setosa

    4.6

    3.4

    1.4

    0.3

    setosa

    5.0

    3.4

    1.5

    0.2

    setosa

    4.4

    2.9

    1.4

    0.2

    setosa

    4.9

    3.1

    1.5

    0.1

    setosa

    5.4

    3.7

    1.5

    0.2

    setosa

    4.8

    3.4

    1.6

    0.2

    setosa

    4.8

    3.0

    1.4

    0.1

    setosa

    4.3

    3.0

    1.1

    0.1

    setosa

    5.8

    4.0

    1.2

    0.2

    setosa

    5.7

    4.4

    1.5

    0.4

    setosa

    5.4

    3.9

    1.3

    0.4

    setosa

    5.1

    3.5

    1.4

    0.3

    setosa

    5.7

    3.8

    1.7

    0.3

    setosa

    5.1

    3.8

    1.5

    0.3

    setosa

    5.4

    3.4

    1.7

    0.2

    setosa

    5.1

    3.7

    1.5

    0.4

    setosa

    4.6

    3.6

    1.0

    0.2

    setosa

    5.1

    3.3

    1.7

    0.5

    setosa

    4.8

    3.4

    1.9

    0.2

    setosa

    5.0

    3.0

    1.6

    0.2

    setosa

    5.0

    3.4

    1.6

    0.4

    setosa

    5.2

    3.5

    1.5

    0.2

    setosa

    5.2

    3.4

    1.4

    0.2

    setosa

    4.7

    3.2

    1.6

    0.2

    setosa

    4.8

    3.1

    1.6

    0.2

    setosa

    5.4

    3.4

    1.5

    0.4

    setosa

    5.2

    4.1

    1.5

    0.1

    setosa

    5.5

    4.2

    1.4

    0.2

    setosa

    4.9

    3.1

    1.5

    0.2

    setosa

    5.0

    3.2

    1.2

    0.2

    setosa

    5.5

    3.5

    1.3

    0.2

    setosa

    4.9

    3.6

    1.4

    0.1

    setosa

    4.4

    3.0

    1.3

    0.2

    setosa

    5.1

    3.4

    1.5

    0.2

    setosa

    5.0

    3.5

    1.3

    0.3

    setosa

    4.5

    2.3

    1.3

    0.3

    setosa

    4.4

    3.2

    1.3

    0.2

    setosa

    5.0

    3.5

    1.6

    0.6

    setosa

    5.1

    3.8

    1.9

    0.4

    setosa

    4.8

    3.0

    1.4

    0.3

    setosa

    5.1

    3.8

    1.6

    0.2

    setosa

    4.6

    3.2

    1.4

    0.2

    setosa

    5.3

    3.7

    1.5

    0.2

    setosa

    5.0

    3.3

    1.4

    0.2

    setosa

    7.0

    3.2

    4.7

    1.4

    versicolor

    6.4

    3.2

    4.5

    1.5

    versicolor

    6.9

    3.1

    4.9

    1.5

    versicolor

    5.5

    2.3

    4.0

    1.3

    versicolor

    6.5

    2.8

    4.6

    1.5

    versicolor

    5.7

    2.8

    4.5

    1.3

    versicolor

    6.3

    3.3

    4.7

    1.6

    versicolor

    4.9

    2.4

    3.3

    1.0

    versicolor

    6.6

    2.9

    4.6

    1.3

    versicolor

    5.2

    2.7

    3.9

    1.4

    versicolor

    5.0

    2.0

    3.5

    1.0

    versicolor

    5.9

    3.0

    4.2

    1.5

    versicolor

    6.0

    2.2

    4.0

    1.0

    versicolor

    6.1

    2.9

    4.7

    1.4

    versicolor

    5.6

    2.9

    3.6

    1.3

    versicolor

    6.7

    3.1

    4.4

    1.4

    versicolor

    5.6

    3.0

    4.5

    1.5

    versicolor

    5.8

    2.7

    4.1

    1.0

    versicolor

    6.2

    2.2

    4.5

    1.5

    versicolor

    5.6

    2.5

    3.9

    1.1

    versicolor

    5.9

    3.2

    4.8

    1.8

    versicolor

    6.1

    2.8

    4.0

    1.3

    versicolor

    6.3

    2.5

    4.9

    1.5

    versicolor

    6.1

    2.8

    4.7

    1.2

    versicolor

    6.4

    2.9

    4.3

    1.3

    versicolor

    6.6

    3.0

    4.4

    1.4

    versicolor

    6.8

    2.8

    4.8

    1.4

    versicolor

    6.7

    3.0

    5.0

    1.7

    versicolor

    6.0

    2.9

    4.5

    1.5

    versicolor

    5.7

    2.6

    3.5

    1.0

    versicolor

    5.5

    2.4

    3.8

    1.1

    versicolor

    5.5

    2.4

    3.7

    1.0

    versicolor

    5.8

    2.7

    3.9

    1.2

    versicolor

    6.0

    2.7

    5.1

    1.6

    versicolor

    5.4

    3.0

    4.5

    1.5

    versicolor

    6.0

    3.4

    4.5

    1.6

    versicolor

    6.7

    3.1

    4.7

    1.5

    versicolor

    6.3

    2.3

    4.4

    1.3

    versicolor

    5.6

    3.0

    4.1

    1.3

    versicolor

    5.5

    2.5

    4.0

    1.3

    versicolor

    5.5

    2.6

    4.4

    1.2

    versicolor

    6.1

    3.0

    4.6

    1.4

    versicolor

    5.8

    2.6

    4.0

    1.2

    versicolor

    5.0

    2.3

    3.3

    1.0

    versicolor

    5.6

    2.7

    4.2

    1.3

    versicolor

    5.7

    3.0

    4.2

    1.2

    versicolor

    5.7

    2.9

    4.2

    1.3

    versicolor

    6.2

    2.9

    4.3

    1.3

    versicolor

    5.1

    2.5

    3.0

    1.1

    versicolor

    5.7

    2.8

    4.1

    1.3

    versicolor

    6.3

    3.3

    6.0

    2.5

    virginica

    5.8

    2.7

    5.1

    1.9

    virginica

    7.1

    3.0

    5.9

    2.1

    virginica

    6.3

    2.9

    5.6

    1.8

    virginica

    6.5

    3.0

    5.8

    2.2

    virginica

    7.6

    3.0

    6.6

    2.1

    virginica

    4.9

    2.5

    4.5

    1.7

    virginica

    7.3

    2.9

    6.3

    1.8

    virginica

    6.7

    2.5

    5.8

    1.8

    virginica

    7.2

    3.6

    6.1

    2.5

    virginica

    6.5

    3.2

    5.1

    2.0

    virginica

    6.4

    2.7

    5.3

    1.9

    virginica

    6.8

    3.0

    5.5

    2.1

    virginica

    5.7

    2.5

    5.0

    2.0

    virginica

    5.8

    2.8

    5.1

    2.4

    virginica

    6.4

    3.2

    5.3

    2.3

    virginica

    6.5

    3.0

    5.5

    1.8

    virginica

    7.7

    3.8

    6.7

    2.2

    virginica

    7.7

    2.6

    6.9

    2.3

    virginica

    6.0

    2.2

    5.0

    1.5

    virginica

    6.9

    3.2

    5.7

    2.3

    virginica

    5.6

    2.8

    4.9

    2.0

    virginica

    7.7

    2.8

    6.7

    2.0

    virginica

    6.3

    2.7

    4.9

    1.8

    virginica

    6.7

    3.3

    5.7

    2.1

    virginica

    7.2

    3.2

    6.0

    1.8

    virginica

    6.2

    2.8

    4.8

    1.8

    virginica

    6.1

    3.0

    4.9

    1.8

    virginica

    6.4

    2.8

    5.6

    2.1

    virginica

    7.2

    3.0

    5.8

    1.6

    virginica

    7.4

    2.8

    6.1

    1.9

    virginica

    7.9

    3.8

    6.4

    2.0

    virginica

    6.4

    2.8

    5.6

    2.2

    virginica

    6.3

    2.8

    5.1

    1.5

    virginica

    6.1

    2.6

    5.6

    1.4

    virginica

    7.7

    3.0

    6.1

    2.3

    virginica

    6.3

    3.4

    5.6

    2.4

    virginica

    6.4

    3.1

    5.5

    1.8

    virginica

    6.0

    3.0

    4.8

    1.8

    virginica

    6.9

    3.1

    5.4

    2.1

    virginica

    6.7

    3.1

    5.6

    2.4

    virginica

    6.9

    3.1

    5.1

    2.3

    virginica

    5.8

    2.7

    5.1

    1.9

    virginica

    6.8

    3.2

    5.9

    2.3

    virginica

    6.7

    3.3

    5.7

    2.5

    virginica

    6.7

    3.0

    5.2

    2.3

    virginica

    6.3

    2.5

    5.0

    1.9

    virginica

    6.5

    3.0

    5.2

    2.0

    virginica

    6.2

    3.4

    5.4

    2.3

    virginica

    5.9

    3.0

    5.1

    1.8

    virginica

    +

    Sepal

    Petal

    Species

    Length

    Width

    Length

    Width

    5.1

    3.5

    1.4

    0.2

    setosa

    4.9

    3.0

    1.4

    0.2

    setosa

    4.7

    3.2

    1.3

    0.2

    setosa

    4.6

    3.1

    1.5

    0.2

    setosa

    5.0

    3.6

    1.4

    0.2

    setosa

    5.4

    3.9

    1.7

    0.4

    setosa

    4.6

    3.4

    1.4

    0.3

    setosa

    5.0

    3.4

    1.5

    0.2

    setosa

    4.4

    2.9

    1.4

    0.2

    setosa

    4.9

    3.1

    1.5

    0.1

    setosa

    5.4

    3.7

    1.5

    0.2

    setosa

    4.8

    3.4

    1.6

    0.2

    setosa

    4.8

    3.0

    1.4

    0.1

    setosa

    4.3

    3.0

    1.1

    0.1

    setosa

    5.8

    4.0

    1.2

    0.2

    setosa

    5.7

    4.4

    1.5

    0.4

    setosa

    5.4

    3.9

    1.3

    0.4

    setosa

    5.1

    3.5

    1.4

    0.3

    setosa

    5.7

    3.8

    1.7

    0.3

    setosa

    5.1

    3.8

    1.5

    0.3

    setosa

    5.4

    3.4

    1.7

    0.2

    setosa

    5.1

    3.7

    1.5

    0.4

    setosa

    4.6

    3.6

    1.0

    0.2

    setosa

    5.1

    3.3

    1.7

    0.5

    setosa

    4.8

    3.4

    1.9

    0.2

    setosa

    5.0

    3.0

    1.6

    0.2

    setosa

    5.0

    3.4

    1.6

    0.4

    setosa

    5.2

    3.5

    1.5

    0.2

    setosa

    5.2

    3.4

    1.4

    0.2

    setosa

    4.7

    3.2

    1.6

    0.2

    setosa

    4.8

    3.1

    1.6

    0.2

    setosa

    5.4

    3.4

    1.5

    0.4

    setosa

    5.2

    4.1

    1.5

    0.1

    setosa

    5.5

    4.2

    1.4

    0.2

    setosa

    4.9

    3.1

    1.5

    0.2

    setosa

    5.0

    3.2

    1.2

    0.2

    setosa

    5.5

    3.5

    1.3

    0.2

    setosa

    4.9

    3.6

    1.4

    0.1

    setosa

    4.4

    3.0

    1.3

    0.2

    setosa

    5.1

    3.4

    1.5

    0.2

    setosa

    5.0

    3.5

    1.3

    0.3

    setosa

    4.5

    2.3

    1.3

    0.3

    setosa

    4.4

    3.2

    1.3

    0.2

    setosa

    5.0

    3.5

    1.6

    0.6

    setosa

    5.1

    3.8

    1.9

    0.4

    setosa

    4.8

    3.0

    1.4

    0.3

    setosa

    5.1

    3.8

    1.6

    0.2

    setosa

    4.6

    3.2

    1.4

    0.2

    setosa

    5.3

    3.7

    1.5

    0.2

    setosa

    5.0

    3.3

    1.4

    0.2

    setosa

    7.0

    3.2

    4.7

    1.4

    versicolor

    6.4

    3.2

    4.5

    1.5

    versicolor

    6.9

    3.1

    4.9

    1.5

    versicolor

    5.5

    2.3

    4.0

    1.3

    versicolor

    6.5

    2.8

    4.6

    1.5

    versicolor

    5.7

    2.8

    4.5

    1.3

    versicolor

    6.3

    3.3

    4.7

    1.6

    versicolor

    4.9

    2.4

    3.3

    1.0

    versicolor

    6.6

    2.9

    4.6

    1.3

    versicolor

    5.2

    2.7

    3.9

    1.4

    versicolor

    5.0

    2.0

    3.5

    1.0

    versicolor

    5.9

    3.0

    4.2

    1.5

    versicolor

    6.0

    2.2

    4.0

    1.0

    versicolor

    6.1

    2.9

    4.7

    1.4

    versicolor

    5.6

    2.9

    3.6

    1.3

    versicolor

    6.7

    3.1

    4.4

    1.4

    versicolor

    5.6

    3.0

    4.5

    1.5

    versicolor

    5.8

    2.7

    4.1

    1.0

    versicolor

    6.2

    2.2

    4.5

    1.5

    versicolor

    5.6

    2.5

    3.9

    1.1

    versicolor

    5.9

    3.2

    4.8

    1.8

    versicolor

    6.1

    2.8

    4.0

    1.3

    versicolor

    6.3

    2.5

    4.9

    1.5

    versicolor

    6.1

    2.8

    4.7

    1.2

    versicolor

    6.4

    2.9

    4.3

    1.3

    versicolor

    6.6

    3.0

    4.4

    1.4

    versicolor

    6.8

    2.8

    4.8

    1.4

    versicolor

    6.7

    3.0

    5.0

    1.7

    versicolor

    6.0

    2.9

    4.5

    1.5

    versicolor

    5.7

    2.6

    3.5

    1.0

    versicolor

    5.5

    2.4

    3.8

    1.1

    versicolor

    5.5

    2.4

    3.7

    1.0

    versicolor

    5.8

    2.7

    3.9

    1.2

    versicolor

    6.0

    2.7

    5.1

    1.6

    versicolor

    5.4

    3.0

    4.5

    1.5

    versicolor

    6.0

    3.4

    4.5

    1.6

    versicolor

    6.7

    3.1

    4.7

    1.5

    versicolor

    6.3

    2.3

    4.4

    1.3

    versicolor

    5.6

    3.0

    4.1

    1.3

    versicolor

    5.5

    2.5

    4.0

    1.3

    versicolor

    5.5

    2.6

    4.4

    1.2

    versicolor

    6.1

    3.0

    4.6

    1.4

    versicolor

    5.8

    2.6

    4.0

    1.2

    versicolor

    5.0

    2.3

    3.3

    1.0

    versicolor

    5.6

    2.7

    4.2

    1.3

    versicolor

    5.7

    3.0

    4.2

    1.2

    versicolor

    5.7

    2.9

    4.2

    1.3

    versicolor

    6.2

    2.9

    4.3

    1.3

    versicolor

    5.1

    2.5

    3.0

    1.1

    versicolor

    5.7

    2.8

    4.1

    1.3

    versicolor

    6.3

    3.3

    6.0

    2.5

    virginica

    5.8

    2.7

    5.1

    1.9

    virginica

    7.1

    3.0

    5.9

    2.1

    virginica

    6.3

    2.9

    5.6

    1.8

    virginica

    6.5

    3.0

    5.8

    2.2

    virginica

    7.6

    3.0

    6.6

    2.1

    virginica

    4.9

    2.5

    4.5

    1.7

    virginica

    7.3

    2.9

    6.3

    1.8

    virginica

    6.7

    2.5

    5.8

    1.8

    virginica

    7.2

    3.6

    6.1

    2.5

    virginica

    6.5

    3.2

    5.1

    2.0

    virginica

    6.4

    2.7

    5.3

    1.9

    virginica

    6.8

    3.0

    5.5

    2.1

    virginica

    5.7

    2.5

    5.0

    2.0

    virginica

    5.8

    2.8

    5.1

    2.4

    virginica

    6.4

    3.2

    5.3

    2.3

    virginica

    6.5

    3.0

    5.5

    1.8

    virginica

    7.7

    3.8

    6.7

    2.2

    virginica

    7.7

    2.6

    6.9

    2.3

    virginica

    6.0

    2.2

    5.0

    1.5

    virginica

    6.9

    3.2

    5.7

    2.3

    virginica

    5.6

    2.8

    4.9

    2.0

    virginica

    7.7

    2.8

    6.7

    2.0

    virginica

    6.3

    2.7

    4.9

    1.8

    virginica

    6.7

    3.3

    5.7

    2.1

    virginica

    7.2

    3.2

    6.0

    1.8

    virginica

    6.2

    2.8

    4.8

    1.8

    virginica

    6.1

    3.0

    4.9

    1.8

    virginica

    6.4

    2.8

    5.6

    2.1

    virginica

    7.2

    3.0

    5.8

    1.6

    virginica

    7.4

    2.8

    6.1

    1.9

    virginica

    7.9

    3.8

    6.4

    2.0

    virginica

    6.4

    2.8

    5.6

    2.2

    virginica

    6.3

    2.8

    5.1

    1.5

    virginica

    6.1

    2.6

    5.6

    1.4

    virginica

    7.7

    3.0

    6.1

    2.3

    virginica

    6.3

    3.4

    5.6

    2.4

    virginica

    6.4

    3.1

    5.5

    1.8

    virginica

    6.0

    3.0

    4.8

    1.8

    virginica

    6.9

    3.1

    5.4

    2.1

    virginica

    6.7

    3.1

    5.6

    2.4

    virginica

    6.9

    3.1

    5.1

    2.3

    virginica

    5.8

    2.7

    5.1

    1.9

    virginica

    6.8

    3.2

    5.9

    2.3

    virginica

    6.7

    3.3

    5.7

    2.5

    virginica

    6.7

    3.0

    5.2

    2.3

    virginica

    6.3

    2.5

    5.0

    1.9

    virginica

    6.5

    3.0

    5.2

    2.0

    virginica

    6.2

    3.4

    5.4

    2.3

    virginica

    5.9

    3.0

    5.1

    1.8

    virginica