Intro to R and RStudio
A Simple Guide: What We Want to Know
About R and RStudio
Presented by: Team X 08/20/2025
What is R?
• a free, open source programming language
• initially written by Ross Ihaka and Robert Gentleman
(R&R) of the University of Auckland’s Statistics
department
• Today, R is comprised by many global contributions and
managed by the R Core Team.
• commonly used for data analysis and statistical
computing
Reference: : Coursera Staff. (2025, July 31). What Is R Programming? Definition, use cases and FAQ. Coursera. Retrieved August 9, 2025, from
[[Link]
R Programming language Syntax
• Has three elements: (1) keywords, (2) variables, (3)
comments
• Keywords words with pre-assigned meanings( if, else,
while, for, break, next, repeat, NULL, TRUE, function, etc.)
• Variables: objects in R used to store information
• Comments: increase code readability (begin with a hash
symbol (#))
Reference: : Coursera Staff. (2025, July 31). What Is R Programming? Definition, use cases and FAQ. Coursera. Retrieved August 9, 2025, from
[[Link]
Notable Features of R
• Wide range of libraries
• Large and active community of users
• Optimal data storage handling
• Platform-independent and can run on all operating
systems (Windows, Mac, UNIX, Linux)
• Versatile (used in many industries such as social media
companies, health care, financial technology, etc.)
Reference: : Coursera Staff. (2025, July 31). What Is R Programming? Definition, use cases and FAQ. Coursera. Retrieved August 9, 2025, from
[[Link]
How to Install R
• Go to the web page of The Comprehensive R Archive
Network ([Link]
• For Windows: click the “Download R for Windows” link
• Then click the “base” link
• The link downloads an installer program, which installs
the most up-to-date version of R for Windows.
Reference: Grolemund, G. (n.d.). A Installing R and RStudio*\[Appendix in Hands-On Programming with R]. RStudio Education. Retrieved August 9, 2025, from
[[Link] [Link])
What is Rstudio?
• An integrated development environment (IDE) which is
a set of tools built to help in writing R and Python
• Most trusted IDE for open source data science
• Makes it easier in writing R
Reference: Grolemund, G. (n.d.). A Installing R and RStudio*\[Appendix in Hands-On Programming with R]. RStudio Education. Retrieved August 9, 2025, from
[[Link] [Link])
How to Install Rstudio?
• Download Rstudio using this link
([Link]
• Click the “Download Rstudio Desktop”
• After downloading, click the application to install
Reference: Grolemund, G. (n.d.). A Installing R and RStudio*\[Appendix in Hands-On Programming with R]. RStudio Education. Retrieved August 9, 2025, from
[[Link] [Link])
Basic Parts of RStudio
• Rstudio interface has 4
primary panes
• (1) Source pane
• (2) Console pane
• (3) Environment pane
• (4) Output pane
References:
Posit Software, PBC. (n.d.). *Pane layout* \[RStudio user guide]. In *User interface guide*. Retrieved August 9, 2025, from [[Link]
[Link]]([Link] e/guide/ui/[Link])
DataCamp Team. (2025, April 7). *RStudio tutorial* \[Tutorial]. DataCamp. Retrieved August 9, 2025, from [[Link]
tutorial]([Link]
Basic Parts of RStudio
Source pane
• located at the top-left panel
• Can be launched by opening any editable file
• Used for viewing and editing your code
Console pane
• Output is displayed here from scripts in the source
pane
• R commands can also be written directly here
References:
Posit Software, PBC. (n.d.). *Pane layout* \[RStudio user guide]. In *User interface guide*. Retrieved August 9, 2025, from [[Link]
[Link]]([Link] e/guide/ui/[Link])
DataCamp Team. (2025, April 7). *RStudio tutorial* \[Tutorial]. DataCamp. Retrieved August 9, 2025, from [[Link]
tutorial]([Link]
Basic Parts of RStudio
Environment pane
• located at the top-right panel
• Shows all objects (variables, data frames, etc.)
• History tab is located here: where all commands
executed in the console are located
References:
Posit Software, PBC. (n.d.). *Pane layout* \[RStudio user guide]. In *User interface guide*. Retrieved August 9, 2025, from [[Link]
[Link]]([Link] e/guide/ui/[Link])
DataCamp Team. (2025, April 7). *RStudio tutorial* \[Tutorial]. DataCamp. Retrieved August 9, 2025, from [[Link]
tutorial]([Link]
Basic Parts of RStudio
Output Pane
• Files: Displays the files and folders in your working
directory, allowing you to navigate and manage your
files.
• Plots: Shows any plots you generate in your R scripts.
• Packages: Allows you to install, load, and manage R
packages.
• Help: Provides access to the R documentation and help
pages.
References:
Posit Software, PBC. (n.d.). *Pane layout* \[RStudio user guide]. In *User interface guide*. Retrieved August 9, 2025, from [[Link]
[Link]]([Link] e/guide/ui/[Link])
DataCamp Team. (2025, April 7). *RStudio tutorial* \[Tutorial]. DataCamp. Retrieved August 9, 2025, from [[Link]
tutorial]([Link]
How to Read a File
.csv Files
• The function [Link]() is used to read .csv files
• Two most important arguments needed are the file
name and stating if the file has a header or not
• File name needs to be enclosed in quotations including
the file type extension
• If dataset has column titles, we should say
header=TRUE
Reference: Kady Schneiter (n.d.). *Reading Data into RStudio*. In Stats Stuff. Utah State University. Retrieved August 13, 2025, from
[[Link]
How to Read a File
Saving the Data in your R Environment
• Precede the [Link]() or [Link]() functions with
the name for your dataset and the assignment operator
<-
• data will not be shown in the Console window but will
appear as data stored in your Global Environment in the
Environment pane
Reference: Kady Schneiter (n.d.). *Reading Data into RStudio*. In Stats Stuff. Utah State University. Retrieved August 13, 2025, from
[[Link]
How to Set Directory
• Create a sub-directory named “R” in your
“DOCUMENTS” folder
• Go to Rstudio and choose the menu “Session > Set
Working Directory > Choose Directory
• Then choose the directory you’ve created in the first
step
Reference: STHDA. (n.d.). Running RStudio and setting up your working directory – Easy R Programming. STHDA. Retrieved August 9, 2025, from
[[Link]
How to Install a Package
• sometimes there is confusion between a package and a
library
• library() is the command used to load a package, and it
refers to the place where the package is contained
• A package is a suitable way to organize your own work
and, if you want to, share it with others. Typically, a
package will include code, functions, and data sets
• You can directly install a package from the Output Pane,
where the menu “packages” is located
Reference: STHDA. (n.d.). Running RStudio and setting up your working directory – Easy R Programming. STHDA. Retrieved August 9, 2025, from
[[Link]
Any questions/clarifications?
Human na, Salamat!