View source: R/make_sumtable.R
make_sumtable | R Documentation |
Sumtable
make_sumtable( data, .products_colname, .attributes_colname, .attribute_value_colname, .id_cols, selected_products, selected_attributes )
data |
input dataframe |
.products_colname |
products column |
.attributes_colname |
attribute names column |
.attribute_value_colname |
attribute values column |
.id_cols |
id columns |
selected_products |
vector of product names to be selected |
selected_attributes |
vector of attributes names to be selected |
c("tbl_df", "tbl", "data.frame")
data <- mtcars data$product <- rownames(data) data <- data %>% tidyr::pivot_longer(cols = -c(product, cyl)) data_transformed <- make_sumtable(data = data, .products_colname = product, .attributes_colname = name, .attribute_value_colname = value, .id_cols = -value, selected_products = c("Merc 280", "Fiat 128", "Mazda RX4"), selected_attributes = c("mpg", "disp"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.