similar to: xyplot() question

Displaying 20 results from an estimated 3000 matches similar to: "xyplot() question"

2005 Sep 17
4
xyplot and abline
Dear All, I wonderif there is a simple way to draw a regression line in the xyplot: more specifically, let: age <- c(20:30, 31:40 ) age.cut <- cut(age, breaks = 2 ) y<- rnorm(20) x <- rnorm(20,4,1) xyplot(y ~ x| age.cut, xlab="x", ylab="y") How to draw (in the plot given by xyplot) the two regression lines (y ~ x) corresponding to the two category
2005 Aug 15
3
How to repeat code snippet for several variables in a data frame?
Dear all, I have a data frame containing the results of an experiment. Like this: a<-seq(1,4,by=1) b<-seq(1,2,by=1) test<-expand.grid(b,a,a) colnames(test)<-c("replicates","bins", "groups") test$abc <- rnorm(32) test$def <- rnorm(32) test$ghi <- rnorm(32) test The following code snippet aggregates the data for one variable and then draws a
2007 Sep 10
1
lattice panel.lmline problem
I am wanting to generate panels showing scatterplots with the linear fitted line for two groups within each panel superimposed. I have two conditioning factors, "variable" and "Group" and I want separate panels for each level of "variable" with different symbols and "lmline"s for each level of "Group". However all observations for a group are
2009 Jun 19
1
Adding site id to xyplot
Dear R Lists, Can anyone help me add site IDs (site: 1~50) directly to my xyplot. I have 50 sites and collected observations from the sites at 13 different time points. I want to look at the change of my observations in each site. I was able to make a graph using xyplot, however, I can't find how to add site IDs within the graph not adding them in the legend. Overall, I would like to be able
2005 Apr 22
1
Help needed with lattice graph!
Dear R users, If I manage to sort out this graph, it is certainly a candidate for the new R graph gallery (http://addictedtor.free.fr/graphiques/displayGallery.php)! I created the following lattice graph: library(lattice) tmp <- expand.grid(geology = c("Sand","Clay","Silt","Rock"), species =
2011 Sep 09
1
Adding groups to regression line panel function in Lattice
I wish to display a single-panel Lattice figure with grouped data and fitted regression lines. I don't seem to be able to get the individual regression lines to display, e.g.; d <- data.frame(q = rep(1:6, each=10), cc = rep(seq(10,100, 10),6)) # create data frame with group identifier 'q', independent variable cc d$ba = d$q*0.1*d$cc + 5*rnorm(nrow(d))
2003 Apr 29
1
plot with nlme
Using R v. 1.7.0 on Windows 2000 I would like to plot the fitted values of a model as a function of a continuous covariate, augmented with data (e.g., augPred) grouping by combinations of fixed effects. I have not been able to use augPred effectively, and am wondering if it does not handle unbalanced data (3 out of 192 missing). I include below the model and an xyplot that almost does the
2003 May 13
1
several regression lines in panel of xyplot (trellis graphics)
Dear r-help, I need to draw xyplot() graphs with several regression lines: one line for the whole range of x (the variable on the horizontal axis) and two additional lines for subranges of x. Is it possible to make first regression line (panel.lmline(x,y,...);) to be drawn on the whole graph and regression lines of the subsets to be drawn only over their subsets? I have defined
2007 Jun 12
1
2 Trellis graphics question
1) I have a data that includes some "bad" data. I want to make a trellis plot where each panel contains a) A scatter plot of the "good" data b) A scatter plot of the "bad" data in a different color c) A best fit line of all the data, and d) A best fit line of the "good" data. I tried using xyplot and setting the "group" argument, but I'm
2011 Jul 28
2
not working yet: Re: lattice overlay
Hi Dieter and R community: I tried both of these three versions with ylim as suggested, none work: I am getting only single (pch = 16) not overlayed (pch =3) everytime. *vs 1* require(lattice) xyplot(Sepal.Length ~ Sepal.Width | Species , data= iris, panel= function(x, y, subscripts) { panel.xyplot(x, y, pch=16, col = "green4", ylim = c(0, 10)) panel.lmline(x, y, lty=4, col =
2015 Jun 21
2
Trying to re-install ZFS drivers
What should have been a routine upgrade to ZFS 0.6.4.1-1.el6.x86_64 somehow failed, and now I've lost access to a 2T raidz2 array. I've tried removing all zfs and related packages (spl*), then starting fresh. For reasons that have have nothing to do with this problem (I don't think), I'm still booted to kernel 2.6.32-431.29.2.el6.x86_64, and there are no other kernels installed.
2004 Feb 19
1
piece wise application of functions
Dear all, After struggling for some time with *apply() and eva() without success, I decided to ask for help. I have 3 lists labeled with, each contains 3 different interpolation functions with identical names: > names(missgp0) [1] "spl.1mb" "spl.2mb" "spl.5mb" > > names(missgp1) [1] "spl.1mb" "spl.2mb" "spl.5mb" > >
2004 May 29
3
panel function in a conditioned lattice graphic
I'm trying to use plotting character to encode the variable "block" from my dataset in a conditioned lattice graphic (R 1.9.0 on Mac OS 10.3.3). The data I'm using is the dataframe "dryoutcover" which is here (4k): http://anthony.darrouzet-nardi.net/downloads/dryoutcover.Rdata The code that generates my graphic almost correctly is as follows: xyplot(coversage ~
2007 Aug 30
1
Barplot2 using for loop, how to adjust margins?
Hi R-users, I inted to make multiple plots using for loop. The question is how can I adjust the left hand side margin of the plot according to the names.arg argument in barplot2. In every plot I have different annotations in the y axis and they vary in length. Now when I have fixed margins opar <- par(mar=c(3,15,0,2)... I get the same margins in all of the plots. That leaves lots of white
2004 May 17
0
adding a line to a single panel of a lattice plot
I'm struggling to find a way to add a line (abline, lline or lmline) to a single panel of a lattice plot. In one panel, there is an outlier and I'd like to include a second lmline fit to the data without this point. I've looked through nine pages of the archives on lattice and it wasn't obvious (to me) what additional search keyword to add to hone in on this, although I would
2009 Jan 23
1
lattice: reverse order of panel.lmline, panel.smooth
Hi, is it possible to reverse the order in which panel.lmline() or panel.smooth() operation in xyplot() ? This type of situation might occur when plotting some variable with depth, but the relation we want to describe is variable ~ depth, and not depth ~ variable, as the plotting formula would suggest. # an example: d <- 1:100 v <- d * rnorm(100) xyplot(d ~ v, ylim=c(100,0),
2009 Sep 28
1
xyplot & lmline: error message.
Hi, I am trying to produce an xyplot with a regression line. The data should be represented as log/log but when I fit the lmline I receive an error message - the plot is fine without the log transformation, but the then the plot is meaningless. I know it must be something simple, but I just can't see it. Hope someone can help... Thanks. xyplot(log(Pk)~log(k),data=rwpk,cex=1,
2002 Nov 25
2
Pspline smoothing
Dear all, I'm trying to use the Pspline add-on package to fit a quintic spline (norder =3), but I keep running into a Singularity error. > traj.spl <- smooth.Pspline(time, x, norder=3 ) Error in smooth.Pspline(time, x, norder = 3) : Singularity error in solving equations > Playing around with the other parameters produces an "unused arguments" error: > traj.spl
2009 Sep 08
1
Character manipulation using "strsplit" & vectorization
Dear R users, Suppose I have a data set with inconsistent names for a field. I desire to make these to consistent names. i.e "University of New Jersey", "New Jersey Uni", "New Jersey University" (3 different inconsistent names) to "The University of New Jersey" (consistent name) Below are arbitrary data set produced from "state.name" (built
2012 Oct 30
1
Is there an lm() equivalent of panel.lmline()?
panel.lmline returns intercept and slope of y ~ x subsetted to the combination of conditioning factors given to xyplot in lattice. for instance: xyplot(Xvalues ~ log(Qvalues)|Tfac, data = df7, panel = panel.lmline) I am looking to find the equivalent formulation for lm() proper. If I do this: lmcal <- lm(Xvalues ~ log(Qvalues):Tfac, data = df7) Only one value of the intercept is returned.