Statistics 27

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

As was the case with lists, naming the arguments assigns the argument names to

the data frame components (the vectors, which appear onscreen as columns).
And here’s what it all looks like:
> e.averages.frame
color average n
1 blue 18.00000 2
2 green 62.66667 3
3 hazel 79.50000 2
Packages
A package is a collection of functions and data that augments R. If you’re an
aspir-
ing data scientist and you’re looking for data to work with, you’ll find data
frames
galore in R packages. If you’re looking for a specialized statistical function
that’s
not in the basic R installation, you can probably find it in a package.
R stores packages in a directory called the library. How do you get a package into
the library? Click the Packages tab in the Files, Plots, Packages, and Help pane.
(Refer to Figure 2-2.) In the upcoming example, I use the well-known MASS
package, which contains over 150 data frames from a variety of fields.
If you want to see what’s in the MASS package, click on MASS in the Packages tab.
(It’s in the System Library section of this tab.) That opens a page on the Help
tab,
which appears in Figure 2-9.

You might also like