Skip to content

Instantly share code, notes, and snippets.

Avatar

timelyportfolio timelyportfolio

View GitHub Profile
@timelyportfolio
timelyportfolio / example.R
Created Sep 16, 2020
d3 calendar in R from observable/robservable
View example.R
# 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 Aug 7, 2020
avoid data duplication in R leaflet
View nymap.R
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 Jul 4, 2020
rhansontable tooltips on column headers
View example.R
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 Jul 3, 2020
cell in rhansontable trigger modal with additional information
View example.R
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 Jul 2, 2020
summary widget with flexdashboard valueBox
View example.Rmd
---
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 Apr 23, 2020
rotate and fit scatterD3
View code.R
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 Oct 23, 2018
dygraphs R with external data
View .block
license: mit
@timelyportfolio
timelyportfolio / .block
Created Oct 23, 2018
dygraphs R with external data
View .block
license: mit
@timelyportfolio
timelyportfolio / .block
Created Aug 31, 2018
dt with heading tooltips
View .block
license: mit
@timelyportfolio
timelyportfolio / .block
Created Aug 31, 2018
dt with heading tooltips
View .block
license: mit
You can’t perform that action at this time.