Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Rohit Sharma

Rohit Sharma

Community Learner
Share
2Questions
4Answers
1.2KViews on questions

Remove columns from dataframe where ALL values are NA

To remove columns with na in r where all values are NA, you can use the select_if function from the dplyr package as follows: df df x y z 1 1 1 NA 2 2 2 NA 3 3 NA NA 4 4 4 NA 5 5 5 NA 6 6 NA NA 7 7 7 NA 8 8 8 NA 9 9 4 NA 10 10 NA NA To remove column ‘z’(All NA’s):library(dplyr) all_na % select_if(all_na) x y 1 1 1 2 2…

Data Science

Answered Jul 15, 2021 · 1 Views Read answer →

More members from the Data Science community

Learners asking and answering questions on the same topics — follow their questions and join in.

Latest Data Science Blogs

Guides, tips and career advice on Data Science from JanBask experts.

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.