find missing values in r

main.r
# Create a sample data frame
df <- data.frame(
  A = c(1, 2, NA, 4),
  B = c(NA, 2, 3, 4)
)

# Check for missing values
missing_values <- sum(is.na(df))
missing_values
168 chars
10 lines

related categories

gistlibby LogSnag