Data Import Checks
Row Counts
Check Expected Size
A quick row-count check catches partial imports before analysis starts.
Program
Play the script to change the expected row count and compare it with the imported rows.
row_counts.R
expected_rows <-
rows <- c("Ada", "Bo", "Chen", "Dia")
actual_rows <- length(rows)
status <- if (actual_rows == expected_rows) "match" else "review"
delta <- actual_rows - expected_rows
label <- paste(status, delta, sep = ":")
cat(label, "\n", sep = "")
expected_rows <-
rows <- c("Ada", "Bo", "Chen", "Dia")
actual_rows <- length(rows)
status <- if (actual_rows == expected_rows) "match" else "review"
delta <- actual_rows - expected_rows
label <- paste(status, delta, sep = ":")
cat(label, "\n", sep = "")
expected_rows <-
rows <- c("Ada", "Bo", "Chen", "Dia")
actual_rows <- length(rows)
status <- if (actual_rows == expected_rows) "match" else "review"
delta <- actual_rows - expected_rows
label <- paste(status, delta, sep = ":")
cat(label, "\n", sep = "")
row count
`length(rows)` represents the number of imported records.
expectation
`expected_rows` makes the import contract explicit.
delta
The difference points to missing or unexpected rows.