Skip to content

Instantly share code, notes, and snippets.


timelyportfolio timelyportfolio

View GitHub Profile
timelyportfolio / .block
Last active Apr 5, 2021
geo pivot table with turf and leaflet
View .block
license: mit
timelyportfolio / .block
Last active Feb 20, 2021
R base graphics with d3-annotation
View .block
license: mit
timelyportfolio /
Last active Feb 20, 2021
svg as reactiveValue in Shiny used with uiOutput

Just playing around with svg from svglite, and I wondered if the svg output would work as reactiveValue in Shiny. Of course, it does. Then, I wanted to confirm that functions could be used for render*Output, and yes they can.


Is this useful? svg works really well in responsive contexts, so this might be helpful in that situation. Also, we could dynamically render svg spinners or animations on load or for other feedback. Let me know if you think of use cases.

functions for render*Output can help immensely.

timelyportfolio /
Created Apr 24, 2017
really dumb way to combine Vue and Shiny in R

See the following for more examples combining R/Shiny and vuejs. All keep a global state store (not good practice) updated by shiny::sendCustomMessage().

  1. simple example
  2. more advanced d2b sunburst example


Please note this is for illustration purposes only. vue is not needed at all, since all of this can easily be handled within Shiny.

timelyportfolio / fat tails to the upside.r
Last active Jan 20, 2021
exceptional case of the Russell 2000
View fat tails to the upside.r
#explore exceptional case of the Russell 2000
getSymbols("^RUT", from = "1900-01-01")
getSymbols("^GSPC", from = "1900-01-01")
#do initial exploration of distribution
timelyportfolio /
Created Apr 19, 2016 — forked from jcheng5/
Using arbitrary Leaflet plugins with Leaflet for R

Using arbitrary Leaflet JS plugins with Leaflet for R

The Leaflet JS mapping library has lots of plugins available. The Leaflet package for R provides direct support for some, but far from all, of these plugins, by providing R functions for invoking the plugins.

If you as an R user find yourself wanting to use a Leaflet plugin that isn't directly supported in the R package, you can use the technique shown here to load the plugin yourself and invoke it using JS code.

timelyportfolio /
Last active Nov 5, 2020
R Shiny and Vue Simple Example

Shiny == good & Vue == good | Shiny + Vue == good?

Shiny Shiny.shinyapp.$inputValues acts like a store of state. I thought it would be fun to let vuejs react to changes in Shiny input values. This example is intentionally very simple to hopefully self-explain.


I have assembled vueR package, like d3r and reactR, to offer helpers for vuejs. For this example please install vueR, or just add tags$script(src = "") to the tagList().

timelyportfolio / .block
Last active Oct 27, 2020
R leaflet tooltips with plotly htmlwidget
View .block
license: mit
timelyportfolio / example.R
Created Sep 16, 2020
d3 calendar in R from observable/robservable
View example.R
# remotes::install_github("juba/robservable")
# see entire notebook
# only see the chart
timelyportfolio / nymap.R
Last active Aug 7, 2020
avoid data duplication in R leaflet
View nymap.R
ny_counties <- get_acs(