Description Usage Arguments Examples
The pipe_cat()
function allows messages to be output to
the console or to an external file without the need to break out
of a pipeline to do so.
1 2 3 4 5 6 7 8 9 |
data |
the data being passed through the pipeline |
... |
arguments to be passed to the |
file, sep, fill, labels, append |
See the |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | sample(100, 1) %>%
runif() %>%
pipe_cat("Current length: ", length(.), "\n") %>%
pipe_cat("Current average: ", mean(.), "\n") %>%
pipe_cat("Current standard error: ", sd(.) / length(.), "\n") %>%
pipe_cat("Returning mean:\n") %>%
mean()
tibble::tibble(
x = runif(10),
y = runif(10)
) %>%
pipe_cat("Average x: ", mean(x), "\n") %>%
pipe_cat("Current number of rows: ", nrow, "\n") %>%
dplyr::mutate(z = x + y)
palmerpenguins::penguins %>%
dplyr::mutate(species = as.character(species)) %>%
dplyr::filter(!is.na(bill_length_mm)) %>%
pipe_cat("Total average Culmen Length: ", mean(bill_length_mm), "\n") %>%
dplyr::group_by(species) %>%
pipe_cat(species, " average Culmen Length: ", mean(bill_length_mm), "\n")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.