Skip to content

Instantly share code, notes, and snippets.

View rasyidstat's full-sized avatar
🇮🇩

Rasyid Ridha rasyidstat

🇮🇩
  • Indonesia
View GitHub Profile
df_ho %>%
select(-date) %>%
mutate_each(funs(as.POSIXct(paste("2017-01-01", .))), -day) %>%
ggplot(aes(dep_time, arr_time, color=day)) + geom_point() +
geom_smooth(method="lm", color="steelblue") +
theme_ipsum_rc(grid="X") +
labs(title="When do I depart and arrive from home to office?",
subtitle=paste(month(min(df_ho$date), label=T), year(min(df_ho$date)), '-',
month(max(df_ho$date), label=T), year(max(df_ho$date))),
caption=paste("Number of trips from home to main office:", nrow(df_ho)),
df_ho %>%
select(-date, -day) %>%
gather(key = type, value = time) %>%
mutate(time = as.POSIXct(paste("2017-01-01", time))) %>%
ggplot(aes(time, fill=type)) + geom_density(color=NA, alpha=0.4) +
theme_ipsum_rc(grid="X") +
labs(title="When do I depart and arrive from home to office?",
subtitle=paste(month(min(df_ho$date), label=T), year(min(df_ho$date)), '-',
month(max(df_ho$date), label=T), year(max(df_ho$date))),
caption=paste("Number of trips from home to main office:", nrow(df_ho)),
@rasyidstat
rasyidstat / exploding_boxplot_test
Created February 1, 2017 14:35 — forked from abresler/exploding_boxplot_test
Expoding Boxplot Function & nbastatR test use case
# load_packages -----------------------------------------------------------
packages <-
c('nbastatR', #devtools::install_github("abresler/nbastatR")
'explodingboxplotR', #devtools::install_github("timelyportfolio/explodingboxplotR")
'ggplot2',
'dplyr',
'purrr',
'magrittr')
# Free Writing.docx
# 20 sessions
FW <- c("Minggu Tenang yang Tidak Tenang", "3,5 Tahun?", "Study, Role and Future", "Beyond Average", "Thank You", "Berkaca Dulu", "Tamparan", "Light", "Improvement", "Social Intelligence", "The Algorithm", "Do More", "Be Smart Leader", "Become Statistician’s Expert", "I am so little, I need more XP", "Try Again Next Time", "Embrace the pain", "This life is a test", "A man of substance", "My 87th day of unemployment")
# Knowledge Writing.docx
# 12 sessions
KW <- c("Buku yang sudah saya baca", "Money", "Simpulan dari buku Predictably Irrational", "Menjadi Lelaki Sejati", "Hidup", "Pertanyaan yang dapat meningkatkan relasi", "Berpikir Kritis", "Sekilas Tentang LPDP", "Manfaat Membaca", "Role Model as Illusional Partners", "Analisis Personal dan Memasuki Dunia Kerja")
# [1]/English Writing.docx
# 3 sessions
# Correlation
library(Hmisc)
cor <- rcorr(as.matrix(heart))
library(corrplot)
corrplot(cor$r)