Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
6
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

Organization

RでTRUEの数を数える関数はありませんか?

条件に合うものの個数を数えたい場合があるのですが、
例えば、iris データの setosa の数を数えたいときに

R
length(which(iris[5] == "setosa"))

と書いているんですが、この length(which()) ができる一つの関数って無いんでしょうか?

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
6
Help us understand the problem. What are the problem?