r - Is it possible to report NAs in stargazer table? -


stargazer package gives me nice descriptive table include in latex document.

library(stargazer) stargazer(attitude) 

enter image description here

is possible add column reporting number of nas each of variables?

this snippet give number of nas per row , column in data frame

# make data count <- 10 data <- data.frame( a=runif(count), b=runif(count))  # add nas data[data$a>0.5,]$a <- na data[data$b>0.5,]$b <- na  # nas per row data$nacount <- apply(data, 1, function(x) {length(x[is.na(x)])})  # nas per column nacountsbycolumn <- lapply(data, function(x) {length(x[is.na(x)])} ) 

Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

php - HTTP_REFERER woes: How can I allow access to a specific page, only when a visitor has visited another specific page beforehand? -