pipe_new | R Documentation |
A new pipeline is always initialized with one 'data' step, which basically is a function returning the data.
pipe_new(name, data = NULL, logger = NULL)
name |
the name of the Pipeline |
data |
optional data used at the start of the pipeline. The
data also can be set later using the |
logger |
custom logger to be used for logging. If no logger is provided, the default logger is used, which should be sufficient for most use cases. If you do want to use your own custom log function, you need to provide a function that obeys the following form:
The Note that with the default logger, the log layout can be altered
any time via |
returns the Pipeline
object invisibly
data <- data.frame(x = 1:2, y = 3:4)
p <- pipe_new("myPipe", data = data)
p |> pipe_run() |> pipe_get_out("data")
# Setting data later
p <- pipe_new("myPipe")
pipe_get_data(p)
p <- pipe_set_data(p, data)
pipe_get_data(p)
p |> pipe_run() |> pipe_get_out("data")
# Initialize with custom logger
my_logger <- function(level, msg, ...) {
cat(level, msg, "\n")
}
p <- pipe_new("myPipe", data = data, logger = my_logger)
p |> pipe_run() |> pipe_get_out("data")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.