The text at the start of section 7.1 and the example do not appear to agree on what nchar() does on encountering NA: > text <- c("one", "two", "three", NA, "five") > nchar(text) [1] 3 3 5 NA 4 Thank you for making this material available!