Skip to content

Instantly share code, notes, and snippets.

View timelyportfolio's full-sized avatar

timelyportfolio timelyportfolio

View GitHub Profile
@timelyportfolio
timelyportfolio / example.R
Created September 16, 2020 20:38
d3 calendar in R from observable/robservable
# remotes::install_github("juba/robservable")
library(robservable)
# see entire notebook
robservable("@timelyportfolio/a-github-inspired-calendar")
# only see the chart
robservable(
"@timelyportfolio/a-github-inspired-calendar",
@timelyportfolio
timelyportfolio / nymap.R
Last active August 7, 2020 21:51
avoid data duplication in R leaflet
library(tidycensus)
library(leaflet)
library(tidyr)
library(dplyr)
library(purrr)
library(sf)
library(htmlwidgets)
library(svglite)
ny_counties <- get_acs(
@timelyportfolio
timelyportfolio / example.R
Last active February 9, 2022 03:59
rhansontable tooltips on column headers
library(rhandsontable)
library(htmltools)
browsable(tagList(
rhandsontable(
data = mtcars,
rowHeaders = NULL,
# see http://jsfiddle.net/pn3rv48p/ for another example with afterGetColHeader
afterGetColHeader = htmlwidgets::JS(htmltools::HTML(
sprintf(
@timelyportfolio
timelyportfolio / example.R
Created July 3, 2020 22:40
cell in rhansontable trigger modal with additional information
library(shiny)
library(htmltools)
library(rhandsontable)
library(dplyr)
rht <- rhandsontable(
head(mtcars) %>%
mutate(name = rownames(.)) %>%
select(name, everything()),
rowHeaders = NULL
@timelyportfolio
timelyportfolio / example.Rmd
Last active February 5, 2024 19:34
summary widget with flexdashboard valueBox
---
title: "Example of filtered values boxes"
output:
flexdashboard::flex_dashboard:
orientation: rows
vertical_layout: fill
mathjax: null
---
```{r setup, include=FALSE}
@timelyportfolio
timelyportfolio / code.R
Last active April 23, 2020 01:03
rotate and fit scatterD3
library(htmltools)
library(scatterD3)
sd3 <- scatterD3(x = mtcars$wt, y = mtcars$mpg, data=NULL, lab = rownames(mtcars),
col_var = mtcars$cyl, symbol_var = mtcars$am,
xlab = "Weight", ylab = "Mpg", col_lab = "Cylinders",
symbol_lab = "Manual transmission", html_id = NULL, height = 300, width = 500)
browsable(
tags$div(
@timelyportfolio
timelyportfolio / .block
Created October 23, 2018 01:21
dygraphs R with external data
license: mit
@timelyportfolio
timelyportfolio / .block
Created October 23, 2018 01:21
dygraphs R with external data
license: mit
@timelyportfolio
timelyportfolio / .block
Created August 31, 2018 03:38
dt with heading tooltips
license: mit
@timelyportfolio
timelyportfolio / .block
Created August 31, 2018 03:38
dt with heading tooltips
license: mit