Good morning Stack Overflow,
Getting some statistics (whatever) on the columns of a dataframe might be done with the (s)apply
function. I am wondering whether it could be possible to get such statistics on each column for each different dataframe using the apply
family?
Number of missing values per column (1 dataframe):
dataf <- data.frame(list(a = 1:3, b = c(NA, 3:4)), row.names = c("x","y","z"), stringsAsFactors = FALSE)
sapply(dataf, function(x) {sum(is.na(x))})
I have thought about making a list of dataframes but the statistics is then conglomerated on the elements of the list (i.e. dataframe) although I want it to be calculated on the columns. Any idea?
Have a nice day,
Anthony