This function selects several top and bottom rows of a data frame for a preview.
head_tail( obj, n = 4, format = c("f", "g", "e"), sep = "...", max_decimals = NULL, signif_digits = 3, tolerance = 2, top = n, bottom = n )
obj | A data frame. |
---|---|
n | (integer) Number of top and bottom rows to display. |
format | equal to
|
sep | (character) Separator between displayed top and bottom lines. |
max_decimals | (integer, |
signif_digits | (integer, |
tolerance | (integer) For small datasets, number of rows to show in addition to |
top | (integer) Number of top rows to display. |
bottom | (integer) Number of bottom rows to display. |
A truncated data frame (which is intended to be printed) with all variables converted to strings.
#> Fertility Agriculture Examination Education Catholic #> Courtelary 80.2 17.0 15 12 9.96 #> Delemont 83.1 45.1 6 9 84.84 #> Franches-Mnt 92.5 39.7 5 5 93.40 #> Moutier 85.8 36.5 12 7 33.77 #> ... ... ... ... ... ... #> ValdeTravers 67.6 18.7 25 7 8.65 #> V. De Geneve 35.0 1.2 37 53 42.34 #> Rive Droite 44.7 46.6 16 29 50.43 #> Rive Gauche 42.8 27.7 22 29 58.33 #> #> Infant.Mortality #> Courtelary 22.2 #> Delemont 22.2 #> Franches-Mnt 20.2 #> Moutier 20.3 #> ... ... #> ValdeTravers 19.5 #> V. De Geneve 18.0 #> Rive Droite 18.2 #> Rive Gauche 19.3 #>#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 1.4 0.2 setosa #> ... ... ... ... ... ... #> 149 6.2 3.4 5.4 2.3 virginica #> 150 5.9 3.0 5.1 1.8 virginica #>head_tail(iris[1:6, ], n = 2, tolerance = 1)#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 1.4 0.2 setosa #> ... ... ... ... ... ... #> 5 5.0 3.6 1.4 0.2 setosa #> 6 5.4 3.9 1.7 0.4 setosa #>head_tail(iris[1:6, ], n = 2, tolerance = 2)#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species #> 1 5.1 3.5 1.4 0.2 setosa #> 2 4.9 3.0 1.4 0.2 setosa #> 3 4.7 3.2 1.3 0.2 setosa #> 4 4.6 3.1 1.5 0.2 setosa #> 5 5.0 3.6 1.4 0.2 setosa #> 6 5.4 3.9 1.7 0.4 setosa #>