2 Days Data Science Workshop at Institute of Development Studies, Jaipur (ICSSR)

“RStudio is an integrated development environment (IDE) for R and Python from company posit.”

“It includes a console, syntax-highlighting editor that supports direct code execution, and tools for plotting, history, debugging, and workspace management.”
Download RStudio.
.RWrite codes in the R script \(\rightarrow\) Console will show the results.
Writing readable code because other people might need to use your code.
Writing readable code because you might need to use your code, a few weeks/months/years after you’ve written it.
Put spaces between and around variable names and operators (=+-*/).
Break up long lines of code.
Keeping a consistent style.
In R, everything you create or work with is stored as an object.
Objects can be numbers, text, data tables, functions, or even plots.
Think of an object as a named container that stores information in your R environment.
Important
R assignment operators: Assignment operators are used to assign values to variables.
object_name <- c(2, 3, 4, 5)
object_name
A name cannot start with a number.
A name cannot use some special symbols, like ^, !, $, @, +, -, /, or *,:.
Avoid caps.
Avoid space.
Use dash (like weight-kg) or underscore (like weight_kg).
If chronology matters then add date (2020-09-05-file-name).
| Type | Description | Example |
|---|---|---|
numeric |
Numbers (floating point) | 3.14, 2, -5 |
integer |
Whole numbers | 2L, 100L |
character |
Text strings | "R is great" |
logical |
Boolean values | TRUE, FALSE |
👇 Something Like This 😻😻
name income age place weight_kg
1 Bhim 23000 23 MH 50
2 Rama 25000 25 RJ 52
3 Sara 16000 16 DL 61
4 Phule 4000 40 HR 40
5 Savitri 34000 34 HR 70
“An R package is a collection of functions, data, and documentation that extends the capabilities of base R. Using packages is key to the successful use of R.”

Install the R package
Call the R package
Update the R package
Remove the R package
You need to install package only once like:
📚 We buy books once and use them again and again
💡 Fix the bulb once and use it again and again.
In every R document you need to call once the package using function library(), for example library(ggplot2).
Once in a while, you need to update the installed packages as well.
If you un-install R or RStudio, you will lose all installed packages.
csv file🧑🏽💻👨🏽💻
Question & Answer
Correct answer: C) Data analysis and statistics
Correct answer: C) An integrated development environment (IDE) for R
Correct answer: A) 5
Correct answer: B) seq()
Correct answer: A) Console or Script Editor
