this is my data set on which i want to complete factorize my data set with each count levels of the every attribute of file This my code:
library(dplyr)
#read File
h_Data<-read.csv(file.choose())
#store university attribute
h_Data<-h_Data$University
#Count each levels factor of data of
h_DataDF <- data.frame(h_Data)
h_dataLevels<-h_DataDF %>%
group_by(h_Data) %>%
summarise(no_rows = length(h_Data))
h_dataLevels
#missing of data
h_DataMissing<-sum(is.na(h_Data))
h_DataMissing
#percentage of each level of factor
h_DataPer<-prop.table(table(h_Data))*100
#table format
h_DataTable <-data.frame(levels_data=h_dataLevels,levels_perc=h_DataPer,missing_data=h_DataMissing)
h_DataTable
I want to summrize as: levels_University no.of_timesLevels Percentage_of_Level MissingAttributes IBA 4 57.14 0 KU 1 14.28 0 UIT 2 28.57 0