Perform the following steps to apply statistics to a dataset:
- Load the iris data into an R session:
> data(iris)
- Observe the format of the data:
> class(iris) [1] "data.frame"
- The iris dataset is a DataFrame containing four numeric attributes: petal length, petal width, sepal width, and sepal length. For numeric values, you can perform descriptive statistics, such as mean, sd, var, min, max, median, range, and quantile. These can be applied to any of the four attributes in the dataset:
> mean(iris$Sepal.Length) Output: [1] 5.843333 > sd(iris$Sepal.Length) Output: [1] 0.8280661 > var(iris$Sepal.Length) Output: [1] 0.6856935 > min(iris$Sepal.Length) Output: [1] 4.3 > max(iris$Sepal.Length) Output: [1] 7.9 > median(iris$Sepal.Length) ...