Skip to Content
Modern R Programming Cookbook
book

Modern R Programming Cookbook

by Jaynal Abedin
October 2017
Beginner to intermediate
236 pages
7h 38m
English
Packt Publishing
Content preview from Modern R Programming Cookbook

How it works…

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: ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

R Cookbook, 2nd Edition

R Cookbook, 2nd Edition

JD Long, Paul Teetor

Publisher Resources

ISBN: 9781787129054Supplemental Content