You are on page 1of 1

10 3 brown 22

11 6 hazel 67
12 3 brown 55
13 1 amber 42
14 4 gray 44
Want the empathy score for the seventh person? That’s
> e[7,3]
[1] 53
How about all the information for the seventh person:
> e[7,]
eye_color feye_color empathy_score
7 5 green 53
Editing a data frame: Looks like
a spreadsheet (but isn’t)
R provides a way to quickly modify a data frame. The edit() function opens a
Data Editor window that looks much like a spreadsheet, and you can make changes
in the cells. Figure 2-8 shows what happens when you type
> edit(e)

You might also like