Home > Software engineering >  Can't count the null values of a dataframe in R
Can't count the null values of a dataframe in R

Time:01-27

I have imported a dataset from a CSV file to a data frame that has lots of null values, but I can't count the number of null values

enter image description here

install.packages("tidyverse")
library(tidyverse)
sample <- read.csv("sample.csv")
colSums(is.na(sample))

enter image description here

CodePudding user response:

It looks like end_station_name is an empty string (not NA). Something like sum(data$end_station_name == "") would tell you how many rows have 'missing' (in your case 'empty') values for end_station_name.

  •  Tags:  
  • Related