如何从一系列列表中删除同一列
How to remove from a series of list the same column
对于问题的平庸,我深表歉意。
我有一系列列表元素 - 所有元素都嵌入在同一个对象中 - 我想始终删除同一个对象:
>[13]>
$P3FCz
# A tibble: 5 x 9
model effect group term estimate std.error statistic df p.value
<chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1 fixed NA (Intercept) -1.59 0.898 -1.77 0.000000154 1.00
2 1 fixed NA CONDNEG-NOC 0.196 1.27 0.155 0.000000154 1.00
3 1 fixed NA CONDNEU-NOC 0.113 1.27 0.0890 0.000000154 1.00
4 1 ran_pars COND sd__(Intercept) 0.0822 NA NA NA NA
5 1 ran_pars Residual sd__Observation 4.47 NA NA NA NA
$P3Cz
# A tibble: 5 x 9
model effect group term estimate std.error statistic df p.value
<chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
1 10 fixed NA (Intercept) 1.12 0.739 1.52 72.0 0.132
2 10 fixed NA CONDNEG-NOC 0.372 1.04 0.356 72.0 0.723
3 10 fixed NA CONDNEU-NOC -0.0441 1.04 -0.0422 72.0 0.966
4 10 ran_pars COND sd__(Intercept) 0.190 NA NA NA NA
5 10 ran_pars Residual sd__Observation 3.57 NA NA NA NA
... and so on for other 12 elemnts
我想删除的列是 model
。有没有人可以建议如何从我通过此命令行创建的对象列表中删除它:
models_list <- out_long %>%
group_by(signals) %>%
do(fit = lmerTest::lmer(value ~ COND + (1|COND), data = .))
statistics <- purrr::map_dfr(models_list$fit, broom.mixed::tidy, .id = "model") %>%
group_split(model) %>%
setNames(sort(unique(out_long$signals)))
在此先感谢您的支持
设置参数.keep
为FALSE
如下图:
purrr::map_dfr(models_list$fit, broom.mixed::tidy, .id = "model") %>%
group_split(model, .keep = FALSE) %>%
setNames(sort(unique(out_long$signals)))
对于问题的平庸,我深表歉意。
我有一系列列表元素 - 所有元素都嵌入在同一个对象中 - 我想始终删除同一个对象:
>[13]>
$P3FCz
# A tibble: 5 x 9
model effect group term estimate std.error statistic df p.value
<chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
1 1 fixed NA (Intercept) -1.59 0.898 -1.77 0.000000154 1.00
2 1 fixed NA CONDNEG-NOC 0.196 1.27 0.155 0.000000154 1.00
3 1 fixed NA CONDNEU-NOC 0.113 1.27 0.0890 0.000000154 1.00
4 1 ran_pars COND sd__(Intercept) 0.0822 NA NA NA NA
5 1 ran_pars Residual sd__Observation 4.47 NA NA NA NA
$P3Cz
# A tibble: 5 x 9
model effect group term estimate std.error statistic df p.value
<chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
1 10 fixed NA (Intercept) 1.12 0.739 1.52 72.0 0.132
2 10 fixed NA CONDNEG-NOC 0.372 1.04 0.356 72.0 0.723
3 10 fixed NA CONDNEU-NOC -0.0441 1.04 -0.0422 72.0 0.966
4 10 ran_pars COND sd__(Intercept) 0.190 NA NA NA NA
5 10 ran_pars Residual sd__Observation 3.57 NA NA NA NA
... and so on for other 12 elemnts
我想删除的列是 model
。有没有人可以建议如何从我通过此命令行创建的对象列表中删除它:
models_list <- out_long %>%
group_by(signals) %>%
do(fit = lmerTest::lmer(value ~ COND + (1|COND), data = .))
statistics <- purrr::map_dfr(models_list$fit, broom.mixed::tidy, .id = "model") %>%
group_split(model) %>%
setNames(sort(unique(out_long$signals)))
在此先感谢您的支持
设置参数.keep
为FALSE
如下图:
purrr::map_dfr(models_list$fit, broom.mixed::tidy, .id = "model") %>%
group_split(model, .keep = FALSE) %>%
setNames(sort(unique(out_long$signals)))