Skip to contents

The function removes one or more columns from a 'flextable'.

Usage

delete_columns(x, j = NULL)

Arguments

x

a flextable object

j

columns selection

Details

Deleting one or more columns will result in the deletion of any span parameters that may have been set previously. They will have to be redone after this operation or performed only after this deletion.

See also

Other functions for row and column operations in a flextable: add_body(), add_body_row(), add_footer(), add_footer_lines(), add_footer_row(), add_header(), add_header_row(), delete_part(), delete_rows(), separate_header(), set_header_footer_df, set_header_labels()

Examples

ft <- flextable(head(iris))
ft <- delete_columns(ft, j = "Species")
ft

Sepal.Length

Sepal.Width

Petal.Length

Petal.Width

5.1

3.5

1.4

0.2

4.9

3.0

1.4

0.2

4.7

3.2

1.3

0.2

4.6

3.1

1.5

0.2

5.0

3.6

1.4

0.2

5.4

3.9

1.7

0.4