Search
 
SCRIPT & CODE EXAMPLE
 

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),]
Comment

PREVIOUS NEXT
Code Example
R :: r environment variables 
R :: remove all trailing whitspaces R 
R :: repeat each value in a vector in r 
R :: r type of object 
R :: create vector in r 
R :: disable the y axis in plot r 
R :: convert all numeric columns to percentages R 
R :: ggplot abline thickness 
R :: reduce ggtitle size 
R :: extract pc1 and pc2 in r 
R :: how to change order in bar chart r 
R :: r rename column based on variable 
R :: insert character into string r 
R :: How to extract NA´s from a column? in R 
R :: ts object to data frame 
R :: R construct a named list 
R :: switch variable position in r dplyr 
R :: interquartile in r 
R :: R grid all possibilites between two vectors 
R :: r studio 
R :: chunk with multiple plot tabset 
Rust :: sort a vec<f32 rust 
Rust :: rust case 
Rust :: rust multiline comment 
Rust :: rust lang function is never used: rustc(dead_code) 
Rust :: rustlang char array 
Rust :: armanriazi•rust•thread•recv•try_recv 
Rust :: rust `cfg` which is always true / false 
Rust :: rust sort vec of f64 
Rust :: armanriazi•rust•error•E0277•the trait bound `` is not satisfied 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =