Questions tagged [lattice]

lattice is a package that forms part of base R and allows the creation of trellis-type graphics.

R's lattice package, developed by Deepayan Sarkar, is a port of Bell Laboratories' Trellis Graphics to R. It is one of the three main graphics options in R, the other two being R's base graphics capabilities and .

Repositories

Vignettes

Books

Other resources

R packages extending lattice

  • latticeDensity: Density estimation and nonparametric regression on irregular regions.
  • latticeExtra: Extra Graphical Utilities Based on Lattice.
  • latticist: A graphical user interface for exploratory visualisation.
  • latticedl: Lattice direct labels, for automatically labeling points.

Related tags

1251 questions
0
votes
3 answers

Generate multiple lattice plots on a grid using lapply in R

How do plot multiple lattice plots onto a single lattice plot where the plots are generated using an lapply function? The following is a demonstration of what I have tried so far using the built in mtcars dataset. require(lattice) response <-…
user2109248
  • 325
  • 1
  • 2
  • 6
0
votes
2 answers

How to use paste function in lattice while having new lines and substitute

Folks, I have the following example where I use lattice for a scatterplot of (random) data. What I am trying to do is paste three variables, in a new line each. The problem is found with the third variable which needs to have a subscript. The code…
Andronikos K.
  • 105
  • 2
  • 9
0
votes
0 answers

Trying to plot time series data using time information only via lattice

I have a time series data for intraday price changes for different products for example: Date.Time Price Product 12/1/2012 13:12:01 15 A 12/1/2012 14:12:05 16 A 15/2/2012 09:09:10 11 B 15/2/2012 08:08:12 10 B I wanted to plot…
laiboonh
  • 1,377
  • 1
  • 9
  • 19
0
votes
0 answers

Is it possible to place panel labels at the bottom in lattice?

Is it possible to place panel labels (i.e. 3gears, 4gears...) at the bottom instead of the top? # Lattice Examples library(lattice) attach(mtcars) # dotplot for each combination of two factors dotplot(cyl.f~mpg|gear.f, main="Dotplot Plot…
Max C
  • 2,573
  • 4
  • 23
  • 28
0
votes
2 answers

Layer plots in R

I need to layer a scatterplot and an allEffects plot. Here are some example data: library("effects") x<-c(1,2,6,7,4,3,5) y<-c(5,6,3,6,9,4,4) a<-as.factor(c(1,1,1,2,2,2,2)) xyplot(y ~ x|a) lm.y<-lm(y~x*a) plot(allEffects(lm.y)) To be clear, I would…
Rebecca
  • 3
  • 1
0
votes
1 answer

How to add points to multi-panel Lattice graphics bwplot?

I'm making box-and-whisker plots in Lattice with bwplot. I want to add points for means. I've figured out how to do this for simple plots using panel.points. However, when I make a multi-panel bwplot using + and outer=TRUE, I don't know how to…
Mars
  • 8,689
  • 2
  • 42
  • 70
0
votes
0 answers

How can I specify a specific 'fill' for points in a lattice plot key?

A simple example of what I hope would work: library(lattice) xyplot(1~1, key=list( text=list( c("a", "b") ), points=list(pch=21, fill=c("red", "blue")) ## note pch=21 => filled circle ) ) One would expect the points being used in the…
Kevin Ushey
  • 20,530
  • 5
  • 56
  • 88
0
votes
1 answer

customizing grid for dotchart in ggplot2?

How can I plot a dotchart like lattice's dotchart in ggplot2 that has thicker grid lines and only horizontal grid lines (ie remove the vertical grid lines), kind of like this: Except make the horizontal lines even bolder so that they are more…
user248237
0
votes
1 answer

No effect of colorkey.space attribute in lattice's levelplot function

I try to draw the color key on the left side, but when adding the attribute colorkey.space="left" to the levelplot function, the color key does not move at all but is still on the right (default) side. Anyone knows if this is a bug, or am I missing…
user2015601
0
votes
1 answer

Controlling percentage axis and adding values to HH Likert plot

Consider the following minimal example: tab = structure(c(187, 189, 205, 167, 273, 275, 295, 231, 385, 575, 409, 363, 899, 707, 751, 667, 2007, 1953, 2101, 2531, 1043, 1023, 1071, 971, 385, 575, 409, 363, 181, 241, 157, 163, 123, 163, 133, 131),…
Inferrator
  • 519
  • 1
  • 5
  • 13
0
votes
2 answers

Arrange and size multiple plots in Lattice R

I want to plot three plots vary close together, so they appear as one field. My data are arrays with different dimensions. Here is some example code to display my problem: library(lattice) theme.novpadding = list(layout.heights = list(top.padding =…
TWiSt_kid
  • 97
  • 3
  • 9
0
votes
1 answer

How do I create a histogram in R with logarithmic x and y axes?

So I have a vector of integers, quotes, which I wish to see whether it observes a power law distribution by plotting the frequency of data points and making both the x and y axes logarithmic. However, I am not quite sure how to accomplish this in R.…
wrongusername
  • 18,564
  • 40
  • 130
  • 214
0
votes
2 answers

Anova posthoc labels on bwplot from lattice in R

I would like to add significance labels following out of post-hoc analysis to box-and-whiskerplots from the function bwplot from the lattice package in R. I have read the ggplot2-based solution in Posthoc labels on anova boxplot in R however this…
FM Kerckhof
  • 1,270
  • 1
  • 14
  • 31
0
votes
1 answer

lattice grid.arrange expand graphs within grid

I´m starting with lattice. I have several plots and I want to dispose then with grid.arrange Here´s an example for two graphs graph1<-useOuterStrips(barchart(value1~Var1|Var2+Var3,data=table.df,…
Francisco
  • 381
  • 3
  • 4
  • 13
0
votes
1 answer

Header names in lattice package R

I am using R to make a plot of my data. I have two files: 1. V1 V2 12.33 124.23 13.45 196.45 12.34 124.34 12.34 124.34 2. V1 V2 2 345.56 1 0.123 2 34.34 3 234.45 I want to make separate graphs of the first column of the first file…
Lucia
  • 901
  • 1
  • 11
  • 16