S_units_from_tidy: Extract an 'S_units' matrix from a tidy data frame

View source: R/munge_utilities.R

S_units_from_tidyR Documentation

Extract an S_units matrix from a tidy data frame

Description

The .tidydf should be grouped as needed.

Usage

S_units_from_tidy(
  .tidydf,
  Product = "Product",
  Unit = "Unit",
  S_units = "S_units"
)

Arguments

.tidydf

the data frame from which an S_units matrix is to be formed

Product

the name of the Product column in .tidydf. Default is "Product".

Unit

the name of the Unit column in .tidydf. Default is "Unit".

S_units

the name of the S_units column to be added to .tidydf. Default is "S_unit".

Value

a data frame containing grouping variables and a new S_unit column

Examples

library(dplyr)
library(matsindf)
library(Recca)
UKEnergy2000tidy %>%
  group_by("Country", "Year", "Energy.type", "Last.stage") %>%
  S_units_from_tidy()

MatthewHeun/Recca documentation built on Feb. 9, 2024, 6:18 p.m.