[R] lattice xyplot with cumsum() function inside

2024-09-28 Thread Naresh Gurbuxani
This code gives unexpected result. library(data.table) library(lattice) set.seed(123) mydt <- data.table(date = seq.Date(as.IDate("2024-01-01"), by = 1, length.out = 50), xgroup = "A", x = runif(50, 0, 1)) mydt <- rbindlist(list(mydt, data.table(date = mydt$date, xgroup = "B", x = runif(50, 0,

Re: [R] lattice xyplot: how to change the y-axis labels size using yscale.components.subticks on the right side and how to adapt the ticks number

2023-05-31 Thread Laurent Rhelp
I will try to explain in a bit more detail. 1. I want to have the labels on the right with a small size to be able to read them 2. I would like not to have the labels on the left 3.  I would like to be able to choose the number of principal ticks for every sensor. That is to say the value of n

Re: [R] lattice xyplot: how to change the y-axis labels size using yscale.components.subticks on the right side and how to adapt the ticks number

2023-05-30 Thread Deepayan Sarkar
Thanks for the reproducible example. Could you explain what you want in a bit more detail? Does the following do more or less what you want, except that the labels are on the left instead of right? gr <- xyplot(value ~ tindexTOP | sensor , data = df_rhelp , ylab = " "

[R] lattice xyplot: how to change the y-axis labels size using yscale.components.subticks on the right side and how to adapt the ticks number

2023-05-29 Thread Laurent Rhelp
Dear R-Help-list,    I want to display many sensors on the same page so I have to adapt the size of the y-axis labels and I woul like to adapt the number of ticks according to the sensor. I use the yscale.components argument with the function yscale.components.subticks: see the code below. I

Re: [R] lattice xyplot: trouble about the use of yscale.components to start the yscale from zero

2023-01-24 Thread Laurent Rhelp
Thank you very much for the typo !! and the example about the consequences.  I did not know about the option warnPartialMatchDollar = TRUE, I tested it with my mistake it is very effective indeed. This option should be TRUE by default. I edited my mistake but there is still the trouble, the lab

Re: [R] lattice xyplot: trouble about the use of yscale.components to start the yscale from zero

2023-01-22 Thread Deepayan Sarkar
On Sun, Jan 22, 2023 at 6:48 PM Laurent Rhelp wrote: > Dear RHelp-list, > > I want to choice my scale for every panel in a lattice graph according to > the ylim range of every panel, with 10 ticks and with a start from 0. > Also I want to plot a grid >according to the y ticks (I did that

[R] lattice xyplot: trouble about the use of yscale.components to start the yscale from zero

2023-01-22 Thread Laurent Rhelp
Dear RHelp-list,  I want to choice my scale for every panel in a lattice graph according to  the ylim range of every panel, with 10 ticks and with a start from 0. Also I want to plot a grid   according to the y ticks (I did that in the panel argument with the panel.abline function) .  So I deci

Re: [R] Lattice xyplot

2017-05-01 Thread array chip via R-help
Thanks all for the clarification! From: Jeff Newmiller To: r-help@r-project.org; Bert Gunter ; array chip Cc: "r-help@r-project.org" Sent: Monday, May 1, 2017 10:53 AM Subject: Re: [R] Lattice xyplot It is not a question of whether lattice "understands&quo

Re: [R] Lattice xyplot

2017-05-01 Thread peter dalgaard
> On 1 May 2017, at 17:59 , Bert Gunter wrote: > > (Too trivial for the list) ...so you decided to include us only once? >;-) -pd > > I debated saying something similar but decided not to, as polygons can > be drawn e.g. via panel.polygon. > > Cheers, > Bert > > > > > On Mon, May 1, 201

Re: [R] Lattice xyplot

2017-05-01 Thread Bert Gunter
(Too trivial for the list) I debated saying something similar but decided not to, as polygons can be drawn e.g. via panel.polygon. Cheers, Bert On Mon, May 1, 2017 at 8:25 AM, Jeff Newmiller wrote: > It is not a question of whether lattice "understands" the unsorted data... > imagine trying

Re: [R] Lattice xyplot

2017-05-01 Thread Jeff Newmiller
It is not a question of whether lattice "understands" the unsorted data... imagine trying to plot 4 points to form a square instead of a trend line... you would NOT want lattice to sort those points for you. That lattice leaves your data alone gives you more flexibility, even while it adds work

Re: [R] Lattice xyplot

2017-05-01 Thread Duncan Mackay
groups=id, aspect = "fill", type = c("p", "l"), xlab = "Time", ylab = "Y") Regards Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England Armidale NSW 2351 Email: home: mac...@northnet.com.au -Original M

Re: [R] Lattice xyplot

2017-05-01 Thread Bert Gunter
Yes. type = "l" connects the points in the order given in the data, so if the x's are not already ordered, the plots will be different after ordering the x's. e.g. > x <- c(3,1,2,4,6,5) > y <- 11:16 > xyplot(y~x. type = "l") As for why ... that's just the way it was designed. You can always ord

[R] Lattice xyplot

2017-05-01 Thread array chip via R-help
Dear all, I am new to lattice, so would appreciate anyone's help on the questions below. I am using xyplot to plot some trend in my dataset. Using the example dataset attached, I am trying to plot variable "y" over variable "time" for each subject "id": dat<-read.table("dat.txt",sep='\t',header=

Re: [R] Lattice xyplot(): adding a legend [RESOLVED]

2016-10-20 Thread Rich Shepard
On Thu, 20 Oct 2016, David Winsemius wrote: Why are you creating this factor? The `date` column has the desirable properties associated with the "Date" class. Axis labeling will be correct. David, et al.: Because originally I mis-understood the parameters; it's gone now. rainbyday2 <- xyp

Re: [R] Lattice xyplot(): adding a legend

2016-10-20 Thread David Winsemius
> On Oct 20, 2016, at 9:20 AM, Rich Shepard wrote: > > On Wed, 19 Oct 2016, David Winsemius wrote: > >> I am getting annoyed, exhausted, and frustrated reading code like that. >> Never, ever, ... ever, use the "$" operator in a formula. Use the 'data' >> argument and the 'formula' as they are s

Re: [R] Lattice xyplot(): adding a legend

2016-10-20 Thread Bert Gunter
1. Your par(), opar() business is junk -- lattice displays do not use or modify these. See ?trellis.par.set . 2. You do *not* need rain$ in your formula with the data=rain argument; you *do* need it in the at argument and elsewhere. The data argument only controls where the variables in the formul

Re: [R] Lattice xyplot(): adding a legend

2016-10-20 Thread Rich Shepard
On Wed, 19 Oct 2016, David Winsemius wrote: I am getting annoyed, exhausted, and frustrated reading code like that. Never, ever, ... ever, use the "$" operator in a formula. Use the 'data' argument and the 'formula' as they are supposed to be used. David, I apologize for annoying, exhaustin

Re: [R] Lattice xyplot(): adding a legend

2016-10-19 Thread David Winsemius
> On Oct 19, 2016, at 4:04 PM, Rich Shepard wrote: > > On Wed, 19 Oct 2016, Rich Shepard wrote: > >> I did read that but mis-applied what I read. Tried auto.key but that did >> not work as desired. Now I know to learn how to apply 'key'. > > Almost there after another careful reading Section

Re: [R] Lattice xyplot(): adding a legend

2016-10-19 Thread Duncan Mackay
Mackay Sent: Thursday, 20 October 2016 16:11 To: R Subject: Re: [R] Lattice xyplot(): adding a legend Hi Rich Without an example to check I think you need to fill in the arguments for par.settings eg par.settings = list(plot.symbol = list(c("black","red","dark green&quo

Re: [R] Lattice xyplot(): adding a legend

2016-10-19 Thread Duncan Mackay
rsity of New England Armidale NSW 2351 Email: home: mac...@northnet.com.au -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Rich Shepard Sent: Thursday, 20 October 2016 10:05 To: r-help@r-project.org Subject: Re: [R] Lattice xyplot(): adding a legend O

Re: [R] Lattice xyplot(): adding a legend

2016-10-19 Thread Rich Shepard
On Wed, 19 Oct 2016, Rich Shepard wrote: I did read that but mis-applied what I read. Tried auto.key but that did not work as desired. Now I know to learn how to apply 'key'. Almost there after another careful reading Section 9.2.3 ff in the book. Here's the command to produce the plot: ra

Re: [R] Lattice xyplot(): adding a legend

2016-10-19 Thread Rich Shepard
On Wed, 19 Oct 2016, David Winsemius wrote: The `legend` function is used with base graphics plotting (as is the par function). David, And that's how I used it before so it is the wrong template for this plot. Mea culpa! I think you might first read ?Lattice since it makes reference to th

Re: [R] Lattice xyplot(): adding a legend

2016-10-19 Thread David Winsemius
> On Oct 19, 2016, at 10:48 AM, Rich Shepard wrote: > > After reading ?xyplot and pages 161-162 in Deepayan's book I'm still not > getting the syntax correct to add a legend to a scatterplot. The data are > attached as filename rain.dput. > > Without the legend (and testing interactively) the

[R] Lattice xyplot(): adding a legend

2016-10-19 Thread Rich Shepard
After reading ?xyplot and pages 161-162 in Deepayan's book I'm still not getting the syntax correct to add a legend to a scatterplot. The data are attached as filename rain.dput. Without the legend (and testing interactively) the data plot but not the legend. Sourcing the script opens the dis

Re: [R] [lattice::xyplot] Using (panel:.)abline with panel.superpose?

2015-10-07 Thread Duncan Mackay
Forgot to send to list -Original Message- From: Duncan Mackay [mailto:dulca...@bigpond.com] Sent: Thursday, 8 October 2015 08:44 To: 'Szumiloski, John' Subject: RE: [R] [lattice::xyplot] Using (panel:.)abline with panel.superpose? Hi John I only got grid lines on your # c

[R] [lattice::xyplot] Using (panel:.)abline with panel.superpose?

2015-10-07 Thread Szumiloski, John
Dear useRs, I recently had a query concerning how to customize the graphics parameters in lattice::xyplot to change not only the color but also the pch symbols, lty and lwd line parameters, etc., within each grouping variable in the plot. (https://stat.ethz.ch/pipermail/r-help/2015-July/430285

[R] lattice -xyplot

2014-07-22 Thread Katharina Mersmann
Dear Community, Just a short and simple question, but the code does not come to my mind. I want to plot the Resids by quarterly Data. But there are many quarters. Just rotate them, does not make the plot clearer/ easier to read. Is there a possibility to just show every 4th value on the x-axi

Re: [R] Lattice xyplot: Fill Legend Points

2013-10-18 Thread Rich Shepard
On Fri, 18 Oct 2013, S Ellison wrote: Using trellis.par.set seems more successful than specifying par.settings in the call, however much I'd prefer to avoid relying on globals. Example: ss<-trellis.par.get("superpose.symbol") ss$pch=rep(19,7) ss$col=rainbow(7) trellis.par.set(superpose.symbol=s

Re: [R] Lattice xyplot: Fill Legend Points

2013-10-18 Thread S Ellison
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Rich Shepard > Subject: [R] Lattice xyplot: Fill Legend Points > >When I specify pch = 19 for a scatter plot the points are filled > circles. > Dea

Re: [R] Lattice xyplot: Fill Legend Points

2013-10-17 Thread Rich Shepard
On Thu, 17 Oct 2013, Richard M. Heiberger wrote: I always get lost in simpleKey. As this is my first use of it I take what's offered by those more experienced than I. The approach of directly modifying the trellis object usually works. tmp <- xyplot(pct.quant ~ sampdate, data = ffg.st, gro

Re: [R] Lattice xyplot: Fill Legend Points

2013-10-17 Thread Richard M. Heiberger
I always get lost in simpleKey. The approach of directly modifying the trellis object usually works. > tmp <- xyplot(pct.quant ~ sampdate, data = ffg.st, groups = func_feed_grp, > type = + 'p', pch = 19, key = simpleKey(text = levels(ffg.st$func_feed_grp), space = + 'right', points = T, lines =

Re: [R] Lattice xyplot: Fill Legend Points

2013-10-17 Thread Rich Shepard
On Thu, 17 Oct 2013, Richard M. Heiberger wrote: That should have worked. That's what I thought when I first tried it. I think something else is interfering. Did you redefine either T or F? Not intentionally. Please send the output from dput(head(ffg.st)) so we can experiment in your

Re: [R] Lattice xyplot: Fill Legend Points

2013-10-17 Thread Richard M. Heiberger
That should have worked. I think something else is interfering. Did you redefine either T or F? Please send the output from dput(head(ffg.st)) so we can experiment in your setting. Rich On Thu, Oct 17, 2013 at 12:12 PM, Rich Shepard wrote: > On Thu, 17 Oct 2013, Richard M. Heiberger wrote: > >

Re: [R] Lattice xyplot: Fill Legend Points

2013-10-17 Thread Rich Shepard
On Thu, 17 Oct 2013, Richard M. Heiberger wrote: par.settings = list( superpose.points = list(col = rainbow(7), pch = 19), superpose.lines = list(col = rainbow(7)) ) I had tried that, too. Legend symbols stubbornly remain unfilled. Thanks, Richard, Rich ___

Re: [R] Lattice xyplot: Fill Legend Points

2013-10-17 Thread Richard M. Heiberger
par.settings = list( superpose.points = list(col = rainbow(7), pch = 19), superpose.lines = list(col = rainbow(7)) ) On Thu, Oct 17, 2013 at 11:48 AM, Rich Shepard wrote: > On Thu, 17 Oct 2013, Richard M. Heiberger wrote: > >> put the pch into the par.settings > > > Richard, > > Tried thi

Re: [R] Lattice xyplot: Fill Legend Points

2013-10-17 Thread Rich Shepard
On Thu, 17 Oct 2013, Richard M. Heiberger wrote: put the pch into the par.settings Richard, Tried this again, but I'm not finding the proper location within par.settings. par.settings = list(superpose.points = list(col = rainbow(7)), superpose.lines = list(col = rainbow(7)), pch = 19) If

Re: [R] Lattice xyplot: Fill Legend Points

2013-10-17 Thread Richard M. Heiberger
put the pch into the par.settings On Thu, Oct 17, 2013 at 11:17 AM, Rich Shepard wrote: > When I specify pch = 19 for a scatter plot the points are filled circles. > Deapite reading ?points and trial-and-error experimentation I have not found > how to have the legend symbols (now open circles)

[R] Lattice xyplot: Fill Legend Points

2013-10-17 Thread Rich Shepard
When I specify pch = 19 for a scatter plot the points are filled circles. Deapite reading ?points and trial-and-error experimentation I have not found how to have the legend symbols (now open circles) filled. An example command is: xyplot(pct.quant ~ sampdate, data = ffg.st, groups = func_fe

Re: [R] Lattice xyplot multipanels

2013-05-22 Thread Santosh
Dear Rxperts.. Just figured how to add a text at a custom location in panel.groups.. use grid.text(x=unit(value1,"npc"),y=unit(value2,"npc"),label="label content") With this, I hope to stop flogging such a valuable black horse! :) On Wed, May 22, 2013 at 10:35 AM, Santosh wrote: > Dear Rxpe

Re: [R] Lattice xyplot multipanels

2013-05-22 Thread Santosh
Dear Rxperts, Using the above example, I have been playing around using viewport under "panel-function(...) {...}" block in conjunction with "panel.groups=function(..) {xyplot.}" code block.. I have not bee successful so far.. I was wondering if it is possible to pass user-defined functions (includ

Re: [R] Lattice xyplot multipanels

2013-05-21 Thread Santosh
Dear Rxperts, Sorry about that..forgot to update the numeric part of the multipanel group indicator... Below is the updated code... in addition to getting rid of the curly braces, is there a better way to control the position of panel.text flexibly instead of hardcoding. Thanks, santosh q <- dat

Re: [R] Lattice xyplot multipanels

2013-05-21 Thread Santosh
Dear Rxperts, Ok The "curly braces" as we talked before,... They appear if the "group" argument of "xyplot" function is entered as a numeric value; and don't when the values are letters. I just figured how to hide the strip borders...and also control the ticks in different axes... Any suggesti

Re: [R] Lattice xyplot multipanels

2013-05-21 Thread Santosh
Dear Rxperts, Using the same example above, is there a way to remove the borders of multi-panel strips and control the display of the borders of each panel.. for example, I would like to keep only side 1 & 2 of a panel... Thanks, Santosh On Wed, May 1, 2013 at 11:11 PM, Santosh wrote: > Th

Re: [R] Lattice xyplot multipanels

2013-05-01 Thread Santosh
Thanks for all tips/suggestions.. Just a few more comments.. The same code I use with a different data set in another project does not create those curly braces! Regards, Santosh On Wed, May 1, 2013 at 8:16 PM, Santosh wrote: > Sorry about the word "brackets".. Yes, I meant curly braces! I h

Re: [R] Lattice xyplot multipanels

2013-05-01 Thread Duncan Mackay
Hi Santosh Try this : q <- data.frame(G=rep(paste("G",1:3,sep=""),each=50), D=rep(paste("D",1:5,sep=""),each=30), a=rep(1:15,each=10),t=rep(seq(10),15), b=round(runif(150,10,20))) q$grp <- paste(q$D,q$a,sep=":") q$grp <- ordered(q$grp, levels=unique(q$grp)) q$dc

Re: [R] Lattice xyplot multipanels

2013-05-01 Thread David Winsemius
On May 1, 2013, at 8:16 PM, Santosh wrote: > Sorry about the word "brackets".. Yes, I meant curly braces! I have not > heard of "curley braces"! :). Curly braces surrounding the values of > "strip.levels" appear on the strip of multipanel plots. Not in my running of your code. > Thanks, >

Re: [R] Lattice xyplot multipanels

2013-05-01 Thread Santosh
Sorry about the word "brackets".. Yes, I meant curly braces! I have not heard of "curley braces"! :). Curly braces surrounding the values of "strip.levels" appear on the strip of multipanel plots. Thanks, Santosh On Wed, May 1, 2013 at 7:44 PM, David Winsemius wrote: > > On May 1, 2013, at 6:

Re: [R] Lattice xyplot multipanels

2013-05-01 Thread David Winsemius
On May 1, 2013, at 6:16 PM, Santosh wrote: > Derar Rxperts, > I have a strange situation.. I see curly brackets Wait right here. What do you mean by "brackets"? In some locales, such as mine, that might mean "[" ; in other domains... well, who knows? I don't see any "[". The Urban Legends N

[R] Lattice xyplot multipanels

2013-05-01 Thread Santosh
Derar Rxperts, I have a strange situation.. I see curly brackets around "strip.levels" in multipanel strips while using lattice::xyplot. .How do I get rid of the curly brackets? For some reason, I am not able to reproduce the problem using an example below... Any suggestions are highly welcome! Tha

Re: [R] lattice xyplot point labelling

2013-02-28 Thread maxbre
hi duncan, thanks a lot for your help! yes, your solution is working fine with a little tweaking of the vector "poscec" : but on the other hand it's just affecting the relative position of labels around respective points; to get more flexibility would be probably better to supply (even if I do

Re: [R] lattice xyplot point labelling

2013-02-27 Thread Duncan Mackay
hi the bottom panel seems ok so for the top you supply a vector of positions that are your required positions (name eg posvec) to the panel function. may need to do the same for other functions to access the correct panel there is the ifelse statement posvec = c(...) panel = function(x, y

[R] lattice xyplot point labelling

2013-02-27 Thread maxbre
This is my reproducible example tv.ms<-structure(list(inq = structure(4:17, .Label = c("D4", "D5", "D6a", "D6b", "D6c", "D7", "D8", "F4", "F5a", "F5b", "F6a", "F6b", "F6c", "F6d", "F7a", "F7b", "F8"), class = "factor"), tv.km.median.iteq = c(0.324, 0.238, 0.24000

Re: [R] lattice::xyplot & file output

2012-12-20 Thread Pascal Oettli
Hello, A reproducible example would be nice. Anyway, with "lattice::xyplot", you can store, then print the figure, in order to write it into a file: > xyObj <- xyplot(...) > postscript(...) > print(xyObj) > dev.off() Regards, Pascal Le 21/12/2012 02:29, Sam Steingold a écrit : Hi, When I w

Re: [R] lattice::xyplot & file output

2012-12-20 Thread Rolf Turner
See FAQ 7.22 and fortune("line 800"). cheers, Rolf Turner On 21/12/12 06:29, Sam Steingold wrote: Hi, When I was using the regular plot() function, I added this: --8<---cut here---start->8--- if (!is.null(file)) { do.call(tools::file_ex

[R] lattice::xyplot & file output

2012-12-20 Thread Sam Steingold
Hi, When I was using the regular plot() function, I added this: --8<---cut here---start->8--- if (!is.null(file)) { do.call(tools::file_ext(file),list(file = file)) on.exit(dev.off()) cat("writing",file,"\n") } --8<---cut here

Re: [R] lattice xyplot, get current level

2012-10-02 Thread David Winsemius
On Oct 2, 2012, at 3:59 AM, Christof Kluß wrote: > Hi > > xyplot(y ~ x | subject) plots a separate graph of y against x for each > level of subject. But I would like to have an own function for each > level. Something like > > xyplot(y ~ x | subject, > panel = function(x,y) { > pa

Re: [R] lattice xyplot, get current level

2012-10-02 Thread Bert Gunter
Christof: You are aware, I assume, that the subject level name can be incorporated into the strip label via the "strip" function argument; e.g. xyplot(..., strip = strip.custom(style = 1, strip.levels=c(TRUE,TRUE)), ...) Cheers, Bert On Tue, Oct 2, 2012 at 6:45 AM, Christof Kluß wrote: > subj

Re: [R] lattice xyplot, get current level

2012-10-02 Thread Christof Kluß
subj <- levels(subject) subj[panel.number()] seems to be a good solution is there something like panel.legend (instead of panel.text)? Am 02-10-2012 12:59, schrieb Christof Kluß: > Hi > > xyplot(y ~ x | subject) plots a separate graph of y against x for each > level of subject. But I would like

[R] lattice xyplot, get current level

2012-10-02 Thread Christof Kluß
Hi xyplot(y ~ x | subject) plots a separate graph of y against x for each level of subject. But I would like to have an own function for each level. Something like xyplot(y ~ x | subject, panel = function(x,y) { panel.xyplot(x,y) panel.curve(x,y) { # something

Re: [R] Lattice xyplot log scale labels help!

2011-11-20 Thread Deepayan Sarkar
On Fri, Sep 16, 2011 at 6:56 PM, Deepayan Sarkar wrote: > On Fri, Sep 16, 2011 at 2:17 AM, Cram Rigby wrote: >> I have a problem with lattice log scales that I could use some help with. >> >> I'm trying to print log y-axis scales without exponents in the labels. >>  A similar thread with Deepayan

Re: [R] lattice::xyplot/ggplot2: plotting weighted data frames with lmline and smooth

2011-10-21 Thread Dennis Murphy
Hi Michael: The necessary argument to geom_smooth() is weight, not weights (my fault, sorry), so try this instead: ggplot(PearsonLee, aes(x = parent, y = child)) + geom_point(size = 1.5, position = position_jitter(width = 0.2)) + geom_smooth(method = lm, aes(weight = frequency,

Re: [R] lattice::xyplot/ggplot2: plotting weighted data frames with lmline and smooth

2011-10-21 Thread Michael Friendly
Thanks very much, Dennis. See below for something I don't understand. On 10/21/2011 12:15 PM, Dennis Murphy wrote: Hi Michael: Here's one way to get it from ggplot2. To avoid possible overplotting, I jittered the points horizontally by ± 0.2. I also reduced the point size from the default 2 an

Re: [R] lattice::xyplot/ggplot2: plotting weighted data frames with lmline and smooth

2011-10-21 Thread Dennis Murphy
Hi Michael: Here's one way to get it from ggplot2. To avoid possible overplotting, I jittered the points horizontally by +/- 0.2. I also reduced the point size from the default 2 and increased the line thickness to 1.5 for both fitted curves. In ggplot2, the term faceting is synonymous with condit

[R] lattice::xyplot/ggplot2: plotting weighted data frames with lmline and smooth

2011-10-21 Thread Michael Friendly
In the HistData package, I have a data frame, PearsonLee, containing observations on heights of parent and child, in weighted form: library(HistData) > str(PearsonLee) 'data.frame': 746 obs. of 6 variables: $ child: num 59.5 59.5 59.5 60.5 60.5 61.5 61.5 61.5 61.5 61.5 ... $ parent

Re: [R] Lattice xyplot log scale labels help!

2011-09-16 Thread Deepayan Sarkar
On Fri, Sep 16, 2011 at 2:17 AM, Cram Rigby wrote: > I have a problem with lattice log scales that I could use some help with. > > I'm trying to print log y-axis scales without exponents in the labels. >  A similar thread with Deepayan' recommendation is here: > http://tolstoy.newcastle.edu.au/R/e

[R] Lattice xyplot log scale labels help!

2011-09-15 Thread Cram Rigby
I have a problem with lattice log scales that I could use some help with. I'm trying to print log y-axis scales without exponents in the labels. A similar thread with Deepayan' recommendation is here: http://tolstoy.newcastle.edu.au/R/e11/help/10/09/9865.html. For example, this code using xyplot

Re: [R] Lattice xyplot to group by two parameters

2011-06-24 Thread Deepayan Sarkar
On Thu, Jun 23, 2011 at 10:15 PM, Guy Jett wrote: > My thanks to this mailing list and its members for their great help in the > past.  I have yet another question per the following code and comments: > > # I need individual graphs grouped by "PARLABEL" AND "Event", with "PARLABEL" > #   controll

[R] Lattice xyplot to group by two parameters

2011-06-23 Thread Guy Jett
My thanks to this mailing list and its members for their great help in the past. I have yet another question per the following code and comments: # I need individual graphs grouped by "PARLABEL" AND "Event", with "PARLABEL" # controlling pct and lty, and "Event" controlling col (where Event==1

Re: [R] [lattice xyplot] Help needed in help in customizing the panel.abline() function

2010-12-10 Thread Girish A.R.
Thanks, Felix! That works. best, -Girish -- View this message in context: http://r.789695.n4.nabble.com/lattice-xyplot-Help-needed-in-help-in-customizing-the-panel-abline-function-tp3079656p3081792.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] [lattice xyplot] Help needed in help in customizing the panel.abline() function

2010-12-10 Thread Felix Andrews
Hi Girish, Try this: disc <- xyplot(cnt_gt50pct_disc ~ week_num|sku_num, data=DF,type = "h",lwd=2,panel = function(x, y, ...) { panel.abline(v = x[which.max(y)], lty = 2) panel.xyplot(x, y, ...) }) -Felix On 9 December 2010 17:35, Girish A.R. wrote: > > Hi folks, > >

Re: [R] [lattice xyplot] Help needed in help in customizing the panel.abline() function

2010-12-08 Thread Girish A.R.
Thanks for the reply, Dieter. I'm sorry I should have made it clear in my original post - the number (output of which.max()) IS dependent on the grouping.. Thanks, -Girish -- View this message in context: http://r.789695.n4.nabble.com/lattice-xyplot-Help-needed-in-help-in-customizing-the-panel

Re: [R] [lattice xyplot] Help needed in help in customizing the panel.abline() function

2010-12-08 Thread Dieter Menne
Girish A.R. wrote: > > Sorry, just realized that there was a typo in the following code of my > original post. The correct code is as shown below (corrected > 'data=swtop16' to 'data=DF'): > > sales <- xyplot(pct_inv_left ~ week_num|sku_num, data=DF,type = > "l",lwd=2,panel = function(...) { >

Re: [R] [lattice xyplot] Help needed in help in customizing the panel.abline() function

2010-12-08 Thread Dieter Menne
-- View this message in context: http://r.789695.n4.nabble.com/lattice-xyplot-Help-needed-in-help-in-customizing-the-panel-abline-function-tp3079656p3079697.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

Re: [R] [lattice xyplot] Help needed in help in customizing the panel.abline() function

2010-12-08 Thread Girish A.R.
Sorry, just realized that there was a typo in the following code of my original post. The correct code is as shown below (corrected 'data=swtop16' to 'data=DF'): sales <- xyplot(pct_inv_left ~ week_num|sku_num, data=DF,type = "l",lwd=2,panel = function(...) { panel.abline(h = 75, lty

[R] [lattice xyplot] Help needed in help in customizing the panel.abline() function

2010-12-08 Thread Girish A.R.
Hi folks, I need some help in customizing the abline() function to be used in a lattice plot. I have attached a reproducible example below. I need help in the following snippet: disc <- xyplot(cnt_gt50pct_disc ~ week_num|sku_num, data=DF,type = "h",lwd=2,panel = function(...) { panel

Re: [R] Lattice: xyplot group title format

2010-11-09 Thread Deepayan Sarkar
On Tue, Nov 9, 2010 at 2:06 AM, Marcus Drescher wrote: > Dear all, > > if I plot a lattice xyplot like: > > library(lattice); require(stats); > Depth <- equal.count(quakes$depth, number=8, overlap=.1) > > xyplot(lat ~ long | Depth, data = quakes) > > > How can I manipulate the group title format (

[R] Lattice: xyplot group title format

2010-11-09 Thread Marcus Drescher
Dear all, if I plot a lattice xyplot like: library(lattice); require(stats); Depth <- equal.count(quakes$depth, number=8, overlap=.1) xyplot(lat ~ long | Depth, data = quakes) How can I manipulate the group title format (here: Depth)? Like the font size, position, etc. Best Marcus

Re: [R] lattice xyplot - formatting of multiple Y variables when using subgroups

2010-10-17 Thread Prasenjit Kapat
On Sun, Oct 17, 2010 at 10:01 AM, Coen van Hasselt wrote: > Hi all, > > Using xyplot I want to print to Y variables (y1, y2) versus X, conditional > on the group. > How can I obtain a line (type="l") for one relationship (ie. y1 ~ x) and > points (type="p") for the other (y2 ~ x) ? > > library(lat

[R] lattice xyplot - formatting of multiple Y variables when using subgroups

2010-10-17 Thread Coen van Hasselt
Hi all, Using xyplot I want to print to Y variables (y1, y2) versus X, conditional on the group. How can I obtain a line (type="l") for one relationship (ie. y1 ~ x) and points (type="p") for the other (y2 ~ x) ? library(lattice) # create some sample data df<-data.frame(group=as.factor(c(rep("a"

Re: [R] Lattice xyplot and groups

2010-09-24 Thread Axel
> That would be the logically correct approach. Here are a couple of > ways to specify color: That's perfect! Thank you very much. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://

Re: [R] Lattice xyplot and groups

2010-09-24 Thread Deepayan Sarkar
On Wed, Sep 22, 2010 at 12:21 AM, Axel wrote: > Hi, > > I'm trying to plot many (x, y) data files using the xyplot function > from the lattice package. Each file can be classified by set name (s1, > s2,...) and data type (A, B, ...). Each data set contains a different > number of files. If the dat

Re: [R] Lattice xyplot and groups

2010-09-21 Thread Axel
> Does using > >     df = df[order(df$type,df$set,df$x),] > > before calling xyplot fix the problem? Thank you very much for your suggestion. It does make the lines open, but unfortunately it mixes different id together. With the new ordering the plot looks something like this: (x=-10, y_id1) ->

Re: [R] Lattice xyplot and groups

2010-09-21 Thread Phil Spector
Does using df = df[order(df$type,df$set,df$x),] before calling xyplot fix the problem? - Phil Spector Statistical Computing Facility Department of Statistics

[R] Lattice xyplot and groups

2010-09-21 Thread Axel
Hi, I'm trying to plot many (x, y) data files using the xyplot function from the lattice package. Each file can be classified by set name (s1, s2,...) and data type (A, B, ...). Each data set contains a different number of files. If the data is grouped by type or set and visualized as line plot wi

Re: [R] lattice::xyplot() with one factor for points and another for lines - solution

2010-08-22 Thread Dennis Murphy
Hi: Yesterday, I posted a question regarding how to handle different graphical behavior between two factors in xyplot() [package lattice]. After a public and private reply from Deepayan Sarkar, the problem has been resolved nicely, including the addition of a stacked legend for the two factors in

Re: [R] lattice::xyplot() with one factor for points and another for lines

2010-08-21 Thread Deepayan Sarkar
On Sat, Aug 21, 2010 at 5:58 AM, Dennis Murphy wrote: > Hi: > > In lattice, how does one handle separate graphical behavior for two > different factors? In the xyplot below, the objective is to use the levels > of one factor to distinguish corresponding shapes and colors, and the levels > of the o

[R] lattice::xyplot() with one factor for points and another for lines

2010-08-21 Thread Dennis Murphy
Hi: In lattice, how does one handle separate graphical behavior for two different factors? In the xyplot below, the objective is to use the levels of one factor to distinguish corresponding shapes and colors, and the levels of the other factor to perform level-wise loess smooths. # Illustrative d

Re: [R] lattice xyplot with bty="l"

2010-07-07 Thread László Sándor
Thank you, this has been really helpful, I think I have managed to produce the desired effect. However, I am having trouble with generating and passing subscripts from the main xyplot call to panel.superpose. My code resembles the examples (e.g. pp 71-73) in your 2008 book --- though I cannot refe

Re: [R] lattice xyplot with bty="l"

2010-07-07 Thread Deepayan Sarkar
2010/7/5 László Sándor : > Hi all, > > Back in 2007, Deepayan and Patrick had an exchange about how to modify > axes for lattice plots (pasted below). I need something similar, but I > also need to produce ticks on the axes. Deepayan quickly coded up > substitute gridlines because they needed to ma

Re: [R] lattice xyplot with bty="l"

2010-07-05 Thread László Sándor
Hi all, Back in 2007, Deepayan and Patrick had an exchange about how to modify axes for lattice plots (pasted below). I need something similar, but I also need to produce ticks on the axes. Deepayan quickly coded up substitute gridlines because they needed to make the default box transparent. The

Re: [R] lattice, xyplot, using "panel.segments" by just addressing one panel

2010-06-02 Thread Peter Ehlers
Doris, You might get lucky and find some kind soul who's willing to dig through your *un*reproducible code, but your chances for help would probably increase dramatically if you were to provide *reproducible* and *minimal* code to illustrate your problem. I imagine that you might benefit from rea

[R] lattice, xyplot, using "panel.segments" by just addressing one panel

2010-06-02 Thread Doris
Hi R experts, I'm using the xyplot function in lattice to draw a multipanel plot consiting of 5x6 scatterplots. Now I need to link single points in each of those scatterplots (=panel),but the points, that need linking are different for each panel. I tried to use the panel.segments function for t

Re: [R] lattice xyplot strip colors and location

2009-10-19 Thread ShankarAjay
Hi Duncan, Thanks for your response and I'm sorry for the delayed reply - think my spam filter is to blame. Your solution did work. Thanks a ton! Shankar Duncan Mackay-2 wrote: > > Hi Shankar > > On a slightly different note - below produces a strip to the left without > the stacked strip

Re: [R] Lattice xyplot: modify line width of plot lines

2009-08-24 Thread ukoenig
Now it works. Many thanks, Chuck! Quoting Chuck Cleland : On 8/24/2009 4:47 AM, ukoe...@med.uni-marburg.de wrote: # Hi all, # I want to increase the line width of the plotted lines # in a xy-lattice plot. My own attempts were all in vain. # Without the group option the line width is modified

Re: [R] Lattice xyplot: modify line width of plot lines

2009-08-24 Thread Chuck Cleland
On 8/24/2009 4:47 AM, ukoe...@med.uni-marburg.de wrote: > # Hi all, > # I want to increase the line width of the plotted lines > # in a xy-lattice plot. My own attempts were all in vain. > # Without the group option the line width is modified - > # with the option it is funnily enough not. > # Plea

[R] Lattice xyplot: modify line width of plot lines

2009-08-24 Thread ukoenig
# Hi all, # I want to increase the line width of the plotted lines # in a xy-lattice plot. My own attempts were all in vain. # Without the group option the line width is modified - # with the option it is funnily enough not. # Please have a look at my syntax. # # Many thanks in advance # Udo ###

Re: [R] lattice xyplot strip colors and location

2009-08-20 Thread Duncan Mackay
Hi Shankar On a slightly different note - below produces a strip to the left without the stacked strips require(latticeExtra) # NB install if not found useOuterStrips(strip=strip.custom(bg="skyblue"), strip.left=strip.custom(bg="yellow"), xyplot(V4~V3|frac.f*stdev.f, asp

[R] lattice xyplot strip colors and location

2009-08-19 Thread Ajay, Shankar Ajay (NIH/NHGRI) [F]
Hi all, I've been trying (unsuccessfully) to modify an xyplot I created using the lattice package. I would like to change default strip colors and locations. I started with numeric data in 4 columns, which look like this: 0.252 1 32 0.252 2 30 0.252 3

Re: [R] Lattice xyplot: same scales within one factor

2009-08-03 Thread OB
Thank you! I ended up hunting down a few previous posts you made and getting it to to work, although yes, it was not pretty. -Orion On 8/3/09 10:30 am, "Deepayan Sarkar" wrote: > On Mon, Jul 13, 2009 at 8:33 AM, OB wrote: >> I am using R 2.8.1 and lattice to produce xyplots conditioned on >> tw

  1   2   >