How to use Aggregate function in R

0 votes
can anyone please help me with how to properly use an aggregate function in R?
Jun 13, 2022 in Data Analytics by Avinash
• 1,260 points
577 views

1 answer to this question.

0 votes
Where dat is the name of your matrix, use aggregate(FLOWS SPORT, dat, function(x) sum(as.numeric(x))).

Here, everything serves a purpose.

The second column must be converted into integers using numeric.
answered Jun 24, 2022 by Sohail
• 3,040 points

Related Questions In Data Analytics

0 votes
1 answer
0 votes
2 answers

How to use group by for multiple columns in dplyr, using string vector input in R?

data = data.frame(   zzz11def = sample(LETTERS[1:3], 100, replace=TRUE),   zbc123qws1 ...READ MORE

answered Aug 6, 2019 in Data Analytics by anonymous
14,055 views
+1 vote
2 answers

Which function can I use to clear the console in R and RStudio ?

Description                   Windows & Linux           Mac Clear console                      Ctrl+L ...READ MORE

answered Apr 17, 2018 in Data Analytics by anonymous
81,401 views
0 votes
1 answer

How to write a custom function which will replace all the missing values in a vector with the mean of values in R?

Consider this vector: a<-c(1,2,3,NA,4,5,NA,NA) Write the function to impute ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,750 points
4,516 views
+1 vote
1 answer

How can I use which() function in R ?

which() function determines the position of elements ...READ MORE

answered Sep 25, 2018 in Data Analytics by Daisy
• 8,140 points
7,446 views
0 votes
0 answers

How to use the where clause in R programming?

I'm trying to implement a where clause ...READ MORE

Dec 24, 2018 in Data Analytics by Sophie may
• 10,620 points
4,197 views
0 votes
1 answer

How to make points transparent using plot function in R?

There is no attribute to set the ...READ MORE

answered Oct 14, 2019 in Data Analytics by Cherukuri
• 33,030 points
2,187 views
0 votes
1 answer

How to use regular expressions in R?

Set of operators to use for regular ...READ MORE

answered Nov 2, 2019 in Data Analytics by anonymous
• 33,030 points
635 views
0 votes
1 answer

How to use the switch statement in R functions?

Switch definitely wasn't intended to operate this ...READ MORE

answered Jun 24, 2022 in Data Analytics by Sohail
• 3,040 points
574 views
0 votes
1 answer

How to use the strsplit function with a period

Since the dot has a specific meaning ...READ MORE

answered Jun 24, 2022 in Data Analytics by Sohail
• 3,040 points
768 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP