0% found this document useful (0 votes)
25 views55 pages

R Practical Report

Uploaded by

nivadib915
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views55 pages

R Practical Report

Uploaded by

nivadib915
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 55

DATA ANALYTICS USING R

PRACTICALS

NAME:
ROLL NO:
COURSE: BBA
YEAR: 2nd
ABOUT R :

R is a powerful and versatile programming language


and software environment that has gained widespread
recognition within the realm of data analysis, statistical
modeling, and visualization. Developed by Ross Ihaka
and Robert Gentleman in the mid-1990s, R provides a
comprehensive suite of tools for data manipulation,
transformation, and exploration. With a thriving
community of statisticians, data scientists, and
researchers, R offers a vast collection of packages and
libraries that extend its capabilities across diverse
fields, making it an indispensable tool for tasks ranging
from simple data visualization to complex machine
learning algorithms. Its open-source nature fosters
collaborative development and innovation, enabling
users to share and replicate analyses easily. Whether in
academia, industry, or research, R continues to play a
pivotal role in empowering individuals and
organizations to extract valuable insights from data
through its extensive functionalities and rich
ecosystem.
ADVANTAGES OF R:

Open Source: R is an open-source programming


language and environment, which means it's freely
available to anyone. This encourages a large and active
community of developers, researchers, and data
scientists to contribute, collaborate, and extend its
capabilities.
Statistical Analysis: R is specifically designed for
statistical analysis and data manipulation. It offers a
wide range of statistical techniques, from basic to
advanced, making it a powerful tool for exploring,
analyzing, and modeling data.
Data Visualization: R provides extensive data
visualization libraries, such as ggplot2, lattice, and
plotly, allowing users to create customizable and high-
quality plots, charts, and graphs to better understand
and present their data.
Flexibility: R is a versatile language that allows users to
create custom functions and packages, making it
adaptable to various domains and specialized analyses.
This flexibility is especially useful for researchers and
analysts who need to implement unique methods or
algorithms.
Data Manipulation: R offers powerful tools like dplyr
and tidyr that make data manipulation and
transformation easier. These libraries enable users to
clean, reshape, and aggregate data efficiently.
Community and Support: R has a vibrant and
supportive community of users, which means there are
plenty of online resources, tutorials, forums, and
packages available to help users troubleshoot issues,
learn new techniques, and share their insights.
Integration: R can be easily integrated with other
programming languages like Python, Java, and C++,
allowing users to take advantage of different
language's strengths and libraries within a single
project.
Reproducibility: R scripts are text-based and can be
version-controlled using tools like Git. This makes it
easier to reproduce analyses, collaborate with others,
and maintain a record of changes made to the code
and data.
Machine Learning: R has a growing ecosystem of
machine learning packages, such as caret, random
Forest, and xgboost, enabling users to build predictive
models, perform classification, clustering, and
regression tasks, and experiment with various
algorithms.
Academic and Research Use: R is widely used in
academia and research for its robust statistical
capabilities. It's favored by statisticians and researchers
for its ability to handle complex statistical analyses and
produce publication-quality outputs.

