2. What is R
• WHAT IS R?
• R is both a programming language and
software environment for statistical
computing, R is a free, open source software
program for statistical analysis.
3. How to Start R
• To get started, you will need to install two
pieces of software:
• • R, the actual programming language. –
Chose your operating system, and select the
most recent version, 4.2.1.
• • RStudio, an excellent IDE for working with R.
– Note, you must have R installed to use
RStudio. RStudio is simply an interface used to
interact with R.
4. • R is used both for software development and
data analysis.
5. Why use R
• Free and open source.
• Available for Windows, Macintosh, and Linux.
• Publication-quality graphs.
• Rivals (and in many cases, exceeds) SAS and Stata
in terms of availability of advanced statistical
methods and algorithms, through availability of
user-created packages.
• Packages for literate statistical programming -
weaving written reports and analysis code in one
document.
6. • WHAT IS RSTUDIO?
• RStudio is a free, open source IDE (integrated
development environment) for R. (You must
install R before you can install RStudio.) Its
interface is organized so that the user can clearly
view graphs, data tables, R code, and output all at
the same time. It also offers an Import-Wizard-
like feature that allows users to import CSV, Excel,
SAS (*.sas7bdat), SPSS (*.sav), and Stata (*.dta)
files into R without having to write the code to do
so.
7. WHAT FILE TYPES ARE TYPICALLY
ASSOCIATED WITH R?
• *.r - An R script.
• *.rmd - An R Markdown file.
• *.rnw - An R Sweave file.
• *.rds - A file containing a [single] R object; can be
created using saveRDS(), and loaded
using readRDS().
• *.rdata - A file containing one or more R objects
or workspaces; can be created using save(), and
loaded using load().
8. How can I access R?
• R and RStudio are free and open-source. To
install them on any computer, download the
software from their respective websites.
9. Package required
• Readxl: to import excel file in r-studio
• Readr: to import csv and text file in r-studio
• Rjson: to import JSON file in r-studio
• XML: to import html table in r-studio
• Haven: to import SAS file in r-studio
• Haven: to import SPSS file in r-studio