Sanitise a data table by restricting the number of rows or characters and rounding numeric columns.
Arguments
- x
a tibble or data.frame containing the data to be sanitised
- maxRows
the maximum number of rows with which to restrict the table size
- sigFig
the significant figures with which to round numeric columns
- maxCharacters
the maximum number of characters allowed in a string before it is truncated
Examples
sanitiseTable(iris,maxRows = 10,sigFig = 1)
#> Number of rows in table restricted to 10.
#> # A tibble: 10 × 5
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> <dbl> <dbl> <dbl> <dbl> <fct>
#> 1 5 4 1 0.2 setosa
#> 2 5 3 1 0.2 setosa
#> 3 5 3 1 0.2 setosa
#> 4 5 3 2 0.2 setosa
#> 5 5 4 1 0.2 setosa
#> 6 5 4 2 0.4 setosa
#> 7 5 3 1 0.3 setosa
#> 8 5 3 2 0.2 setosa
#> 9 4 3 1 0.2 setosa
#> 10 5 3 2 0.1 setosa