This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str(df) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table(df$type) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(dplyr) | |
joined_data <- left_join(data,fc,by="center_id") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ggplot(data = data) + | |
aes(x = checkout_price, y = base_price) + | |
geom_point(color = "#1f9e89") + | |
theme_minimal() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ggplot(data = data) + | |
aes(x = num_orders, y = num_orders) + | |
geom_violin(scale = "area", adjust = 1, fill = "#0c4c8a") + | |
theme_minimal() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install.packages("ggplot2") | |
library(ggplot2) | |
ggplot(data = data) + | |
aes(x = num_orders) + | |
geom_density(adjust = 1, fill = "#0c4c8a") + | |
theme_minimal() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dist+transition_states(month, wrap = FALSE) + | |
shadow_mark() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flight+transition_states(month, wrap = FALSE) + | |
shadow_mark() |
OlderNewer