Skip to contents

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

Usage

delete_columns(x, j = NULL)

Arguments

x

a 'flextable' object, see flextable-package to learn how to create 'flextable' object.

j

column selector, see section Column selection with the j parameter in <Selectors in flextable>.

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.

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