find the row with highest number of NA value in R

Cina

I have datafrom

df
1 a c  NA NA
2 a a  a  NA
3 c NA NA NA

Firstly, I want to find which row has the highest number of NA value. I am also interested to find rows with the condition of having more than 2 NA values.
How can I do it in R?

Gregor Thomas

na_rows = rowSums(is.na(df)) gives the count of NA by row. You can then look at which.max(na_rows) and which(na_rows > 2).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to find the highest number of a column and print two columns of that row in R?

Find the row with the highest value in SQL

Find row number based on value r

How to find row number of a value in R code

Find tags based on an attribute value with the highest number

Function that returns three highest value in row in R

Finding the corresponding row value of highest row number in another column

Find a highest value in a set of columns and retrieve value in the respective row

Find highest number across row across all workbook

Find sum of 2nd highest number in each row & column

Find row number of matching value

Find the highest number in a table

Find the highest number with a condition

Numpy: Find index of second highest value in each row of an ndarray

Find row-index of highest value in given column of dataframe

How to find column name that contains the highest value of a row in a csv file

How to find the highest value in a row which is not a distinct variable

How to find the name of a row that has the highest value in a column

Find highest number of occurring values from col and replace the null with that value

Find the second highest value

Find the highest value in a dataframe

R: How to generate vectors of highest value in each row?

Identify the column that the highest row value belongs to, python or R

Select n row have highest combined value from a matrix in R

SQL - find a table row with the highest number being less than a specified number

How to find the highest value of a column in a data frame in R?

Find value in range of strings and return row number

find row number for matching value and store in variable

AWK scripting to to find highest number