Basic Features of R
Programming
By
Mrs.Subhasheni A
Assistant Professor
Sri Ramakrishna college of Arts & Science
Introduction
R is a powerful and flexible programming language and
environment primarily used for statistical computing, data
analysis, and graphical visualization. It is widely used in
various fields like data science, research, finance, and
academia due to its extensive libraries and easy-to-learn
syntax.
Data Handling and Manipulation
Vectors: Basic data structure in R for storing ordered
elements.
Data Frames: Table-like structure for storing datasets
(similar to spreadsheets).
Matrices: Two-dimensional arrays used for storing data in
rows and columns.
Lists: Allows storing diverse data types in an ordered
collection.
dplyr: A powerful package for data manipulation (filter,
arrange, select).
Statistical and
Mathematical Functions
Built-in Statistical Functions: R provides a vast range of
functions for statistical analysis, including mean, median, variance,
standard deviation, and more.
Probability Distributions: R supports a wide variety of probability
distributions (e.g., Normal, Binomial, Poisson).
Linear and Non-linear Modeling: R is capable of performing
linear regression, logistic regression, and various other statistical
models.
Graphical Visualization
Base R Plotting: Provides basic plotting functionality
to create histograms, bar plots, line graphs, etc.
ggplot2: A highly customizable and advanced
package for creating complex visualizations like
scatter plots, box plots, and more.
Interactive Plots: Packages like plotly and shiny
allow for interactive graphics and web applications.
Rich Package Ecosystem
CRAN (Comprehensive R Archive Network): R
has thousands of packages available for download to
perform tasks ranging from data manipulation,
machine learning, time series analysis, and much
more.
Bioconductor: A repository for bioinformatics and
computational biology packages.
Tidyverse: A collection of R packages designed for
data science tasks like data manipulation, tidying,
and visualization.
Reproducible Research
RMarkdown: Allows users to create dynamic
documents that combine R code with results (graphs,
tables) for reproducible analysis.
Knitr: A tool to generate reports with R code output
embedded in them (e.g., HTML, PDF, Word).
Advanced Statistical and
Machine Learning Tools
Machine Learning Libraries: R provides robust
packages like caret, randomForest, e1071 for building
machine learning models.
Time Series Analysis: With packages like forecast
and xts, R is ideal for time series forecasting and
analysis.
Clustering & Classification: R supports clustering
algorithms (e.g., K-means, hierarchical) and
classification models (e.g., decision trees, SVM)
Extensibility and Integration
Integrates with Other Languages: R can integrate
with other programming languages like C, C++, Java,
and Python for performance optimization.
Database Connectivity: R can connect to SQL
databases, NoSQL systems, and big data technologies
to work with large datasets.
Web Integration: R can be integrated with web-
based frameworks such as Shiny for building web
applications with dynamic data.
Open Source and Cross-Platform
R is open-source, which means it is free to
use and can be customized by developers.
It is cross-platform, meaning R works on
Windows, macOS, and Linux.