The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
library(lubridate)
Attaching package: 'lubridate'
The following objects are masked from 'package:base':
date, intersect, setdiff, union
library(ggplot2)library(plotly)
Attaching package: 'plotly'
The following object is masked from 'package:ggplot2':
last_plot
The following object is masked from 'package:stats':
filter
The following object is masked from 'package:graphics':
layout
library(ggpubr)
Overview of Fuel Types and total number of transcations
fueldata <- fueldata |>select(-X, -X_id) #removing X and X_id column#converting date from str to datedate <- fueldata$TransactionDateutcdate <-ymd_hms(date)#unique Fueltypes or types of fuelsunique(fueldata$Fuel_Type)
Min. 1st Qu. Median Mean 3rd Qu. Max.
1 1869 1999 2005 2139 9000
mean(fueldata$Price)
[1] 2005.467
median(fueldata$Price)
[1] 1999
sd(fueldata$Price)
[1] 203.584
#Histogram of dataggplot(fueldata,aes(Price))+geom_histogram(fill="orange", bins=40)+theme_minimal()
Fuel types and Prices
All fuel types does not cost similar price at any given time as many differnt factors account for the pricing. For example, LPG is one of cheapest fuel while PULP 98 is the expensive fuel type.
Average pricing of all fuel types.
#Fuel prices by fuel typeggplot(fueldata,aes(x=Fuel_Type, y=Price,fill=Fuel_Type))+geom_boxplot()+theme_minimal()+coord_flip()
Trend of FUEL Price by month
# monthly prices fueldata <- fueldata |># update data with the new column monthmutate(month =month(date))monthly <- fueldata |>group_by(month, Fuel_Type, colour=Fuel_Type) |>summarise(AveragePrice=mean(Price))
`summarise()` has grouped output by 'month', 'Fuel_Type'. You can override
using the `.groups` argument.