Book Image

R Object-oriented Programming

By : Kelly Black
Book Image

R Object-oriented Programming

By: Kelly Black

Overview of this book

Table of Contents (19 chapters)
R Object-oriented Programming
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
4
Calculating Probabilities and Random Numbers
Package Management
Index

Basic string operations


In some situations, data is kept in the form of characters or strings, whereas in some other situations the strings must be parsed or investigated as part of a statistical analysis. Because of the prevalence of data in the form of strings, the R language has a rich set of options available for manipulating strings. In this chapter, we investigate some of the options available, and our investigation is divided into two parts. They are as follows:

  • In the first part, we examine a number of basic string operations whose function is focused on particular operations

  • In the second part, we examine the functions that are based on regular expressions that offer a powerful set of wide ranging operations

The use of regular expressions represent a powerful set of tools for string manipulation, but the cost is greater complexity. In this chapter, we only focus on the most basic uses of these functions as their most common uses tend to be parts of more complex code that may use a...