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
1 answer

How to specify the order of plots in a group of lattice xyplots?

My code produces 9 lovely scatter plots. However, they come out in an odd order (seemingly right to left, starting at the bottom of the list of columns to plot). Is there a way to specify the order they should be plotted in? My code follows. Z <-…
gisol
  • 754
  • 3
  • 8
  • 20
0
votes
1 answer

xyplot() in R, spaghetti plot, how to make a tick at a certain point for each individual

Good day, I am using xyplot() to create a spaghetti plot... for each subject_identifier it plots the score of Y over time. xyplot(Y~time,groups=subject_identifier,data=c,type=c('l')) An event happens for each subject_identifier at some specified…
Zacarias
  • 25
  • 3
0
votes
1 answer

How to set the color of outlier in R - lattice - bwplot

for instance when i got this: https://i.stack.imgur.com/cWTIm.jpg It seems that I've to set the color for every outlier separately... Here is my (fractional) guess at code: ...,par.settings = list(...,box.rectangle = list(col= c("red","blue")),...)…
Druss2k
  • 275
  • 2
  • 5
  • 15
0
votes
1 answer

adding labels on bottom of barchart

I'm quite new to lattice so for me its a trial and error run here. It seems to customize lattice graphics cannot be done with the typical r-understanding. I would like to add something like count(percentage) beneath each bar which is supposed to…
Druss2k
  • 275
  • 2
  • 5
  • 15
0
votes
2 answers

R: color certain cells in Matrix

I am wondering whether I can color only certain cells in an R matrix using the image command. Currently, I am doing this: library(Matrix) args <- commandArgs(trailingOnly=TRUE) csv_name <- args[1] pdf_name <- args[2] pdf(pdf_name) data <-…
Sven Hager
  • 3,144
  • 4
  • 24
  • 32
0
votes
2 answers

R lattice set default arguments

I want to specify some options in a levelplot() of the R package lattice. I set the argument scales and this works fine: scales = list(x = list(at = c(0:8*16 +.5), cex = 0), y = list(at = c(0:8*16+.5), …
Nairolf
  • 2,418
  • 20
  • 34
-1
votes
2 answers

Plot relation between y and multiple x?

I can use the following to plot the pairwise scatter plots. pairs(mtcars) How to just plot the plots of one response variable wrt to the other explanatory variables?
user1424739
  • 11,937
  • 17
  • 63
  • 152
-1
votes
1 answer

ModelSim Fatal error in process RAM_i1/RAM_0_0_0/P107 Lattice MACHXO3L_MISC.vhd

I am facing a fatal error when trying to simulate in ModelSim a design that instantiates a RAM IP for the target device MACHXO3L from Lattice Semiconductor. I have compiled their libraries to use in ModelSim, but the simulations always stop due to…
-1
votes
1 answer

Problem with permute and lattice while installing vegan package

I'm trying to do my homework, but got somehow stuck. Please help! I've already installed "permute" and "lattice" ... but it still doesn't work. What can I do?
-1
votes
2 answers

add diagonal reference line to ecdfplot

I have the following call to ecdfplot in the latticeExtra package: ecdfplot(~ saved_multtest + saved_unadjusted + saved_bonferroni + saved_hochberg + saved_independent, data=saved, auto.key=list(corner=c(0.8,0.2)), main="Null case",…
Neal Oden
  • 57
  • 4
-1
votes
1 answer

Carrying out a PBIB.test

I have data set from a incomplete lattice design study that I have imported into R from excel and would like to conduct a PBIB.test. However, after running the function as shown below, the output shows object Area not found, even after repeated…
-1
votes
1 answer

How to do a point plot in R with three groups of data?

I'm trying to plot this data frame in a point-plot, and I want to divide the data in three different groups according to the size with three different colours: Size pH 0,001 4,308 0,001 4,269 0,001 4,273 0,5 4,436 0,5 4,406 1,5 …
Davide
  • 1
-1
votes
1 answer

How to reorder this R lattice barchart manually?

Code where I am explicitly ordering by factor(...) into levels but its effect is not observed in Rplots.pdf # data # http://stackoverflow.com/a/40694900/54964 summary(datm) datm$male.Nij <- factor(datm$male.Nij, c("Sinus", "Arr/AHB", "Digoxin…
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
-1
votes
1 answer

Error using cloud function in R

I am trying to make a 3d scatterplot using the cloud function (lattice package), however I am getting an error I am unable to debug. In essence what I am trying to accomplish is see if there is any correlation among gas consumption (UK) versus…
user3689341
  • 143
  • 2
  • 11
-1
votes
3 answers

Creating a scatterplot with one x and multiple y values

I have data of the form: [x] [y1] [y2] 1 0.9 1 2 2.0 2 3 3.1 3 Where (x,y1) are actual values and y2 is a prediction for y1 based on a linear model estimated on another set of data. (x, y1, y2) are in a dataframe DT. How can I make…
A. Elizabeth
  • 21
  • 1
  • 1
  • 2