Learn R Programming

mkin (version 1.2.6)

mkin_long_to_wide: Convert a dataframe from long to wide format

Description

This function takes a dataframe in the long form, i.e. with a row for each observed value, and converts it into a dataframe with one independent variable and several dependent variables as columns.

Usage

mkin_long_to_wide(long_data, time = "time", outtime = "time")

Value

Dataframe in wide format.

Arguments

long_data

The dataframe must contain one variable called "time" with the time values specified by the time argument, one column called "name" with the grouping of the observed values, and finally one column of observed values called "value".

time

The name of the time variable in the long input data.

outtime

The name of the time variable in the wide output data.

Author

Johannes Ranke

Examples

Run this code

mkin_long_to_wide(FOCUS_2006_D)

Run the code above in your browser using DataLab