I have list()data. I want to apply dplyr filter()to all of them.
list()
dplyr
filter()
Sample code of what I have tried so far ...
require(dplyr) list.DFs <- list(df1,df2) lapply( X = list.DFS, FUN = filter(Gold.fish.count=="Total") )
But it gives an error: Object 'Gold.fish.count' not found.
Object 'Gold.fish.count' not found
Using purrr
purrr
library(purrr) map(list.DFs, ~filter(.x, Gold.fish.count == "Total"))
Obviously, you can do the same with lapply:
lapply(list.DFs, function(x) filter(x, Gold.fish.count == "Total"))
Source: https://habr.com/ru/post/1672655/More articles:Как заставить .NET Core MSBuild не генерировать пустую сборку для проекта metapackage - msbuildSetting default values for a method - ruby | fooobar.comClion sort include statements - clionBootstrap 4 tabs - the first panel not shown on pageload - twitter-bootstrap-4Как разрешить дублирование запросов LINQ to Entity, когда запросы отличаются только свойством? - c#https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1672656/passing-variables-to-ansible-roles&usg=ALkJrhh31AgHWxYoyWSJbix7PrxB87xHmgМожет ли компонент удалить свой собственный шаблон и вернуть его условно? - angularHow does the compiler handle case statements? - switch-statementhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1672659/ansible-passing-variables-to-roles&usg=ALkJrhimpk8V6i5zmAcvx8RXUh2BjyxvQwFilling a parent outlet in Angular2 - angularAll Articles