R Data, Part 3: Text and Factors

Samuel E. Buttrey · 2017

This chapter describes some of the operations that data handlers can perform on character data. This includes extracting pieces of strings, formatting numbers as text, and searching for matches inside text. The length of a character vector is, as with other vectors, the number of elements it has. In the case of a character vector, data handlers might want to know how many characters are in each element. R formats entries in a numeric vector for display, but that formatting is part of the print-out, not part of the vector, and the formatting can change when the vector changes. The chapter also describes some of the details of those formatting choices. It further describes how R uses scientific notation, and how data handlers can create categorical versions of numeric vectors. Finally, the chapter examines how factors are created, how they behave, and how to get them to do what data handlers want them to do.

Read the paper · More papers on PaperTik