To measure the central tendency of the given data in R programming.
#Measure of Central tendency
#Read File
print(getwd())
setwd(“/home/soft13”)
print(getwd())
data<-read.csv(‘input.csv’)
print(data)
print(is.data.frame(data))
#Mean
mean(data$salary)
#Median
median(data$salary)
#Mode
mode<-function(f){
uniq<-unique(f)
uniq[which.max(tabulate(match(f,uniq)))]
}
mode(data$salary)
mode(data$dept)
#Summary
summary(data)