
:2.500Ī particular column can be extracted by using the $ notation and names() lists all of the variables. summary(iris) # Sepal.Length Sepal.Width Petal.Length Petal.Width # $ Species : Factor w/ 3 levels "setosa","versicolor".: 1 1 1 1 1 1 1 1 1 1.

The str() command tells us what kinds of variables we have and summary() gives a basic statistical summary of each column. # 10 4.9 3.1 1.5 0.1 setosa tail(iris,5) # Sepal.Length Sepal.Width Petal.Length Petal.Width Species

head(iris, 10) # Sepal.Length Sepal.Width Petal.Length Petal.Width Species Other data frames are too large to look at in their entirety, so the head and tail commands can be useful. mtcars # mpg cyl disp hp drat wt qsec vs am gear carb

mtcars is a built-in data frame, and you can readily see the names of each variable at the top of each column.

The most important data structure in R is the data frame.
