Skip to contents

Tidy-printing of the code attached to an object

Usage

print_code(x, ...)

Arguments

x

a dataframe with code attached

...

additional arguments passed to tidy_all_code()

Value

Called for side-effect of printing code to the console.

Examples

iris_agg <- aggregate_data(iris, group_vars = "Species", summaries = "mean")
print_code(iris_agg)
#> iris |>
#>     dplyr::group_by(Species) |>
#>     dplyr::summarise(
#>         Sepal.Length_mean = mean(Sepal.Length,
#>             na.rm = TRUE
#>         ),
#>         Sepal.Width_mean = mean(Sepal.Width,
#>             na.rm = TRUE
#>         ),
#>         Petal.Length_mean = mean(Petal.Length,
#>             na.rm = TRUE
#>         ),
#>         Petal.Width_mean = mean(Petal.Width,
#>             na.rm = TRUE
#>         ),
#>         .groups = "drop"
#>     )
#>