📊 R Programming Language
📌 What is R?
R is a programming language and environment mainly used for statistical computing, data
analysis, and visualization.
It is widely used by data scientists, statisticians, and researchers.
⚙️Features of R:
Open-source and free
Designed for data manipulation and analysis
Strong graphical capabilities (e.g., plots, charts)
Extensive package ecosystem (CRAN)
Interacts easily with other languages (C, C++, Python)
🧠 Basic Data Types in R:
Numeric – Numbers (e.g., 10, 3.14)
Integer – Whole numbers (e.g., 10L)
Character – Text (e.g., "Hello")
Logical – TRUE or FALSE
Complex – Complex numbers (e.g., 4+3i)
Factor – Categorical data
🧺 Data Structures in R:
Structure Description Example
Vector Sequence of data c(1, 2, 3)
Matrix 2D array matrix(1:6, nrow=2)
List Collection of different types list(1, "A", TRUE)
Data Frame Table-like structure data.frame(Name, Age)
📊 Popular R Functions:
print() – Print output
mean(), sum(), sd() – Math/stats functions
plot(), hist() – Basic plotting
read.csv() – Load CSV file
str() – Structure of an object
summary() – Quick data summary
📦 Useful R Packages:
ggplot2 – Advanced data visualization
dplyr – Data manipulation
tidyr – Data cleaning
shiny – Web apps in R
caret – Machine learning
readr – Fast data import
💡 Why Use R?
Excellent for data analysis and reporting
Huge community support
Easy to learn for beginners in statistics
Highly customizable visualizations
Integration with RStudio makes development easier