long_to_wide: Transform data.frame from long to wide format

View source: R/long_to_wide.R

long_to_wideR Documentation

Transform data.frame from long to wide format

Description

long_to_wide transform data.frame from long to wide format

Usage

long_to_wide(
  df,
  column_with_new_names = names(df)[1],
  column_with_data = "emission",
  column_fixed,
  net
)

Arguments

df

data.frame with three column.

column_with_new_names

Character, column that has new column names

column_with_data

Character column with data

column_fixed

Character, column that will remain fixed

net

To return a sf

Value

wide data.frame.

See Also

emis_hot_td emis_cold_td wide_to_long

Examples

## Not run: 
df <- data.frame(pollutant = rep(c("CO", "propadiene", "NO2"), 10),
                 emission = vein::Emissions(1:30),
                 region = rep(letters[1:2], 15))
df
long_to_wide(df)
long_to_wide(df, column_fixed = "region")

## End(Not run)

vein documentation built on May 29, 2024, 7:20 a.m.