Skip to contents

Data frames in tidy format should be pivoted to wide-by-year data frames for saving as .csv files. This function does that pivoting.

Usage

pivot_for_csv(.df, val_cols, year_col = Recca::psut_cols$year, var_col = "var")

Arguments

.df

The data frame to be pivoted.

val_cols

Data columns to be swapped to the var_col. These should be variable names as a string vector.

year_col

The string name of the year column. Default is Recca::psut_cols$year.

var_col

The name of the resulting variable name column. Default is "var".

Value

The pivoted data frame.