Brian Erly, MD MPH, is a physician and epidemiologist. He currently works as a primary care provider at Marathon Health and as a telemedicine physician with Mochi Health. He also serves as the medical director of the Salish Research Group, which works at the intersection of health science, data science, and novel statistical methods.
You can learn more about Dr. Erly’s experience by accessing his CV in the menu bar or by interacting with the visualization below.
Show the code
# Load packagessuppressPackageStartupMessages(library(tidyverse))suppressPackageStartupMessages(library(lubridate))# Read in data, specify column typesNetwork_Data <-read_csv("data/Network_Data.csv",col_types ="cicflilc") %>%mutate(Date =mdy(Date))### Principal Components analysis# See https://towardsdatascience.com/understanding-dimension-reduction-and-principal-component-analysis-in-r-e3fbd02b29ae# Perform principal components analsis (for 3d graphing)pca <- Network_Data %>%select(-Title, - Link, -Date) %>%mutate(across(everything(),as.numeric ) ) %>%prcomp(scale =TRUE)# Extract principal componentspca_x <- pca$x %>%data.frame() %>%`colnames<-`(c("PCA1","PCA2","PCA3","PCA4","PCA5"))# Add in PCA output to graphNetwork_Data_Plot <- Network_Data %>%mutate(PCA1 = pca_x$PCA1,PCA2 = pca_x$PCA2 )### Generate plotly visualizationfig <- plotly::plot_ly(Network_Data_Plot,x =~PCA1,y =~PCA2,z =~Date,marker =list(size =5,opacity =0.8) ) %>% plotly::add_markers(color =~Category,customdata =~Link,text =~Title,hoverinfo ="text")%>% plotly::config(displayModeBar =FALSE)# Make points clikcable (if links available)# See https://stackoverflow.com/questions/51681079/how-to-make-scatterplot-points-open-a-hyperlink-using-ggplotly-rfiggy <- htmlwidgets::onRender(fig, " function(el, x) { el.on('plotly_click', function(d) { var Link = d.points[0].customdata; //Link window.open(Link); }); } ")# Display graph outputfiggy
Click on the graph to view additional works and resources.
Page created in R Markdown and Quarto. Source code available in GitHub.