You are previewing R in Action.

R in Action

Cover of R in Action by Robert Kabacoff Published by Manning Publications
O'Reilly logo

Chapter 2. Creating a dataset


This chapter covers
  • Exploring R data structures
  • Using data entry
  • Importing data
  • Annotating datasets


The first step in any data analysis is the creation of a dataset containing the information to be studied, in a format that meets your needs. In R, this task involves the following:

  • Selecting a data structure to hold your data
  • Entering or importing your data into the data structure

The first part of this chapter (sections 2.12.2) describes the wealth of structures that R can use for holding data. In particular, section 2.2 describes vectors, factors, matrices, data frames, and lists. Familiarizing yourself with these structures (and the notation used to access elements within them) will help you tremendously ...

The best content for your career. Discover unlimited learning on demand for around $1/day.