R: how to display the first n characters from a string of words
I have the following string: Getty <- "Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty, and dedicated to the proposition that all men are created equal." I want to display the first 10 characters. So I began by splitting the string into individual characters: split <- strsplit(Getty, split="") split I get all the individual characters as this point. Then I make a substring of the first 10 characters. first.10 <- substr(split, start=1, stop=10) first.10 And here is the output: "c(\"F\", \"o\"" I am not understanding why this prints