R Commands: Firsty, We Need To Install Package
R Commands: Firsty, We Need To Install Package
File1<- data(mtcars)
View(mtcars)
To know about which class data belongs to class(File1)
Import the data without header file Myfile<- read.csv(file.choose(), sep=””, header=FALSE)
To store the data from one data base to another Myfile<- as.data.frame(mtcars)
Cleaning of Data
Mismatch Data
Missing Values
Irrelevant Data
Outliers
Infeasible value (Ex: Age can never be negative)
Redundant Data
Avg_newspaper= mean((Advertising$NewspaperAds),na.rm
=TRUE)
Substituting the value of mean in Avg_newspaper variable
Advertising$NewspaperAds[is.na(Advertising$NewspaperAds)]<-
Avg_newspaper
Putting the mean at the position where NA is written
View(Advertising$NewspaperAds)
OR
Visualization
Before plotting up the graphs…we just need to load the package
For that use command:
library(ggplot2)
R Commands
To create a histogram hist(Advertising$RadioAds)
To create a scatter plot plot(Advertising$RadioAds)
cbind(x,y)
This will only work when both vectors are of
same size
O/p will be
21 7
22 8
23 9
Binding vectors in row-wise x<-21:23
y<- 7:9
rbind(x,y)
This will only work when both vectors are of
same size
O/p will be
21 22 23
7 8 9