gather_se: Distribute columns into blocks of rows.

Description Usage Arguments Value See Also Examples

View source: R/gather_se.R

Description

A standard (value-oriented) interface for gather. Take values from the columns named in the columns argument and move them into blocks of rows, placing values in the new column specified by value and indicating which column each value came from in the new column specified by key.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
gather_se(
  data,
  ...,
  key = "key",
  value = "value",
  columns = NULL,
  na.rm = FALSE,
  convert = FALSE,
  factor_key = FALSE,
  use_one_of = TRUE
)

Arguments

data

data.frame to take values from.

...

not used, force later arguments to bind by name.

key

character, name for new column to record which columns values were taken from.

value

character, name for new column to record values.

columns

character, names of columns to take values from.

na.rm

passed to gather.

convert

passed to gather.

factor_key

passed to gather.

use_one_of

logical, if TRUE use dplyr::one_of() instead of rlang:::'!!!'.

Value

converted data.

See Also

gather, spread_se

Examples

1
2
3
4
5
6
7
8
d <- wrapr::build_frame(
    'id', 'measurement1', 'measurement2' |
    1   , 'a'           , 10             |
    2   , 'b'           , 20             )
gather_se(d,
  key = "value_came_from_column",
  value = "value_was",
  columns = c("measurement1", "measurement2"))

seplyr documentation built on Sept. 5, 2021, 5:12 p.m.