Skip to content

Instantly share code, notes, and snippets.

View timelyportfolio's full-sized avatar

timelyportfolio timelyportfolio

View GitHub Profile
@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 / .block
Last active December 10, 2021 02:30
vue and networkD3 in R
license: mit
@timelyportfolio
timelyportfolio / .block
Last active September 28, 2021 13:28
trelliscope and sparkline example
license: mit
@timelyportfolio
timelyportfolio / Readme.md
Last active August 15, 2021 17:49
R visualization of arules with arulesViz + igraph + visNetwork

Interactive arules with arulesViz and visNetwork

In response to visNetwork issue #6, here is some code to demonstrate how we might interactively visualize an arules object in R using the new htmlwidget visNetwork. Fortunately, arulesViz has already done a lot of the plumbing for us.

# visNetwork view of arules

library(arules)
library(arulesViz)
library(visNetwork)
@timelyportfolio
timelyportfolio / Readme.md
Last active July 21, 2021 14:36
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.

vueR

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 = "https://unpkg.com/vue@2.2.6") to the tagList().

devtools::install_github("timelyportfolio/vueR")`
@timelyportfolio
timelyportfolio / code.R
Last active July 9, 2021 18:52
R | Turf.js with V8
#devtools::install("jeroenooms/V8")
library("V8")
library(pipeR)
ct = new_context("window")
# min.js gives me a call stack size error but non-min works fine
ct$source(
"https://raw.githubusercontent.com/morganherlocker/turf/master/turf.js"
)
# one of the examples from turf API docs
@timelyportfolio
timelyportfolio / horizon plot.r
Created June 15, 2012 20:18
R Horizon Chart
require(lattice)
require(latticeExtra)
require(reshape2)
require(quantmod)
#set up horizon plots as a function
horizonplot <- function(prices,horizon.type="offset",scale=0.05,title=NA,alpha=0.4){
#get change in prices since beginning or 1st row
prices.change <- prices[,4]/as.numeric(prices[1,4])-1
#get as a data.frame so it will work well with melt and lattice
@timelyportfolio
timelyportfolio / .block
Last active April 5, 2021 05:49
geo pivot table with turf and leaflet
license: mit
@timelyportfolio
timelyportfolio / .block
Last active February 20, 2021 13:03
R base graphics with d3-annotation
license: mit
@timelyportfolio
timelyportfolio / Readme.md
Last active February 20, 2021 12:48
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.

useful?

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.

library(htmltools)