Description Usage Arguments Value Author(s) See Also Examples
base gather mimics basic functionality of tidyr::gather
1 2 3 4 5 6 7 8 9 10 |
data |
data.frame |
key |
character, name of new key column, Default: 'key' |
value |
character, name of new value column, Default: 'value' |
columns |
column names or indicies or regex of them to gather, Default: NULL |
regex |
boolean, indicates of columns is to be treated as a regular expression, Default: FALSE |
... |
parameters to pass to grep |
na.rm |
boolean, apply na.omit to value column, Default: FALSE |
convert |
boolean, apply type.convert to key column, Default: FALSE |
data.frame
Jonathan Sidi
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | mini_iris <- iris[c(1, 51, 101), ]
# gather Sepal.Length, Sepal.Width, Petal.Length, Petal.Width
b_gather(mini_iris, key = 'flower_att', value = 'measurement',
columns = c('Sepal.Length', 'Sepal.Width', 'Petal.Length', 'Petal.Width'))
b_gather(mini_iris, key = 'flower_att', value = 'measurement',
columns = 1:4)
b_gather(mini_iris, key = 'flower_att', value = 'measurement',
columns = -5)
b_gather(mini_iris, key = 'flower_att', value = 'measurement',
columns = '^(Sepal|Petal)',regex = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.