Ford <- read.csv(file.choose(), header = T)
Attribute Information:
1.model - > Ford Car Brands
2.year - >Production Year
3.price - >Price of car in $
4.transmission - > Automatic,Manual, Semi-Auto
5.mileage -> Number of miles traveled
6.fuel_Type -> Petrol,Diesel,Hybrid,Electric,Other
7.tax -> Annual Tax
8.mpg - > Miles per Gallon
9.engineSize - > Car’s Engine Size
dim(Ford)
## [1] 17966 9
head(Ford, n=10)
## model year price transmission mileage fuelType tax mpg engineSize
## 1 Fiesta 2017 12000 Automatic 15944 Petrol 150 57.7 1.0
## 2 Focus 2018 14000 Manual 9083 Petrol 150 57.7 1.0
## 3 Focus 2017 13000 Manual 12456 Petrol 150 57.7 1.0
## 4 Fiesta 2019 17500 Manual 10460 Petrol 145 40.3 1.5
## 5 Fiesta 2019 16500 Automatic 1482 Petrol 145 48.7 1.0
## 6 Fiesta 2015 10500 Manual 35432 Petrol 145 47.9 1.6
## 7 Puma 2019 22500 Manual 2029 Petrol 145 50.4 1.0
## 8 Fiesta 2017 9000 Manual 13054 Petrol 145 54.3 1.2
## 9 Kuga 2019 25500 Automatic 6894 Diesel 145 42.2 2.0
## 10 Focus 2018 10000 Manual 48141 Petrol 145 61.4 1.0
tail(Ford)
## model year price transmission mileage fuelType tax mpg engineSize
## 17961 Fiesta 2016 7999 Manual 31348 Petrol 125 54.3 1.2
## 17962 B-MAX 2017 8999 Manual 16700 Petrol 150 47.1 1.4
## 17963 B-MAX 2014 7499 Manual 40700 Petrol 30 57.7 1.0
## 17964 Focus 2015 9999 Manual 7010 Diesel 20 67.3 1.6
## 17965 KA 2018 8299 Manual 5007 Petrol 145 57.7 1.2
## 17966 Focus 2015 8299 Manual 5007 Petrol 22 57.7 1.0
str(Ford)
## 'data.frame': 17966 obs. of 9 variables:
## $ model : chr " Fiesta" " Focus" " Focus" " Fiesta" ...
## $ year : int 2017 2018 2017 2019 2019 2015 2019 2017 2019 2018 ...
## $ price : int 12000 14000 13000 17500 16500 10500 22500 9000 25500 10000 ...
## $ transmission: chr "Automatic" "Manual" "Manual" "Manual" ...
## $ mileage : int 15944 9083 12456 10460 1482 35432 2029 13054 6894 48141 ...
## $ fuelType : chr "Petrol" "Petrol" "Petrol" "Petrol" ...
## $ tax : int 150 150 150 145 145 145 145 145 145 145 ...
## $ mpg : num 57.7 57.7 57.7 40.3 48.7 47.9 50.4 54.3 42.2 61.4 ...
## $ engineSize : num 1 1 1 1.5 1 1.6 1 1.2 2 1 ...
summary(Ford)
## model year price transmission
## Length:17966 Min. :1996 Min. : 495 Length:17966
## Class :character 1st Qu.:2016 1st Qu.: 8999 Class :character
## Mode :character Median :2017 Median :11291 Mode :character
## Mean :2017 Mean :12280
## 3rd Qu.:2018 3rd Qu.:15299
## Max. :2060 Max. :54995
## mileage fuelType tax mpg
## Min. : 1 Length:17966 Min. : 0.0 Min. : 20.80
## 1st Qu.: 9987 Class :character 1st Qu.: 30.0 1st Qu.: 52.30
## Median : 18243 Mode :character Median :145.0 Median : 58.90
## Mean : 23363 Mean :113.3 Mean : 57.91
## 3rd Qu.: 31060 3rd Qu.:145.0 3rd Qu.: 65.70
## Max. :177644 Max. :580.0 Max. :201.80
## engineSize
## Min. :0.000
## 1st Qu.:1.000
## Median :1.200
## Mean :1.351
## 3rd Qu.:1.500
## Max. :5.000
Displaying the values of the selected variables
table(Ford$transmission)
##
## Automatic Manual Semi-Auto
## 1361 15518 1087
table(Ford$model)
##
## B-MAX C-MAX EcoSport
## 355 543 1143
## Edge Escort Fiesta
## 208 1 6557
## Focus Fusion Galaxy
## 4588 16 228
## Grand C-MAX Grand Tourneo Connect KA
## 247 59 199
## Ka+ Kuga Mondeo
## 531 2225 526
## Mustang Puma Ranger
## 57 80 1
## S-MAX Streetka Tourneo Connect
## 296 2 33
## Tourneo Custom Transit Tourneo Focus
## 69 1 1
table(Ford$fuelType)
##
## Diesel Electric Hybrid Other Petrol
## 5762 2 22 1 12179
Displaying the Chart
In this Chart The Price Has Been Given in Dollars
hist(Ford$price)
mean(Ford$price)
## [1] 12279.53
In this Chart The mpg Say that How many Mileage does the Car give.for an approximate result, we divide the fuel economy value by 2.352 to get in kilometer per litre.
hist(Ford$mpg)
mean(Ford$mpg)
## [1] 57.90698
In this Chart the mileage says that how many miles does the car travelled
hist(Ford$mileage)
hist(Ford$engineSize)
hist(Ford$year)
boxplot(Ford$price~Ford$year)
boxplot(Ford$tax)
boxplot(Ford$price ~ Ford$transmission)
boxplot(Ford$mileage)
boxplot(Ford$year)
boxplot(price ~ fuelType ,data = Ford)
barplot(table(Ford$mpg,Ford$fuelType),beside=TRUE)
table(Ford$model)
##
## B-MAX C-MAX EcoSport
## 355 543 1143
## Edge Escort Fiesta
## 208 1 6557
## Focus Fusion Galaxy
## 4588 16 228
## Grand C-MAX Grand Tourneo Connect KA
## 247 59 199
## Ka+ Kuga Mondeo
## 531 2225 526
## Mustang Puma Ranger
## 57 80 1
## S-MAX Streetka Tourneo Connect
## 296 2 33
## Tourneo Custom Transit Tourneo Focus
## 69 1 1
barplot(table(Ford$transmission, Ford$fuelType),beside = TRUE,legend.text = rownames(table(Ford$transmission)))
barplot(table(Ford$transmission=="Automatic",Ford$model),beside = TRUE)
barplot(table(Ford$fuelType),beside = TRUE)
Ford_sub<- subset(Ford, model =="Fiesta", select = c("model","transmission","fuelType","price","year","mpg"))
Ford_sub
## [1] model transmission fuelType price year
## [6] mpg
## <0 rows> (or 0-length row.names)