Description Usage Arguments Details Value Author(s) Examples
Interfaces to lattice
functions that can be used
in a pipeline implemented by magrittr
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ntbt_barchart(data, ...)
ntbt_bwplot(data, ...)
ntbt_cloud(data, ...)
ntbt_contourplot(data, ...)
ntbt_densityplot(data, ...)
ntbt_dotplot(data, ...)
ntbt_histogram(data, ...)
ntbt_levelplot(data, ...)
ntbt_oneway(data, ...)
ntbt_parallelplot(data, ...)
ntbt_qq(data, ...)
ntbt_qqmath(data, ...)
ntbt_splom(data, ...)
ntbt_stripplot(data, ...)
ntbt_tmd(data, ...)
ntbt_wireframe(data, ...)
ntbt_xyplot(data, ...)
|
data |
data frame, tibble, list, ... |
... |
Other arguments passed to the corresponding interfaced function. |
Interfaces call their corresponding interfaced function.
Object returned by interfaced function.
Roberto Bertolusso
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | ## Not run:
library(intubate)
library(magrittr)
library(lattice)
## barchart
## Original function to interface
barchart(yield ~ variety | site, data = barley,
groups = year, layout = c(1,6), stack = TRUE,
auto.key = list(space = "right"),
ylab = "Barley Yield (bushels/acre)",
scales = list(x = list(rot = 45)))
## The interface reverses the order of data and formula
ntbt_barchart(data = barley, yield ~ variety | site,
groups = year, layout = c(1,6), stack = TRUE,
auto.key = list(space = "right"),
ylab = "Barley Yield (bushels/acre)",
scales = list(x = list(rot = 45)))
## so it can be used easily in a pipeline.
barley %>%
ntbt_barchart(yield ~ variety | site,
groups = year, layout = c(1,6), stack = TRUE,
auto.key = list(space = "right"),
ylab = "Barley Yield (bushels/acre)",
scales = list(x = list(rot = 45)))
## bwplot
## Original function to interface
bwplot(voice.part ~ height, data = singer, xlab = "Height (inches)")
## The interface reverses the order of data and formula
ntbt_bwplot(data = singer, voice.part ~ height, xlab = "Height (inches)")
## so it can be used easily in a pipeline.
singer %>%
ntbt_bwplot(voice.part ~ height, xlab = "Height (inches)")
## cloud
## Original function to interface
cloud(Sepal.Length ~ Petal.Length * Petal.Width | Species, data = iris,
screen = list(x = -90, y = 70), distance = .4, zoom = .6)
## The interface reverses the order of data and formula
ntbt_cloud(data = iris, Sepal.Length ~ Petal.Length * Petal.Width | Species,
screen = list(x = -90, y = 70), distance = .4, zoom = .6)
## so it can be used easily in a pipeline.
iris %>%
ntbt_cloud(Sepal.Length ~ Petal.Length * Petal.Width | Species,
screen = list(x = -90, y = 70), distance = .4, zoom = .6)
## contourplot
grid <- with(
environmental,
{
ozo.m <- loess((ozone^(1/3)) ~ wind * temperature * radiation,
parametric = c("radiation", "wind"), span = 1, degree = 2)
w.marginal <- seq(min(wind), max(wind), length.out = 50)
t.marginal <- seq(min(temperature), max(temperature), length.out = 50)
r.marginal <- seq(min(radiation), max(radiation), length.out = 4)
wtr.marginal <- list(wind = w.marginal, temperature = t.marginal,
radiation = r.marginal)
ret <- expand.grid(wtr.marginal)
ret[, "fit"] <- c(predict(ozo.m, ret))
ret
})
## Original function to interface
contourplot(fit ~ wind * temperature | radiation, data = grid,
cuts = 10, region = TRUE,
xlab = "Wind Speed (mph)",
ylab = "Temperature (F)",
main = "Cube Root Ozone (cube root ppb)")
## The interface reverses the order of data and formula
ntbt_contourplot(data = grid, fit ~ wind * temperature | radiation,
cuts = 10, region = TRUE,
xlab = "Wind Speed (mph)",
ylab = "Temperature (F)",
main = "Cube Root Ozone (cube root ppb)")
## so it can be used easily in a pipeline.
grid %>%
ntbt_contourplot(fit ~ wind * temperature | radiation,
cuts = 10, region = TRUE,
xlab = "Wind Speed (mph)",
ylab = "Temperature (F)",
main = "Cube Root Ozone (cube root ppb)")
## densityplot
## Original function to interface
densityplot(~ height | voice.part, data = singer, layout = c(2, 4),
xlab = "Height (inches)", bw = 5)
## The interface reverses the order of data and formula
ntbt_densityplot(data = singer, ~ height | voice.part, layout = c(2, 4),
xlab = "Height (inches)", bw = 5)
## so it can be used easily in a pipeline.
singer %>%
ntbt_densityplot(~ height | voice.part, layout = c(2, 4),
xlab = "Height (inches)", bw = 5)
## dotplot
## Original function to interface
dotplot(variety ~ yield | site, data = barley, groups = year,
key = simpleKey(levels(barley$year), space = "right"),
xlab = "Barley Yield (bushels/acre) ",
aspect=0.5, layout = c(1,6), ylab=NULL)
## The interface reverses the order of data and formula
ntbt_dotplot(data = barley, variety ~ yield | site, groups = year,
key = simpleKey(levels(barley$year), space = "right"),
xlab = "Barley Yield (bushels/acre) ",
aspect=0.5, layout = c(1,6), ylab=NULL)
## so it can be used easily in a pipeline.
barley %>%
ntbt_dotplot(variety ~ yield | site, groups = year,
key = simpleKey(levels(barley$year), space = "right"),
xlab = "Barley Yield (bushels/acre) ",
aspect=0.5, layout = c(1,6), ylab=NULL)
## histogram
## Original function to interface
histogram(~ height | voice.part, data = singer,
xlab = "Height (inches)", type = "density",
panel = function(x, ...) {
panel.histogram(x, ...)
panel.mathdensity(dmath = dnorm, col = "black",
args = list(mean=mean(x),sd=sd(x)))
})
## The interface reverses the order of data and formula
ntbt_histogram(data = singer, ~ height | voice.part,
xlab = "Height (inches)", type = "density",
panel = function(x, ...) {
panel.histogram(x, ...)
panel.mathdensity(dmath = dnorm, col = "black",
args = list(mean=mean(x),sd=sd(x)))
})
## so it can be used easily in a pipeline.
singer %>%
ntbt_histogram(~ height | voice.part,
xlab = "Height (inches)", type = "density",
panel = function(x, ...) {
panel.histogram(x, ...)
panel.mathdensity(dmath = dnorm, col = "black",
args = list(mean=mean(x),sd=sd(x)))
})
## levelplot
x <- seq(pi/4, 5 * pi, length.out = 100)
y <- seq(pi/4, 5 * pi, length.out = 100)
r <- as.vector(sqrt(outer(x^2, y^2, "+")))
grid <- expand.grid(x = x, y = y)
grid$z <- cos(r^2) * exp(-r/(pi^3))
## Original function to interface
levelplot(z ~ x*y, grid, cuts = 50, scales = list(log = "e"), xlab = "",
ylab = "", main = "Weird Function", sub = "with log scales",
colorkey = FALSE, region = TRUE)
## The interface reverses the order of data and formula
ntbt_levelplot(grid, z ~ x*y, cuts = 50, scales = list(log = "e"), xlab = "",
ylab = "", main = "Weird Function", sub = "with log scales",
colorkey = FALSE, region = TRUE)
## so it can be used easily in a pipeline.
grid %>%
ntbt_levelplot(z ~ x*y, cuts = 50, scales = list(log = "e"), xlab = "",
ylab = "", main = "Weird Function", sub = "with log scales",
colorkey = FALSE, region = TRUE)
## oneway
## Original function to interface
fit <- oneway(height ~ voice.part, data = singer, spread = 1)
rfs(fit, aspect = 1)
## The interface reverses the order of data and formula
fit <- ntbt_oneway(data = singer, height ~ voice.part, spread = 1)
rfs(fit, aspect = 1)
## so it can be used easily in a pipeline.
singer %>%
ntbt_oneway(height ~ voice.part, spread = 1) %>%
rfs(aspect = 1)
## parallelplot
## Original function to interface
parallelplot(~iris[1:4], iris, groups = Species,
horizontal.axis = FALSE, scales = list(x = list(rot = 90)))
## The interface reverses the order of data and formula
ntbt_parallelplot(iris, ~iris[1:4], groups = Species,
horizontal.axis = FALSE, scales = list(x = list(rot = 90)))
## so it can be used easily in a pipeline.
iris %>%
ntbt_parallelplot(~iris[1:4], groups = Species,
horizontal.axis = FALSE, scales = list(x = list(rot = 90)))
## qq
## Original function to interface
qq(voice.part ~ height, data = singer, aspect = 1,
subset = (voice.part == "Bass 2" | voice.part == "Tenor 1"))
## The interface reverses the order of data and formula
ntbt_qq(data = singer, voice.part ~ height, aspect = 1,
subset = (voice.part == "Bass 2" | voice.part == "Tenor 1"))
## so it can be used easily in a pipeline.
singer %>%
ntbt_qq(voice.part ~ height, aspect = 1,
subset = (voice.part == "Bass 2" | voice.part == "Tenor 1"))
## qqmath
## Original function to interface
qqmath(~ height | voice.part, data = singer, aspect = "xy",
prepanel = prepanel.qqmathline,
panel = function(x, ...) {
panel.qqmathline(x, ...)
panel.qqmath(x, ...)
})
## The interface reverses the order of data and formula
ntbt_qqmath(data = singer, ~ height | voice.part, aspect = "xy",
prepanel = prepanel.qqmathline,
panel = function(x, ...) {
panel.qqmathline(x, ...)
panel.qqmath(x, ...)
})
## so it can be used easily in a pipeline.
singer %>%
ntbt_qqmath(~ height | voice.part, aspect = "xy",
prepanel = prepanel.qqmathline,
panel = function(x, ...) {
panel.qqmathline(x, ...)
panel.qqmath(x, ...)
})
## splom
super.sym <- trellis.par.get("superpose.symbol")
## Original function to interface
splom(~ iris[1:4], data = iris, groups = Species,
panel = panel.superpose,
key = list(title = "Three Varieties of Iris",
columns = 3,
points = list(pch = super.sym$pch[1:3],
col = super.sym$col[1:3]),
text = list(c("Setosa", "Versicolor", "Virginica"))))
splom(~ iris[1:3] | Species, data = iris,
layout=c(2,2), pscales = 0,
varnames = c("Sepal\nLength", "Sepal\nWidth", "Petal\nLength"),
page = function(...) {
ltext(x = seq(.6, .8, length.out = 4),
y = seq(.9, .6, length.out = 4),
labels = c("Three", "Varieties", "of", "Iris"),
cex = 2)
})
## The interface reverses the order of data and formula
ntbt_splom(data = iris, ~ iris[1:4], groups = Species,
panel = panel.superpose,
key = list(title = "Three Varieties of Iris",
columns = 3,
points = list(pch = super.sym$pch[1:3],
col = super.sym$col[1:3]),
text = list(c("Setosa", "Versicolor", "Virginica"))))
ntbt_splom(data = iris, ~ iris[1:3] | Species,
layout=c(2,2), pscales = 0,
varnames = c("Sepal\nLength", "Sepal\nWidth", "Petal\nLength"),
page = function(...) {
ltext(x = seq(.6, .8, length.out = 4),
y = seq(.9, .6, length.out = 4),
labels = c("Three", "Varieties", "of", "Iris"),
cex = 2)
})
## so it can be used easily in a pipeline.
iris %>%
ntbt_splom(~ iris[1:4], groups = Species,
panel = panel.superpose,
key = list(title = "Three Varieties of Iris",
columns = 3,
points = list(pch = super.sym$pch[1:3],
col = super.sym$col[1:3]),
text = list(c("Setosa", "Versicolor", "Virginica"))))
iris %>%
ntbt_splom(~ iris[1:3] | Species,
layout=c(2,2), pscales = 0,
varnames = c("Sepal\nLength", "Sepal\nWidth", "Petal\nLength"),
page = function(...) {
ltext(x = seq(.6, .8, length.out = 4),
y = seq(.9, .6, length.out = 4),
labels = c("Three", "Varieties", "of", "Iris"),
cex = 2)
})
## stripplot
## Original function to interface
stripplot(voice.part ~ jitter(height), data = singer, aspect = 1,
jitter.data = TRUE, xlab = "Height (inches)")
## The interface reverses the order of data and formula
ntbt_stripplot(data = singer, voice.part ~ jitter(height), aspect = 1,
jitter.data = TRUE, xlab = "Height (inches)")
## so it can be used easily in a pipeline.
singer %>%
ntbt_stripplot(voice.part ~ jitter(height), aspect = 1,
jitter.data = TRUE, xlab = "Height (inches)")
## tmd
## Original function to interface
tmd(Sepal.Length + Sepal.Width ~ Petal.Length + Petal.Width | Species,
data = iris, scales = "free", layout = c(2, 2),
auto.key = list(x = .6, y = .7, corner = c(0, 0)))
## The interface reverses the order of data and formula
ntbt_tmd(data = iris,
Sepal.Length + Sepal.Width ~ Petal.Length + Petal.Width | Species,
scales = "free", layout = c(2, 2),
auto.key = list(x = .6, y = .7, corner = c(0, 0)))
## so it can be used easily in a pipeline.
iris %>%
ntbt_tmd(Sepal.Length + Sepal.Width ~ Petal.Length + Petal.Width | Species,
scales = "free", layout = c(2, 2),
auto.key = list(x = .6, y = .7, corner = c(0, 0)))
## wireframe
g <- expand.grid(x = 1:10, y = 5:15, gr = 1:2)
g$z <- log((g$x^g$gr + g$y^2) * g$gr)
## Original function to interface
wireframe(z ~ x * y, data = g, groups = gr,
scales = list(arrows = FALSE),
drape = TRUE, colorkey = TRUE,
screen = list(z = 30, x = -60))
## The interface reverses the order of data and formula
ntbt_wireframe(data = g, z ~ x * y, groups = gr,
scales = list(arrows = FALSE),
drape = TRUE, colorkey = TRUE,
screen = list(z = 30, x = -60))
## so it can be used easily in a pipeline.
g %>%
ntbt_wireframe(z ~ x * y, groups = gr,
scales = list(arrows = FALSE),
drape = TRUE, colorkey = TRUE,
screen = list(z = 30, x = -60))
## xyplot
## Original function to interface
xyplot(Sepal.Length + Sepal.Width ~ Petal.Length + Petal.Width | Species,
data = iris, scales = "free", layout = c(2, 2),
auto.key = list(x = .6, y = .7, corner = c(0, 0)))
## The interface reverses the order of data and formula
ntbt_xyplot(data = iris,
Sepal.Length + Sepal.Width ~ Petal.Length + Petal.Width | Species,
scales = "free", layout = c(2, 2),
auto.key = list(x = .6, y = .7, corner = c(0, 0)))
## so it can be used easily in a pipeline.
iris %>%
ntbt_xyplot(Sepal.Length + Sepal.Width ~ Petal.Length + Petal.Width | Species,
scales = "free", layout = c(2, 2),
auto.key = list(x = .6, y = .7, corner = c(0, 0)))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.