I was looking for some overlay capabilities in this package like one existed in rCharts: d1$layer(with a different datasource). However when I ran the example #49, it doesn't seem to be working. I'm not sure whether its the problem with chrome or package itself. At least in Rstudio it didn't work either.
example 49 multiple layers qq style plot with 2 datasets
df <- data.frame(
id = 1:100,
x=ppoints(100),
y=sort(rnorm(100)), #100 random normal distributed points
normref=qnorm(ppoints(100))#lattice uses ppoints for the x
)
dimple(
y ~ x, #x ~ id for a different look
groups = c("id","sample"),
data = df[,c("id","x","y")], #specify columns to prove diff data
type = "bubble"
) %>%
xAxis(type="addMeasureAxis",orderRule="x") -> d1
d1
now add a layer with a line to represent normal distribution
! note: this is buggy with Chrome, but works in IE (don't hear that often)
will eventually add full layer integration for dimple
d1$x$options$layers = list(list(
x = "x",
y = "normref",
groups = c("id","sample"),
data=df[,c("id","x","normref")], #specify columns to prove diff data
type="line"
))
layers don't line up
for now to make it work, need overrideMin and overrideMax
Hi,
I was looking for some overlay capabilities in this package like one existed in rCharts: d1$layer(with a different datasource). However when I ran the example #49, it doesn't seem to be working. I'm not sure whether its the problem with chrome or package itself. At least in Rstudio it didn't work either.
example 49 multiple layers qq style plot with 2 datasets
df <- data.frame( id = 1:100, x=ppoints(100), y=sort(rnorm(100)), #100 random normal distributed points
normref=qnorm(ppoints(100))#lattice uses ppoints for the x )
dimple( y ~ x, #x ~ id for a different look groups = c("id","sample"), data = df[,c("id","x","y")], #specify columns to prove diff data type = "bubble" ) %>% xAxis(type="addMeasureAxis",orderRule="x") -> d1 d1
now add a layer with a line to represent normal distribution
! note: this is buggy with Chrome, but works in IE (don't hear that often)
will eventually add full layer integration for dimple
d1$x$options$layers = list(list( x = "x", y = "normref", groups = c("id","sample"), data=df[,c("id","x","normref")], #specify columns to prove diff data type="line" ))
layers don't line up
for now to make it work, need overrideMin and overrideMax
d1 %>% yAxis( overrideMin = min(df$y), overrideMax = max(df$y), outputFormat = "0.2f" ) %>% xAxis( overrideMin = 0, overrideMax = 1)