LoginSignup
0
0

More than 5 years have passed since last update.

filter(., word %in% c("a", "b")) でエラー: 'filter' is longer than time series

Posted at

1.実行内容

データフレームから条件を満たす行のみを出すために、
以下のようなコードを書いた

df2 <- df %>% filter(word %in% c("a", "b"))

2.エラー内容

 filter(., word %in% c("a", "b")) でエラー: 
  'filter' is longer than time series

3.解決方法

dplyrのfilterを使用するつもりだったが、読み込まれていなかったことが原因だった。

library(dplyr)

を実行してから、1のコードを実行

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0