tcol {easyr}R Documentation

Transpose at Column.

Description

Transpose operation that sets column names equal to a column in the original data. Author: Bryce Chamberlain.

Usage

tcol(x, header, cols.colname = "col", do.atype = TRUE)

Arguments

x

Data frame to be transposed.

header

Column name/number to be used as column names of transposed data.

cols.colname

Name to use for the column of column names in the transposed data.

do.atype

Transpose convertes to strings, since data types are uncertain. Run atype to automatically correct variable typing where possible. This will slow the result a bit.

Value

Transposed data frame.

Examples

 # create a summary dataset from iris.
 x = dplyr::summarize_at( 
  dplyr::group_by( iris, Species ), 
  dplyr::vars( Sepal.Length, Sepal.Width ), list(sum) 
 )
 # run tcol
 tcol( x, 'Species' )

[Package easyr version 0.5-11 Index]