一切正常,直到几分钟前。以下是数据集的示例。
silence<-suppressWarnings
silence(library(tidyverse))
silence(library(nycflights13))
UAdaily<-flights %>%
filter(carrier=="UA")
我收到以下错误:
Error in filter.default(., carrier == "UA") : argument "x" is missing, with no default
这也发生在我应该使用的数据集中。可能是什么问题?
这是traceback call
10: filter.default(., carrier == "UA")
9: filter(., carrier == "UA")
8: function_list[[k]](value)
7: withVisible(function_list[[k]](value))
6: freduce(value, `_function_list`)
5: `_fseq`(`_lhs`)
4: eval(quote(`_fseq`(`_lhs`)), env, env)
3: eval(quote(`_fseq`(`_lhs`)), env, env)
2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
1: flights %>% filter(carrier == "UA")
答案 0 :(得分:1)
这个:
library(dplyr)
library(nycflights13)
data(flights)
flights %>%
filter(carrier =="UA")
# A tibble: 58,665 x 19
# year month day dep_time sched_dep_time dep_delay arr_time sched_arr_time arr_delay carrier flight tailnum
# <int> <int> <int> <int> <int> <dbl> <int> <int> <dbl> <chr> <int> <chr>
# 1 2013 1 1 517 515 2 830 819 11 UA 1545 N14228
# 2 2013 1 1 533 529 4 850 830 20 UA 1714 N24211
# 3 2013 1 1 554 558 -4 740 728 12 UA 1696 N39463
# 4 2013 1 1 558 600 -2 924 917 7 UA 194 N29129
# 5 2013 1 1 558 600 -2 923 937 -14 UA 1124 N53441
# 6 2013 1 1 559 600 -1 854 902 -8 UA 1187 N76515
# 7 2013 1 1 607 607 0 858 915 -17 UA 1077 N53442
# 8 2013 1 1 611 600 11 945 931 14 UA 303 N532UA
[…]
答案 1 :(得分:1)
问题是filter
还有另一个filter{signal}
函数。使用dplyr::filter