# Create a rename block
new_rename_block(list(miles_per_gallon = "mpg", cylinders = "cyl"))
if (interactive()) {
# Basic usage with mtcars dataset
library(blockr.core)
serve(new_rename_block(), data = list(data = mtcars))
# With predefined renames
serve(
new_rename_block(list(miles_per_gallon = "mpg", cylinders = "cyl")),
data = list(data = mtcars)
)
# Connected blocks example
serve(
new_board(
blocks = list(
a = new_dataset_block(),
b = new_rename_block(list(horsepower = "hp"))
),
links = links(
from = c("a"),
to = c("b")
)
)
)
}
Run the code above in your browser using DataLab