0% found this document useful (0 votes)
7 views6 pages

Getting Started With RStudio and Installing Packages

This document provides a step-by-step guide for getting started with RStudio, including loading the iris dataset and installing necessary packages. It outlines specific commands to run in the R Script editor and Console, as well as details about the dataset's structure. The lab concludes with an invitation to enjoy the exercise, authored by Romeo and contributed to by Lavanya.

Uploaded by

Simhadri Sevitha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views6 pages

Getting Started With RStudio and Installing Packages

This document provides a step-by-step guide for getting started with RStudio, including loading the iris dataset and installing necessary packages. It outlines specific commands to run in the R Script editor and Console, as well as details about the dataset's structure. The lab concludes with an invitation to enjoy the exercise, authored by Romeo and contributed to by Lavanya.

Uploaded by

Simhadri Sevitha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

5/5/23, 2:34 PM about:blank

Getting started with RStudio and Installing


packages

Objectives of Exercise:
After completing this lab, you will be able to:

Load the datasets


Install libraries

Step 1 - Click the plus symbol on the top left and click R Script.

An untitled R Script panel opens. It would look like this.

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

Step 6 - Run the following command in the console.


1. 1

1. install.packages("GGally", repos = "https://cran.r-project.org", type = "source")

Copied!

Step 7 - Click Enter to install the packages.

about:blank 5/6
5/5/23, 2:34 PM about:blank

This concludes the lab; I hope you enjoyed it!

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

© IBM Corporation 2020. All rights reserved.

about:blank 6/6

You might also like