Description Usage Arguments Value Examples
standardized a variable of dataframe after chop first pitch, and discard last pitch when last pitch was less than second-to-last within each group
1 | chop_standard_at(.data, .var, .group, .pitch)
|
.data |
data.frame, must contain '.var', '.group' and '.pitch' variables |
.var |
specify the variables which to be standardized |
.group |
group variable contained in .data |
.pitch |
pitch variable contained in .data, each group have same pitch serial, for example, "p0, p10, p20, ... p100" |
standardized data.frame
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | library(tidyverse)
library(easyuse)
data(ChineseTones)
d <- ChineseTones
m <- d %>%
group_by(type) %>%
summarise_if(is.numeric, mean) %>%
modify_at(vars(starts_with("p")), log10)
ld <- m %>%
pivot_longer(
cols = starts_with("p"),
names_to = "id",
values_to = "value"
) %>%
mutate(time = 1000 * time * seq(0, 1, by = 0.1))
ld %>%
chop_standard_at(.var = value, .group = type, .pitch = id)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.