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
2 answers

Arbitrary objects as argument for lattice functions

I do not understand how to handle objects, stored in a data.frame, in certain lattice plots. In the second plot I get the error msg bellow. Is it possible to get it to work?…
Klaus
  • 1,946
  • 3
  • 19
  • 34
0
votes
1 answer

lattice, merge stripes

I´m building a lattice graph with the following code table.df<-means library(lattice) library(gridExtra) graph1<-barchart(value1~Var1|Var2+Var3,data=table.df, ylab=NULL) graph2<-barchart(value2~Var1|Var2+Var3,data=table.df,…
Francisco
  • 381
  • 3
  • 4
  • 13
0
votes
1 answer

lattice, include error bars

Dear stackoverflow experts, I'm building barcharts with lattice. I have two separate table, one with means and other with standard errors. How can I include the standard errors in the bars? table.df<-means…
Francisco
  • 381
  • 3
  • 4
  • 13
0
votes
1 answer

platform-independent version of trellis.device(device="windows",...)

Is there a platform-independent way of arraying lattice plots for screen output? My approach involves using: trellis.device(device="windows") print(chart.hist, split = c(1,1,1,2), more = TRUE) print(chart.cdf, split = c(1,2,1,2)) On my mac, i need…
mac
  • 3,137
  • 1
  • 28
  • 42
0
votes
1 answer

Exporting individual pdf's for each plot created from a single file in R (using lattice)

So I have a fairly large dataset of GPS locations corresponding to different individuals at different times. It looks like a more complicated version of…
HeidelbergSlide
  • 293
  • 3
  • 13
0
votes
1 answer

Simple plotting function in R

I am having a problem with a plotting function in R. Here is what i got so far. countries <- c("CHINA ", "UNITED STATES", "UNITED KINGDOM", "GERMANY") KeyItems <- c("Pretax Income", "Total Liabilities", "Total Assets") datA <-…
MarMarko
  • 35
  • 2
  • 3
  • 9
0
votes
1 answer

How to combine two equivalence plots (lattice) in R?

I would like to add two equivalence plots together for the following lattice graphics. My usual trick for the plot() function par(mfcol=c(1,2)) does not work with these lattice-based graphs. I have looked at the related posts, although I cannot…
Borealis
  • 8,044
  • 17
  • 64
  • 112
0
votes
2 answers

how to plot a picture with boxed x-labels in lattice?

How to add tow horizontal lines in the bar chart? and how to box my x-labels like this? http://wego.genomics.org.cn/pubs/rice_indica.pdf Fig.9 In addition, how to add a y-axis in the right with custom…
Sandy
  • 99
  • 1
  • 9
0
votes
1 answer

how to use lattice to plot a bar chart without sorted x-axis?

Possible Duplicate: how to plot a bar chart with non-sorted x-axis (lattice) I want to plot a barchart. But I don't know how to plot it with unsorted x-axis in lattice. By default, the lattice will sort my x data which I am not expected. my code…
Sandy
  • 99
  • 1
  • 9
0
votes
1 answer

How to change Lattice graphics default groups colors?

When using groups, Lattice gives each group a different color. Example: df <- data.frame(x=1:56, y=rnorm(56), class=1:14) # create some data xyplot(y ~ x, groups=class, data=df, type="l", auto.key=list(space="right")) However, by default Lattice…
Mars
  • 8,689
  • 2
  • 42
  • 70
0
votes
2 answers

Shift labels left/right in lattice graphics?

In lattice graphics, I am putting x axis ticks and labels on each plot box using scales=list(alternating=3). Is there a parameter that will shift labels left/right (or up/down, for that matter)? For example, my x axis labels are time step numbers.…
Mars
  • 8,689
  • 2
  • 42
  • 70
0
votes
1 answer

How to incorporate "weighted study" into plot graph

My data were collected from the literature for a meta-analysis: Study Eeff Neff Weight (%) 1 34.83181476 50.04959144 0.1 1 33.76824264 49.53210571 0.1 1 32.67390287 47.77214774 0.1 1 33.05520666 47.30254996…
hn.phuong
  • 835
  • 6
  • 15
  • 24
0
votes
1 answer

Histogram from package lattice in a jpeg

Possible Duplicate: Generate multiple graphics from within an R function I'm trying to store all the plot from all the variables in my data with histogram from the package lattice. When I run directly, it works but if I use a function don't…
0
votes
0 answers

R lattice package, margin for auto.key border

The border around the lengend( auto.key) is too tight on the bottom. How do I increase it? library(lattice) arr<- array(replicate(10, rnorm(10)), dim =c(10,10,10) ) dotplot(arr, type = "b", horizontal = F, col = techColor , main =list( "…
0
votes
2 answers

r graphics -Creating bars for non-0 values in lattice plots

I have the dataframe df <- data.frame( site=rep(c("s1","s2","s3"),3), grp=c("a","a","a","b","b","b","c","c","c"), total=c(0,1,2,0,4,6,8,0,2) ) df site grp total 1 s1 a 0 2 s2 a 1 3 s3 a 2 4 s1 b 0 5 …
Elizabeth
  • 6,391
  • 17
  • 62
  • 90