my_spread: Simple spread

Description Usage Arguments Value Examples

View source: R/my_spread.R

Description

Simple spread

Usage

1

Arguments

d

data frame containing columns named x`` (quantitative) and g“ (categorical)

Value

"wide" data frame with g spread, carrying along the values of x. There needs to be another variable indicating which row should contain the result.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
requireNamespace("tibble", quietly = TRUE)
dd=tibble::tribble(
~r, ~x, ~g,
1, 10, "a",
2, 12, "a",
3, 14, "a",
1, 15, "b",
2, 17, "b",
3, 19, "b"
)
my_spread(dd)

nxskok/thingyyy documentation built on May 26, 2019, 10:35 a.m.