October 2017
Beginner to intermediate
236 pages
7h 38m
English
The readLines() function imports data line by line. If you have created the .txt file manually by typing the text content, then the number of lines will be the value equal to the number of times you pressed the Enter key on the keyboard. Alternatively, if the text sequence is too long and you didn't press the Enter key from the keyboard, then it will take the maximum possible number of characters in a single line before it breaks into a second line.
In this example, the deepLearning.txt file contains 10 abstracts, each representing a single line. The resultant object absText has a length of 10 because all of the abstract's text is stored in a single line of the file.
Here is the first element of the output character vector: ...