So I just installed a package in R called trelliscope. It's awesome but I am having trouble with some formatting. It is fairly new and there is not too much documentation about it and wanted to hear some input. So I produced the following code (if you follow the code exactly you will be able to reproduce what I did). The default point color/format on the plots are not to my liking:
install.packages("devtools") # if not installed
devtools::install_github("tesseradata/datadr")
devtools::install_github("tesseradata/trelliscope")
devtools::install_github("hafen/housingData")
library(housingData)
library(datadr)
library(trelliscope)
conn <- vdbConn("vdb", name = "Zillow")
byCounty <- divide(housing,
by = c("county", "state"))
byCounty
# look at a subset of byCounty
byCounty[[1]]
timePanel <- function(x)
xyplot(medListPriceSqft + medSoldPriceSqft ~ time,
data = x, auto.key = TRUE, ylab = "Price / Sq. Ft.")
timePanel
priceCog <- function(x) {
zillowString <- gsub(" ", "-", do.call(paste, getSplitVars(x)))
list(
slope = cog(coef(lm(medListPriceSqft ~ time, data = x))[2],
desc = "list price slope"),
meanList = cogMean(x$medListPriceSqft),
meanSold = cogMean(x$medSoldPriceSqft),
nObs = cog(length(which(!is.na(x$medListPriceSqft))),
desc = "number of non-NA list prices"),
zillowHref = cogHref(
sprintf("http://www.zillow.com/homes/%s_rb/", zillowString),
desc = "zillow link")
)
}
priceCog(byCounty[[1]]$value)
# create the display and add to vdb
makeDisplay(byCounty,
name = "list_sold_vs_time_quickstart",
desc = "List and sold price over time",
panelFn = timePanel,
cogFn = priceCog,
width = 400, height = 400,
lims = list(x = "same"))
view()
After running this code, can someone help me determine how to change the setting of the plot such as color of points, point size, etc. just to make it look better? I am really just looking for a coding structure to change the formatting and then I can go into specifics on my own if I can get a good starting point in the code.
Thanks!