This site is meant to be a resource for those interested in data science, data visualization, business intelligence, dashboarding, and databases. The site is primarily built using rmarkdown. You can check out the blog section for details on how you can build your own.
You may be familiar with the phrase “On the Shoulders of Giants”. A nod to the fact that virtually nothing great is accomplished without the effort and aptitude of those who came before. The wagon required the wheel, the modern computer required the transistor, the light bulb required electricity, ad infinitum. Likewise, this site (and every site for that matter) is built on the shoulders of giants. It’s amazing what we can accomplish with just a bit of giant-hunting (e.g., research).
To further emphasize the idea of standing on giants, check out the table and bar chart hybrid below to learn a bit about what’s involved in building this website. I wrote or contributed all of the RMD, YML, PDFs, CSVs, JPGs, and PNGs, and I contributed a small sliver of the HTML and CSS. The files I did not author or contribute make up the vast majority of this site e.g., the JS, HTML, and CSS. Further consider that I did not develop the languages themselves, design any computer, nor develop the internet. With this in mind, I say thank you to those who made this site possible.
# identify all site files and directories
site_df <- data.frame(
file.info(list.files(include.dirs = TRUE,recursive = TRUE))) %>%
tibble::rownames_to_column("filename")
# calculate # of lines and file type / extension
site_df <- bind_rows(
site_df %>% filter(isdir == TRUE),
site_df %>%
filter(isdir == FALSE) %>%
mutate(lines = sapply(
filename,function(x) filename = length(readLines(x))),
file_ext = toupper(tools::file_ext(filename))
)
) %>%
filter(file_ext != "" & !is.na(file_ext)) %>%
group_by(file_ext) %>%
summarise(Count = n(),
size_mb = sum(size * 0.000001),
lines = sum(lines)) %>%
arrange(desc(Count))
# define format for header
col_format <- JS(
"function(settings, json) {",
"$(this.api().table().header()).css({'background-color': '#252525', 'color': '#FFFFFF'});",
"}")
datatable(site_df
,rownames = FALSE
,colnames = c('Filetype',
'Count of Files',
'Filesize (MB)',
'Lines of Code')
,options=list(
initComplete = col_format,
pageLength=25,
#center all but first column
columnDefs = list(list(className = 'dt-center',targets=2:ncol(site_df)-1)),
dom = 't'
)) %>%
formatStyle(
'size_mb',
background = styleColorBar(range(0,max(site_df$size_mb)), 'orange'),
backgroundSize = '98% 75%',
backgroundRepeat = 'no-repeat',
backgroundPosition = 'center') %>%
formatStyle(
'lines',
background = styleColorBar(range(0,max(site_df$lines)), 'orange'),
backgroundSize = '98% 75%',
backgroundRepeat = 'no-repeat',
backgroundPosition = 'center') %>%
formatStyle(
'Count',
background = styleColorBar(range(0,max(site_df$Count)), 'orange'),
backgroundSize = '98% 75%',
backgroundRepeat = 'no-repeat',
backgroundPosition = 'center')