Getting Started With RStudio and Installing Packages
Getting Started With RStudio and Installing Packages
Objectives of Exercise:
After completing this lab, you will be able to:
Step 1 - Click the plus symbol on the top left and click R Script.
about:blank 1/6
5/5/23, 2:34 PM about:blank
Step 2 - Now you load the iris dataset. Enter the following lines into the editor window that appears. Then select
all the text, and click Run just above the editor window.
1. 1
2. 2
3. 3
1. library (datasets)
2. data(iris)
3. View(iris)
Copied!
about:blank 2/6
5/5/23, 2:34 PM about:blank
Step 3 - You are taken to the data view tab to inspect your dataset. The dataset contains five columns and the
first four are floating point type while the last column is a label of data type string which contains the category
value. You can see there are total 150 entries of which you can see the first 7.
Step 4 - Now you can find the different species present in the data set. Enter the following command in the
editor window and click Run.
1. 1
1. unique(iris$Species)
Copied!
about:blank 3/6
5/5/23, 2:34 PM about:blank
In the Console window at the bottom you can see the result of the executed command and know that there are
only three different species present in the data set.
Step 5 - Next you will look into the data set in more detail. Open a Console.
about:blank 4/6
5/5/23, 2:34 PM about:blank
Copied!
about:blank 5/6
5/5/23, 2:34 PM about:blank
Author(s)
Romeo
Other Contributor(s)
Lavanya
Change log
Date Version Changed by Change Description
2021-13-01 2.4 Malika Singla Update the installation for R packages
2020-12-10 2.3 Aije Moved plot steps to a new lab
2020-12-10 2.2 Malika Singla Update the installation for R packages
2020-12-07 2.1 Aije Changed instructions to use Skills Network Lab
2020-08-25 2.0 Lavanya Migrated Lab to Markdown and added to course repo in GitLab
about:blank 6/6