Amazing technological breakthrough possible @S-Logix pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to aggregate data in R?

Description

To aggregate the data using R programming.

Process

Aggregate :

  Aggregate is a unction used to aggregate the inputted data frame by one or more variable

   R Function : aggregate()

Sapmle Code

#Aggregate
#Input
attach(mtcars)
input<-mtcars

#Aggregate Function
output<-aggregate(input, by=list(vs), FUN =mean)
View(output)

#by cyl and vs
output_1<-aggregate(input,by=list(cyl,vs), FUN=median)
View(output_1)

Screenshots
Aggregate data in R
Aggregate Function