I have no idea what the correct title here is that will make it easy for other to find this later on...
I am reporting on quality of data that is submitted to me. For example, I report on missing data where this not allowed. I refer to the actual rows which have missing data. Sometimes there is a lot of missing data is so long that my QA report is pages long. I would like to know how to shorten numeric vectors.
How do I reduce:
x <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 55, 56, 57)
paste0("Missing data: rows ", paste0(x, collapse = ", "))
[1] "Missing data: rows 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 55, 56, 57"
to:
"Missing data: rows 1:10, 20:30, 55:57"