Finding the total amount of entries with the same value

Hey guys.
I have an assignment due tomorrow regarding Twitter API.

I have a data set which has different tweets and their information etc.

I'm trying to find out how many total of the tweets is a retweet.

There is a column header called "is_retweet" which has values either TRUE or FALSE.

I just want to write a simple piece of a code that adds up all of the TRUE values and returns an answer.

Would really appreciate some assistance.,


Hi @babyspitz, welcome to RStudio Community.

Let me give you a hint. R internally represents the boolean values TRUE and FALSE as 1 and 0 respectively. So by using the right arithmetic operator, you should be able to get your answer.

appreciate the hint.
still wouldn't know how to do it even if they were all as 1's.
have been searching google but can't find what I need.

Rather than searching Google, try and think through the problem.

You have a column is_retweet in your data frame that is represented as 1s and 0s. What happens if you total the values across the entire column?

Hello babyspitz, please familiarise yourself with FAQ: Homework Policy for the future.
In the short term, please read and try the examples here:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.