Answers for "na count by columns in r"

1

count number of rows with NA values in a column in r

#count total rows in data frame
nrow(df)

#count total rows with no NA values in any column of data frame
nrow(na.omit(df))

#count total rows with no NA values in specific column of data frame 
nrow(df[!is.na(df$column_name),])
Posted by: Guest on April-05-2022
0

count number of columns in r

ncol(df)
Posted by: Guest on April-03-2021

Browse Popular Code Answers by Language