Description Usage Arguments Value See Also Examples
Create href that points to another trelliscope display with optional state
1 2 3 |
state |
the state of the display to link to, using |
label |
label of the href |
desc, group, defLabel, defActive, filterable, sortable, log |
arguments passed to |
target |
value to be used for the |
a hash string
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | ## Not run:
library(ggplot2)
vdbConn(tempfile(), autoYes = TRUE)
# divide housing data by county
byCounty <- divide(housingData::housing, by = c("county", "state"))
xlim <- as.Date(c("2008-01-31", "2016-01-31"))
# plot list price vs. time for each county
makeDisplay(byCounty, name = "county_time",
panelFn = function(x)
ggplot(x, aes(time, medListPriceSqft)) +
geom_point() + xlim(xlim))
# divide housing data by state
byState <- divide(housingData::housing, by = "state")
# create a "displayHref" cognostic that links to the by county display
# filtered down to all counties in the current state
cogFn <- function(x) {
state <- stateSpec(
name = "county_time",
sort = list(county = "asc"),
layout = list(nrow = 2, ncol = 4),
filter = list(state = list(select = getSplitVar(x, "state"))))
list(countyPlots = cogDisplayHref(state = state, defLabel = TRUE))
}
# plot distribution of list price vs. time for each state
makeDisplay(byState, name = "state_time_CI",
panelFn = function(x)
ggplot(x, aes(time, medListPriceSqft)) +
stat_summary(fun.data = "mean_cl_boot") + xlim(xlim),
cogFn = cogFn)
# open up the state display
# try clicking on the link for "countyPlots"
# the by county display will be loaded filtered to the state
view("state_time_CI")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.