Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

na by column r

df <- data.frame(x = c(1,2,NA), y = rep(NA, 3))

# Which column has na?
colSums(is.na(df))[colSums(is.na(df)) > 0]

# which rows?
df[which(rowSums(is.na(df)) > 0),]
 
PREVIOUS NEXT
Tagged: #na #column
ADD COMMENT
Topic
Name
4+2 =