Why do we use the summary function?

summary() function in R Language is a generic function used to produce result summaries of the results of various model fitting functions.
 
# R program to illustrate
# summary function
 
# Initializing a character and
# integer vector
x <- c("GFG", "gfg", "Geek", "Geeks")
y <- c(1, 2, 3, 4)
 
# Calling summary() function
summary(x)
summary(y)
Output:
 
Length Class Mode
4 character character
 
Min. 1st Qu. Median Mean 3rd Qu. Max.
1.00 1.75 2.50 2.50 3.25 4.00