2NUMERICS, ARITHMETIC, ASSIGNMENT, AND VECTORS

image

In its simplest role, R can function as a mere desktop calculator. In this chapter, I’ll discuss how to use the software for arithmetic. I’ll also show how to store results so you can use them later in other calculations. Then, you’ll learn about vectors, which let you handle multiple values at once. Vectors are an essential tool in R, and much of R’s functionality was designed with vector operations in mind. You’ll examine some common and useful ways to manipulate vectors and take advantage of vector-oriented behavior.

2.1 R for Basic Math

All common arithmetic operations and mathematical functionality ...

Get The Book of R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.