HOW TO INSTALL R:
Download R Software: Visit the official R Project
website (https://www.r-project.org/) and locate the
"Download R" link. Choose a CRAN mirror (a download
server) that is geographically close to your location.
Select Your Operating System: Depending on your
operating system (Windows, macOS, Linux), select the
appropriate version of R to download.
Download Installer: Click on the link to download the
installer for your chosen operating system. The
installer package will typically have a file name like "R-
x.x.x.pkg" (for macOS), "Rx.x.x-win.exe" (for Windows),
or "R-x.x.x.tar.gz" (for Linux).
Run Installer: Locate the downloaded installer file and
run it by double-clicking on it. Follow the on-screen
instructions to start the installation process.
Choose Installation Options: During the installation
process, you might be presented with various options.
Generally, the default options are suitable for most
users. However, you can customize the installation
location and create shortcuts if needed.
Accept License Terms: You'll likely need to read and
accept the terms and conditions of the software's
license agreement before proceeding with the
installation.
Select Components: Depending on the installer, you
might be asked to select components to install. For
most users, installing the "Core Files" is sufficient.
Advanced users might choose to install additional
components.
Start Installation: Proceed with the installation process
by clicking "Next" or a similar button. The installer will
copy files and set up the necessary directories.
Create Shortcuts (Optional): If prompted, you can
choose to create shortcuts on your desktop or in the
Start menu for easy access to R.
Finish Installation: Once the installation is complete,
you'll receive a notification or see a completion screen.
You can now launch R by finding the installed program
(usually named "R" or "R x.x.x") and starting it.
HOW TO INSTALL RSTUDIO:
Install R: Before installing RStudio, you need to have R
installed on your system. R is the programming
language and environment that RStudio works with.
You can download R from the official CRAN
(Comprehensive R Archive Network) website:
https://cran.r-project.org/mirrors.html Choose the
appropriate mirror based on your location, download
the installer, and follow the installation instructions for
your operating system.
Download RStudio: Once you have R installed, you can
proceed to download RStudio. RStudio offers both free
and paid versions, but for most users, the free version
(RStudio Desktop) is sufficient. Go to the RStudio
download page: https://
www.rstudio.com/products/rstudio/download/ Under
"RStudio Desktop," select the appropriate installer for
your operating system (Windows, macOS, or Linux).
Install RStudio: Here are the installation steps for each
operating system:
Windows: Run the downloaded RStudio installer
executable. Follow the installation wizard's
instructions. Once the installation is complete, you can
launch RStudio from the Start menu or desktop
shortcut.
macOS: Open the downloaded disk image (.dmg) file.
Drag the RStudio application icon into your
Applications folder. You can now find and open RStudio
from your Applications folder.
Launch RStudio: After installation, launch RStudio:
Double-click the RStudio icon on your desktop
(Windows/macOS). Search for "RStudio" in your
applications menu and click to launch (Linux).
Start Using RStudio: Once RStudio is open, you can
start using it to write, run, and manage R code. It
provides a user-friendly interface with features like a
code editor, console, plots, data viewer, and more.
DESCRIBE RSTUDIO :
RStudio is an integrated development environment
(IDE) specifically designed for the R programming
language. R is a popular open-source programming
language and environment used for statistical
computing, data analysis, and graphical representation.
RStudio provides a user-friendly interface that
facilitates coding, data manipulation, visualization, and
project management, making it a powerful tool for
both novice and experienced R users.
PROGRAM 1 :
Statistical funtions :
PROGRAM 2 :
Data structure functions :(my_vector)
PROGRAM 3 :
creating a list :
PROGRAM 4 :
creating a data frame :
PROGRAM 5 :
creating a matrix :
PROGRAM 6 :
creating a array :
PROGRAM 7 :
creating a table :
PROGRAM 8 :
length :
PROGRAM 9 :
Numeric vector and Character vector :
PROGRAM 10 :
Summary of data :
PROGRAM 11 :
Data manipulation function (head) :
PROGRAM 12 :
Data manipulation function(tail) :
PROGRAM 13 :
Subset :
PROGRAM 14 :
Merged :
PROGRAM 15 :
r - bind :
PROGRAM 16 :
c - bind :
PROGRAM 17 :
Aggregate :
PROGRAM 18 :
Build-in data set :
PROGRAM 19 :(Graphs)
plot :
PROGRAM 20 :
Histogram (equal class interval) :
PROGRAM 21 :
Histogram (unequal class interval) :
PROGRAM 22 :
Box plot :
PROGRAM 23 :
Stem-and- leaf graph :
PROGRAM 24 :
Frequency polygon graph :
PROGRAM 25 :
pie chart :
PROGRAM 26 :
Ogive graph :
PROGRAM 27 :
Random permutation:
PROGRAM 28 :
Random intergers :
PROGRAM 29 :
Random Seed :
PROGRAM 30 :
Cluster Sample :
PROGRAM 31 :
Random Sample :
PROGRAM 32 :
Stratum Sample :
PROGRAM 33 :
Systematic Sample :
PROGRAM 34 :
Arthematic operation :
PROGRAM 35 :
Creating a list :
PROGRAM 36 :
Logical vector :
PROGRAM 37 :
Matrix :
PROGRAM 38 :
Data frame :
PROGRAM 39 :
Cluster Sample with dplyr :
PROGRAM 40 :
ggplot2 :
PROGRAM 41 :
vector functions :
PROGRAM 42 :
Line graph :
PROGRAM 43 :
data frame :
PROGRAM 44 :
List :
PROGRAM 45 :
Matrix :

You might also like