control rows height for a part of the flextable when the line
height adjustment is "atleast" or "exact" (see hrule()).
Usage
height(x, i = NULL, height, part = "body", unit = "in")
height_all(x, height, part = "all", unit = "in")Arguments
- x
a 'flextable' object, see flextable-package to learn how to create 'flextable' object.
- i
row selector, see section Row selection with the
iparameter in <Selectors in flextable>.- height
height in inches
- part
part selector, see section Part selection with the
partparameter in <Selectors in flextable>. Value 'all' is not allowed by the function.- unit
unit for height, one of "in", "cm", "mm".
Note
This function has no effect when the rule for line height is set to
"auto" (see hrule()), which is the default case, except with PowerPoint
which does not support this automatic line height adjustment feature.
height_all
height_all is a convenient function for
setting the same height to all rows (selected
with argument part).
See also
Other functions for flextable size management:
autofit(),
dim.flextable(),
dim_pretty(),
fit_to_width(),
flextable_dim(),
hrule(),
ncol_keys(),
nrow_part(),
width()
Examples
ft_1 <- flextable(head(iris))
ft_1 <- height(ft_1, height = .5)
ft_1 <- hrule(ft_1, rule = "exact")
ft_1
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
ft_2 <- flextable(head(iris))
ft_2 <- height_all(ft_2, height = 1)
ft_2 <- hrule(ft_2, rule = "exact")
ft_2
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
