Skip to content

Instantly share code, notes, and snippets.

View akshat3096's full-sized avatar

Akshat arora akshat3096

View GitHub Profile
install.packages("lubridate")
library(lubridate)
#make endDate in a date-time variable POSIXct using lubridate with Indian time zone
df$endDate <-ymd_hms(df$endDate,tz="UTC")
#new features 
df$month<-format(df$endDate,"%m")
df$year<-format(df$endDate,"%Y")
str(df)
table(df$type)
library(dplyr)
joined_data <- left_join(data,fc,by="center_id")
ggplot(data = data) +
aes(x = checkout_price, y = base_price) +
geom_point(color = "#1f9e89") +
theme_minimal()
ggplot(data = data) +
aes(x = num_orders, y = num_orders) +
geom_violin(scale = "area", adjust = 1, fill = "#0c4c8a") +
theme_minimal()
install.packages("ggplot2")
library(ggplot2)
ggplot(data = data) +
aes(x = num_orders) +
geom_density(adjust = 1, fill = "#0c4c8a") +
theme_minimal()
dist+transition_states(month, wrap = FALSE) +
shadow_mark()
df %>%
filter(type == 'HKQuantityTypeIdentifierDistanceWalkingRunning') %>%
group_by(year,month) %>%
summarize(distance=sum(value)) %>%
print (n=100) %>%
ggplot(aes(x=month, y=distance, fill=year)) +
geom_bar(position='dodge', stat='identity') +
scale_y_continuous(labels = scales::comma) +
theme(panel.grid.major = element_blank())
flight+transition_states(month, wrap = FALSE) +
shadow_mark()