データフレーム「foo」が与えられた場合、「foo」からそれらの行のみを選択するにはどうすればよいfoo$location = "there"
ですか。
foo = data.frame(location = c("here", "there", "here", "there", "where"), x = 1:5, y = 6:10)
foo
# location x y
# 1 here 1 6
# 2 there 2 7
# 3 here 3 8
# 4 there 4 9
# 5 where 5 10
望ましい結果、「バー」:
# location x y
# 2 there 2 7
# 4 there 4 9