Chapter 7

Guide to Entering, Editing, Saving, and Retrieving Large Quantities of Data Using R

7.1 CREATING AND EDITING A DATA FILE

Let’s begin by reentering the class data from Chapter 1:

c07uf001 height = c(141, 156.5, 162, 159, 157, 143.5, 154, 
158, 140, 142, 150, 148.5, 138.5, 161, 153, 145, 
147, 158.5, 160.5, 167.5, 155, 137)
c07uf002 armspan = c(141, 156.5, 162, 159, 158, 143.5, 
155.5, 160, 140, 142.5, 148, 148.5, 139, 160, 
152.5, 142, 146.5, 159.5, 160.5, 164, 157, 137.5)

and put them together into a data frame we can add new data to:

c07uf003 tdata=data.frame(height,armspan)

Now let’s add some data

c07uf004 classdata=edit(tdata)

When the edit window opens as shown in Figure 7.1, we click on the heading “var3” in column 3.

Figure 7.1 The R edit() window.

web_c07f001

Next, we add entries to the column we’ve created as shown in Figure 7.2.

Figure 7.2 Using the R Data Editor to add new entries to our data frame.

web_c07f002

7.2 STORING AND ...

Get Introduction to Statistics Through Resampling Methods and R, 2nd Edition 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.