This function is useful to check a data set. It gives a random number of rows of the input data set.
Examples
sample_df(iris)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 84 6.0 2.7 5.1 1.6 versicolor
#> 90 5.5 2.5 4.0 1.3 versicolor
#> 39 4.4 3.0 1.3 0.2 setosa
#> 104 6.3 2.9 5.6 1.8 virginica
#> 11 5.4 3.7 1.5 0.2 setosa
#> 123 7.7 2.8 6.7 2.0 virginica
#> 13 4.8 3.0 1.4 0.1 setosa
#> 63 6.0 2.2 4.0 1.0 versicolor
#> 20 5.1 3.8 1.5 0.3 setosa
#> 71 5.9 3.2 4.8 1.8 versicolor
sample_df(iris, previous = TRUE)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 84 6.0 2.7 5.1 1.6 versicolor
#> 90 5.5 2.5 4.0 1.3 versicolor
#> 39 4.4 3.0 1.3 0.2 setosa
#> 104 6.3 2.9 5.6 1.8 virginica
#> 11 5.4 3.7 1.5 0.2 setosa
#> 123 7.7 2.8 6.7 2.0 virginica
#> 13 4.8 3.0 1.4 0.1 setosa
#> 63 6.0 2.2 4.0 1.0 versicolor
#> 20 5.1 3.8 1.5 0.3 setosa
#> 71 5.9 3.2 4.8 1.8 versicolor