Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-15 Thread Deepayan Sarkar
On Mon, Jun 11, 2012 at 1:10 PM, maxbre mbres...@arpa.veneto.it wrote: sorry but I can't close this thread with a viable solution other than the following one (i.e. by defining an user function to add line); I understand that the problem is related to the fact that: mean(log(.)) !=

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-15 Thread maxbre
Thanks a lot, Deepayan! What a great honour hearing from you inside this thread! Now, at last, I understand where MY problem was (but please, don’t laugh – too loudly at least – and, first of all, sorry for that!) this was my “poor” wrong attempt (but I did not post this) means-mean(exp(x))

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-11 Thread maxbre
sorry but I can't close this thread with a viable solution other than the following one (i.e. by defining an user function to add line); I understand that the problem is related to the fact that: mean(log(.)) != log(mean(.)) is but for some reason I can't put all that in practice inside the

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-08 Thread maxbre
thanks david, yes, you are right PART of the confusion is because of what you mentioned (sorry for that) but going back to my own data this is JUST PART of the problem… ...see my reproducible example teq-structure(list(site = structure(c(4L, 2L, 2L, 4L, 2L, 4L, 4L, 3L, 1L, 3L, 1L, 1L, 3L, 4L,

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-08 Thread David Winsemius
On Jun 8, 2012, at 3:52 AM, maxbre wrote: thanks david, yes, you are right PART of the confusion is because of what you mentioned (sorry for that) but going back to my own data this is JUST PART of the problem… ...see my reproducible example teq-structure(list(site = structure(c(4L, 2L,

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-07 Thread maxbre
thanks ilai sorry, I mixed up a little: I was thinking to medians of each panel but instead I was trying to plot medians for each variety (what an awful chart, indeed!) thanks for your solution (medians for each panel), it works perfectly, as usual... cheers max -- View this message in

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-07 Thread maxbre
...and what if I need to plot another vertical line for showing also the means for each panel? by simply adding another call to panel.abline () seems not producing a correct result for each panel # medians and means for each panel: dotplot(variety ~ yield | site, data = barley,

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-07 Thread K. Elo
Hi! I recently posted a similar question (entitled Adding mean line to a lattice density plot). Have not got any usable solution forcing my to fall back to the use of the normal 'plot' function. The problem was the same as yours: using panel.abline simply did not work, the position of the

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-07 Thread maxbre
thanks kimmo I managed to get the desired result by first plotting the medians and then adding the means through the user defind function posted in thread you mentioned (here it is http://r.789695.n4.nabble.com/Adding-mean-line-to-a-lattice-density-plot-td4455770.html#a4456502) # start

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-07 Thread David Winsemius
On Jun 7, 2012, at 10:23 AM, maxbre wrote: thanks kimmo I managed to get the desired result by first plotting the medians and then adding the means through the user defind function posted in thread you mentioned (here it is

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-07 Thread maxbre
a new session of R with the following sessionInfo() R version 2.15.0 (2012-03-30) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=Italian_Italy.1252 LC_CTYPE=Italian_Italy.1252 [3] LC_MONETARY=Italian_Italy.1252 LC_NUMERIC=C [5] LC_TIME=Italian_Italy.1252

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-07 Thread David Winsemius
On Jun 7, 2012, at 11:34 AM, maxbre wrote: a new session of R with the following sessionInfo() Part of the confusion may be that you have reversed the colors for mean and median in two different examples. The other confusion may be that mean(log(.)) != log(mean(.)) this is the code

[R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-06 Thread maxbre
by considering this example from barley dataset #code start dotplot(variety ~ yield | site, data = barley, scales=list(x=list(log=TRUE)), layout = c(1,6), panel = function(...) { panel.dotplot(...) #median.values - tapply(x, y, median)# medians

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-06 Thread ilai
You say median for each panel but tapply gets medians for each variety (chartjunk IMHO). Regardless, *this case* has nothing to do with panel.abline. Add print(median.values) to your panel function would have hinted as to the missing piece. # medians for each panel: dotplot(variety ~ yield |