Re: [R] how to specify point symbols in the key on a lattice dotplot

2024-09-14 Thread Deepayan Sarkar
On Fri, 13 Sept 2024 at 23:36, Christopher W. Ryan wrote: > > For me, Bert's suggestion produces a plot with two black symbols above > the plotting region, a circle and a triangle, both filled, and no text. > > This, in which I specify several features of the symbols in the key, > > dd %>% dotplo

Re: [R] how to specify point symbols in the key on a lattice dotplot

2024-09-13 Thread Deepayan Sarkar
On Fri, 13 Sept 2024 at 12:49, Christopher W. Ryan wrote: > > I am making a dotplot with lattice, as follows: > > dd %>% dotplot( segment ~ transit_time, groups = impact, data = ., >as.table = TRUE, > pch = 16:17, > cex = 1.8, > scal

Re: [R] dotchart and dotplot(lattice) plot with two/three conditioning variables

2024-09-04 Thread Deepayan Sarkar
For lattice::dotplot(), you are close; this is more like the layout you want: dotplot(Year ~ ptile | reorder(Population, ptile, mean), testLong, groups = c("0-50", "50-90", "90-100")[time], layout = c(1, NA), par.settings = simpleTheme(pch = 16), auto.key = TRUE) dotchart(

Re: [R] lattice panel layout like cross-tabs, like a 2 x 2 table.

2024-08-30 Thread Deepayan Sarkar
You are thinking of latticeExtra::useOuterStrips. Best, -Deepayan On Sat, 31 Aug 2024 at 02:53, Christopher W. Ryan via R-help < r-help@r-project.org> wrote: > Years ago, I recall creating lattice plots with two binary factors, call > them f1 and f2, as in > > xyplot(y ~ x | f1 + f2, data = dd)

Re: [R] [External] Using the pipe, |>, syntax with "names<-"

2024-07-20 Thread Deepayan Sarkar
The main challenge in Bert's original problem is that `[` and `[<-` cannot be called in a pipeline. The obvious solution is to define named versions, e.g.: elt <- `[` `elt<-` <- `[<-` Then, > z <- data.frame(a = 1:3, b = letters[1:3]) > z |> names() |> elt(2) [1] "b" > z |> names() |> elt(2) <-

Re: [R] Output of tapply function as data frame

2024-03-27 Thread Deepayan Sarkar
For more complicated examples, the (relatively new) array2DF() function is also useful: > with(data, tapply(count, Date, mean)) |> array2DF() Var1Value 1 2024-03-23 5.416667 2 2024-03-24 5.50 3 2024-03-25 6.00 4 2024-03-26 4.476190 5 2024-03-27 6.538462 6 2024-03-28 5.20 o

Re: [R] refresh.console() function?

2024-03-13 Thread Deepayan Sarkar
Perhaps you mean https://search.r-project.org/R/refmans/utils/html/flush.console.html Best, Deepayan On Wed, 13 Mar, 2024, 8:59 pm Christofer Bogaso, < bogaso.christo...@gmail.com> wrote: > Hi, > > I run a lengthy for loop and I want to display loop status for each > step in my loop. > > I pre

Re: [R] combine barchart and xyplot in lattice

2023-11-18 Thread Deepayan Sarkar
On Sat, 18 Nov 2023 at 06:44, Naresh Gurbuxani wrote: > > In below graph, I would like to add two vertical lines using > panel.abline(). Is this possible? I assume you want the 'v' variable in panel.abline() to be interpreted in the context of your x-axis, which here represents a factor variable

Re: [R] make a lattice dotplot with symbol size proportional to a variable in the plotted dataframe

2023-11-08 Thread Deepayan Sarkar
d version of this. See http://adv-r.had.co.nz/Computing-on-the-language.html https://developer.r-project.org/nonstandard-eval.pdf Best, -Deepayan > Thanks, > Chris > > Deepayan Sarkar wrote: > > > > --Chris Ryan > > __

Re: [R] make a lattice dotplot with symbol size proportional to a variable in the plotted dataframe

2023-11-07 Thread Deepayan Sarkar
Handling NSE in these kinds of examples is a pain in lattice. I would suggest using with() and dropping the data argument for simple examples, e.g., dd |> mutate(new.proportion = las/total, new.bubble = total/100) |> with(dotplot(agency ~ new.proportion, pch = 16, cex = new.bubble)) But if yo

Re: [R] lattice densityplot with weights

2023-09-29 Thread Deepayan Sarkar
Yes, the following should (mostly) work: lattice::densityplot(~ x, mydf, groups = name, weights = wt, auto.key = list(space = "inside"), grid = TRUE) I just realised that the 'subdensity' and 'warnWbw' arguments are not passed through by densityplot(), so there is no way to get rid of the cor

Re: [R] Plotting factors in graph panel

2023-07-11 Thread Deepayan Sarkar
to scale > > down the x-axis labels, so they are readable? > > > > > > > > On Fri, 7 Jul 2023 at 12:02, PIKAL Petr wrote: > > > > Hallo Anupam > > > > I do not see much difference in ggplot or lattice, they seems to me > > provide almost ide

Re: [R] Plotting factors in graph panel

2023-07-06 Thread Deepayan Sarkar
On Thu, 6 Jul 2023 at 15:21, Anupam Tyagi wrote: > > Btw, I think "lattice" graphics will provide a better solution than > "ggplot", because it puts appropriate (space saving) markers on the axes > and does axes labels well. However, I cannot figure out how to do it in > "lattice". You will need

Re: [R] plot level, velocity, acceleration with one x axis

2023-05-31 Thread Deepayan Sarkar
I think your proposal of modifying plot.ts() to allow 'log' to be vectorized would be the most natural solution here. For what it's worth, the details of the implementation and the fact that you can supply a panel function allows an ugly hack: pfun <- function(...) { e <- parent.frame() e

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 = " "

Re: [R] on lexical scoping....

2023-04-04 Thread Deepayan Sarkar
On Tue, Apr 4, 2023 at 7:26 PM akshay kulkarni wrote: > Dear Members, > I have the following code typed at the > console prompt: > > y <- x*10 > > X has not been defined and the above code throws an object not found > error. That is, the global environment does no

Re: [R] latticeExtra: how to use doubleYScale when we want to keep the groups of every lattice graph

2023-02-13 Thread Deepayan Sarkar
On Mon, Feb 13, 2023 at 3:48 AM Laurent Rhelp wrote: > > Dear R-Help-list, > > I want to use the doubleYScale function from latticeExtra to overlap two > lattice graphs (cf. code below). The overlapping works but I lose the > groups of > every lattice, there are only two colors. Reading the docu

Re: [R] lines through points in lattice legend

2023-01-28 Thread Deepayan Sarkar
On Sat, Jan 28, 2023 at 2:49 PM Kenneth Knoblauch wrote: > > Hi, > > I'm struggling to find if there is a simple way to make the lines and points > overlap in a legend for a lattice plot using auto.key. Here is a toy example > of what doesn't work (for me) as the lines and points are adjacent r

Re: [R] Bug in R-Help Archives?

2023-01-26 Thread Deepayan Sarkar
>From looking at the headers in John Sorkin's mail, my guess is that he just replied to the other thread rather than starting a fresh email, and in his attempts to hide that, was outsmarted by Outlook. This is based on references to domains such as yahoo.com, dcn.davis.ca.us, and precheza.cz in th

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

Re: [R] lattice: how to use a log scale on the x-axis with the bwplot function

2022-12-11 Thread Deepayan Sarkar
gument in order to > apply the bwplot function only on the values of every group. xyplot() doesn't know that, but panel.bwplot() does. It chooses one of the variables as the grouping variable (depending on horizontal=TRUE|FALSE); see ?panel.bwplot. Best, -Deepayan > > > Le 11/12/20

Re: [R] lattice: how to use a log scale on the x-axis with the bwplot function

2022-12-11 Thread Deepayan Sarkar
rizontal = FALSE , box.width = .0001 ) ? And sorry for my wrong calculation of m earlier, but you can simplify your version to m <- tapply(DF$x, groups, mean) DF$m <- as.vector(m[DF$groups]) Best, -Deepayan > > > thx > > > > Le 10/12/2022 à 17:02, Deepayan S

Re: [R] lattice: how to use a log scale on the x-axis with the bwplot function

2022-12-10 Thread Deepayan Sarkar
Log-scales for the "factor" variable in bwplot() is not allowed. You could, however, use the panel function panel.bwplot() with xyplot(num ~ num). The potential problem with that is the box widths, which panel.bwplot() will not know how to compute. See if the following gives you a reasonable star

Re: [R] pairwise.var.test

2022-11-02 Thread Deepayan Sarkar
On Mon, Oct 31, 2022 at 5:30 AM Thomas Subia via R-help wrote: > > Colleagues, > > Thank you all for the timely suggestions. That is appreciated. > > What I am really looking for a way to identify difference in group level > variance by using multiple comparison intervals. Minitab displays those

Re: [R] panel.rect and log scale in lattice plot

2022-03-23 Thread Deepayan Sarkar
On Wed, Mar 23, 2022 at 4:08 PM Ivan Krylov wrote: > > On Wed, 23 Mar 2022 09:38:34 + > "Garbade, Sven via R-help" wrote: > > >cpl <- current.panel.limits() > > If you str() the return value of current.panel.limits() from the panel > function with log-scaling enabled, you can see

Re: [R] Can browseURL open a lynx browser?

2022-03-20 Thread Deepayan Sarkar
On Sun, Mar 20, 2022 at 12:39 PM Ashim Kapoor wrote: > > Dear all, > > I wish to do : > > browseURL("http://www.google.com","lynx";) > > But this is not opening the lynx browser. I am able to open lynx from > the Debian command line and lynx is on the PATH. I haven't used lynx in a while, but br

Re: [R] how to plot numeric variable against several categories with lattice bwplot?

2022-01-17 Thread Deepayan Sarkar
On Mon, Jan 17, 2022 at 7:01 PM PIKAL Petr wrote: > > Hi Luigi > > Not sure how to do it in lattice but in ggplot you could use for cycle > > for(i in 3:5) { > print(ggplot(df, aes(x=df[,i], y=y))+geom_boxplot()+ xlab(names(df)[i])) > } > > It is better to put plots to pdf file Pretty much the sa

Re: [R] A technical question on methods for "+"

2021-12-02 Thread Deepayan Sarkar
On Fri, Dec 3, 2021 at 3:14 AM Bert Gunter wrote: > > Those are both helpful comments. Would it not be useful to say > something along these lines in ?class. ? > The key point I missed is that there often(but not always) must be an > *explicit* class **attribute** for method dispatch; and class()

Re: [R] [External Email] Re: how to make the far right section of a smoother line look different from the rest of that line?

2021-11-16 Thread Deepayan Sarkar
On Wed, Nov 17, 2021 at 1:04 AM Christopher W Ryan via R-help wrote: > > Thanks Bert, that looks promising. > > panel.smoother() is from latticeExtra > > https://rdrr.io/cran/latticeExtra/man/panel.smoother.html I'm a bit unsure about your premise. If I understand correctly, the data for the last

Re: [R] Environmental oddity.

2021-11-06 Thread Deepayan Sarkar
On Sun, Nov 7, 2021 at 6:05 AM Rolf Turner wrote: > > > I have two functions which appear to differ only in their environments. > They look like: > > > d1 > > function (x, mean = 0, sd = 1, log = FALSE) > > (((x - mean)/sd)^2 - 1) * if (log) 1 else dnorm(x, mean, sd)/sd > > > > and > > > d2 > > f

Re: [R] How to rotate only one panel by 90 degrees in R plot?

2021-10-13 Thread Deepayan Sarkar
On Wed, Oct 13, 2021 at 12:13 PM Luigi Marongiu wrote: > > I have seen that the only package that easily rotate the plot is > ggplot, so I ran: > ``` > library(ggplot2) > df = data.frame(MR = c(negative_mr, uncertain_mr, positive_mr), > FCN = c(negative_fcn, uncertain_fcn, positive_fcn)) > p <- gg

Re: [R] How to add error bars to lattice xyplot

2021-10-11 Thread Deepayan Sarkar
On Mon, Oct 11, 2021 at 5:41 PM Luigi Marongiu wrote: > > Hello, > I am trying to plot data using lattice. The basic plot works: > ``` > Substance = rep(c("A", "B", "C", "D"),4) > Concentration = rep(1:4,4), > Value = c(62.8067, 116.2633, 92.2600, 9.8733, 14.8233, >

Re: [R] Missing text in lattice key legend

2021-10-11 Thread Deepayan Sarkar
On Mon, Oct 11, 2021 at 5:17 PM Luigi Marongiu wrote: > > Hello, > I am drawing some data with lattice using: > ``` > library(lattice) > COLS = c("gold", "forestgreen", "darkslategray3", "purple") > xyplot(Value ~ Concentration, >group = Substance, data = inf_avg, >pch = 16, cex =

Re: [R] How to use ifelse without invoking warnings

2021-10-08 Thread Deepayan Sarkar
On Sat, Oct 9, 2021 at 3:00 AM Ravi Varadhan via R-help wrote: > > Thank you to Bert, Sarah, and John. I did consider suppressing warnings, but > I felt that > there must be a more principled approach. While John's solution is what I > would prefer, > I cannot help but wonder why `ifelse' was n

Re: [R] Show only header of str() function

2021-09-02 Thread Deepayan Sarkar
On Thu, Sep 2, 2021 at 9:26 PM Enrico Schumann wrote: > > On Thu, 02 Sep 2021, Luigi Marongiu writes: > > > Hello, is it possible to show only the header (that is: `'data.frame': > > x obs. of y variables:` part) of the str function? > > Thank you > > Perhaps one more solution. You could limit th

Re: [R] interactively getting alist of functions for a given package?

2021-06-24 Thread Deepayan Sarkar
On Thu, Jun 24, 2021 at 2:10 PM Greg Minshall wrote: > > Duncan, > > > Bert gave you an answer that depends on ls(). Whether there's > > something like "set" that can return "asset" probably depends on > > your front end, and may be customizable using the facilities described > > in ?rcompgen. >

Re: [R] Variable labels

2021-05-14 Thread Deepayan Sarkar
On Fri, May 14, 2021 at 4:19 PM Steven Yen wrote: > > Never mind what I said about "Clickable". All I meant was I created an > item "definitions" that appears after I load the binary file, and that I > can "click" (don's ask me what I mean by "click") the item in RStudio to > read its contents --

Re: [R] Matrix::solve() with 1-d arrays -- treating "array" as "numeric"?

2021-04-18 Thread Deepayan Sarkar
On Sat, Apr 17, 2021 at 9:08 PM Martin Maechler wrote: > > >>>>> Deepayan Sarkar > >>>>> on Fri, 16 Apr 2021 11:34:20 +0530 writes: > > > I get what I initially thought was unexpected behaviour from: > > > x <- tapply(runi

[R] Matrix::solve() with 1-d arrays

2021-04-15 Thread Deepayan Sarkar
I get what I initially thought was unexpected behaviour from: x <- tapply(runif(100), sample(5, 100, TRUE), mean) solve(Diagonal(5), x) # Error: not-yet-implemented method for solve(, ). # ->> Ask the package authors to implement the missing feature. This is because x is a 1-D array, so the ope

Re: [R] add cex.axis =1.2 to qqunif.plot from lattice library

2021-03-27 Thread Deepayan Sarkar
In addition to what Rolf said, a relatively obscure but generally useful way to "globally" control fontsize is to set the underlying grid parameter (see ?grid::gpar). The easiest way to do this is through the lattice settings, e.g., lattice.options(default.theme = list(grid.pars = list(cex = 1.5))

Re: [R] unanticipated axis labels

2021-03-16 Thread Deepayan Sarkar
On Tue, Mar 16, 2021 at 11:35 PM Richard M. Heiberger wrote: > > library(lattice) > library(latticeExtra) > > barchart(matrix(c(1:6, 5:6)), main="unanticipated left axis labels", > ylab="unanticipated inside labels") + > latticeExtra::layer(panel.axis("left", half=FALSE, labels=1:8)) S

Re: [R] Very slow optim()

2021-03-13 Thread Deepayan Sarkar
On Sat, Mar 13, 2021 at 4:33 PM Spencer Graves wrote: > > Hi, Deepayan: > > > On 2021-03-13 01:27, Deepayan Sarkar wrote: > > On Sat, Mar 13, 2021 at 10:08 AM Spencer Graves > > wrote: > >> > >> TWO COMMENTS: > >> > >> > &

Re: [R] Very slow optim()

2021-03-12 Thread Deepayan Sarkar
On Sat, Mar 13, 2021 at 10:08 AM Spencer Graves wrote: > > TWO COMMENTS: > > > 1. DID YOU ASSIGN THE OUTPUT OF "optim" to an object, like "est <- > optim(...)"? If yes and if "optim" terminated normally, the 60,000+ > paramters should be there as est$par. See the documentation on "optim". > > >

Re: [R] xyplot.zoo trouble with the index when I use microseconds (type POSIXct)

2021-02-22 Thread Deepayan Sarkar
On Mon, Feb 22, 2021 at 9:56 PM Laurent Rhelp wrote: > > Dear R-Help-List, > > I have to process time series with a sampling frequency of 1 MHz. > I use the POSIXct format for the date-times with microsecond in a zoo > object and the xyplot.zoo function to do the graphs. > As I show in the bel

Re: [R] FInd packages in need of Update (like RStudio)

2020-12-23 Thread Deepayan Sarkar
On Wed, Dec 23, 2020 at 8:09 PM Dr Eberhard W Lisse wrote: > > Hi, > > does anyone know how one would look which packages require an update > (like the Tools -> Update Packages) but can do it from R (ie Rscript) or > any other way from the command line (on the MAc) ? old.packages Best, -Deepayan

Re: [R] counting duplicate items that occur in multiple groups

2020-11-18 Thread Deepayan Sarkar
On Wed, Nov 18, 2020 at 5:40 AM Bert Gunter wrote: > > z <- with(Data2, tapply(Vendor,Account, I)) > n <- vapply(z,length,1) > data.frame (Vendor = unlist(z), >Account = rep(names(z),n), >NumVen = rep(n,n) > ) > > ## which gives: > >Vendor Account NumVen > A1 V1 A1 1 > A

Re: [R] R for-loop to add layer to lattice plot

2020-10-27 Thread Deepayan Sarkar
On Tue, Oct 27, 2020 at 6:04 PM Luigi Marongiu wrote: > > Hello, > I am using e1071 to run support vector machine. I would like to plot > the data with lattice and specifically show the hyperplanes created by > the system. > I can store the hyperplane as a contour in an object, and I can plot > on

Re: [R] plot factors with dots in R

2020-08-28 Thread Deepayan Sarkar
On Thu, Aug 27, 2020 at 5:46 PM Luigi Marongiu wrote: > > Hello, > I have a dataframe as follows: > ``` > x = c("0 pmol", "10 pmol", "100 pmol", "1000 pmol") > y = c(0.9306, 1.8906, 2.2396, 2.7917) > df = data.frame(x, y) > > > str(df) > 'data.frame': 4 obs. of 2 variables: > $ x: chr "0 pmol"

Re: [R] COVID-19 datasets...

2020-05-07 Thread Deepayan Sarkar
On Thu, May 7, 2020 at 4:16 PM Thomas Petzoldt wrote: > > On 07.05.2020 at 11:19 Deepayan Sarkar wrote: > > On Thu, May 7, 2020 at 12:58 AM Thomas Petzoldt wrote: > >> > >> Sorry if I'm joining a little bit late. > >> > >> I've put some

Re: [R] COVID-19 datasets...

2020-05-07 Thread Deepayan Sarkar
On Thu, May 7, 2020 at 12:58 AM Thomas Petzoldt wrote: > > Sorry if I'm joining a little bit late. > > I've put some related links and scripts together a few weeks ago. Then I > stopped with this, because there is so much. > > The data format employed by John Hopkins CSSE was sort of a big surpris

Re: [R] [EXTERNAL] Re: overlaying graphs in xYplot (Hmisc)

2020-04-25 Thread Deepayan Sarkar
On Wed, Apr 22, 2020 at 11:44 PM Cade, Brian S via R-help wrote: > > All the xYplot() functions using Cbind() or cbind() does just exactly what I > want (Cbind > provides aplot of 3 summary statistics and cbind provides the raw values). I > just cannot > find anyway to overlay them. You are no

Re: [R] Options for zooming plots other than zm()

2020-04-25 Thread Deepayan Sarkar
On Sat 25 Apr, 2020, 12:10 PM Robert Dodier, wrote: > Hi, > > I am making some plots with plot() which have a fair number of points > (thousands) and I would like to be able to interactively select a > region of the plot and zoom in on it. I tried the zoom package which > has the function zm() bu

Re: [R] ggplot stat smooth and poly

2020-04-05 Thread Deepayan Sarkar
On Thu, Apr 2, 2020 at 6:10 PM PIKAL Petr wrote: > Dear all > > I am not sure, but I believe that in past it was possible to add smoothing > lines in ggplot even if some group did not have enough points to perform > calculation (although I did not find any version which could deliver it). > > Her

Re: [R] a simple reshape

2020-04-04 Thread Deepayan Sarkar
Hi, [For a non-tidyverse solution:] Your problem is ambiguous without a 'time' variable; e.g., why should the answer not be test2 <- data.frame(vntr1=c("v1","v2"), a1 =c(NA, 0.5693), a2 = c(0.02, 0.12), a3 =c(NA, 0.11),

Re: [R] [FORGED] Grouping Question

2020-03-22 Thread Deepayan Sarkar
Another possible approach is to use split -> lapply -> rbind, which I often find to be conceptually simpler: d <- data.frame(Serial = c(1, 1, 2, 2, 2, 3, 3), Measurement = c(17, 16, 12, 8, 10, 19, 13)) dlist <- split(d, d$Serial) dlist <- lapply(dlist, within, { Serial_test <-

Re: [R] Unintended behaviour (possibly bugs)

2020-02-17 Thread Deepayan Sarkar
On Mon, Feb 17, 2020 at 10:24 AM Rui Barradas wrote: > > Hello, > > Yes, this is definitely a bug. I would argue that the only bug here is that the documentation doesn't say that 'ylab' may not behave as expected. dotchart() is mainly designed for 2-way tables (see the VADeaths example), but it'

Re: [R] Increasing space for main title in a lattice (xyplot()) graphics.

2020-02-12 Thread Deepayan Sarkar
ou care to try. > > Bert > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Wed, Feb 12, 2020 at 9:1

Re: [R] Increasing space for main title in a lattice (xyplot()) graphics.

2020-02-12 Thread Deepayan Sarkar
On Thu, Feb 13, 2020 at 10:39 AM Richard M. Heiberger wrote: > > It works as anticipated for me > > > xyplot(1 ~ 1, > + main="The quick brown fox jumped\n over the lazy dog.") > > xyplot(1 ~ 1, > + main="The quick brown fox jumped over the lazy dog.") > > Something else you

Re: [R] Alignment of the title in a key for xyplot in lattice.

2019-12-24 Thread Deepayan Sarkar
On Tue, Dec 24, 2019 at 6:59 AM Jim Lemon wrote: > > Hi Rolf, > Following the docs back to draw.key, It looks like the ellipsis > argument is ignored. I was hoping for a brilliant solution along the > lines of: > > adj=0 > > that could be passed down the functions like a hot potato, but was > dis

Re: [R] ggpubr: order of non-numeric x-axis items

2019-10-26 Thread Deepayan Sarkar
On Sat, Oct 26, 2019 at 8:22 PM Bert Gunter wrote: > > No. relevel() only changes the order in one specific way. Use `levels<-`() > to reorder in a general way: > > > z <- factor(rep(letters[3:1],2)) > > z > [1] c b a c b a > Levels: a b c > > z <-relevel(z, ref = "c") > > z > [1] c b a c b a > Le

Re: [R] Stratifying data with xyplot

2019-03-15 Thread Deepayan Sarkar
On Tue, Mar 12, 2019 at 2:28 AM Kevin Wright wrote: > > See the examples here: > https://www.stat.ubc.ca/~jenny/STAT545A/block10_latticeNittyGritty.html Excellent reference. The only improvement I could think of is to abuse the non-standard evaluation of 'groups' to avoid repeating the name of th

Re: [R] Bug : Autocorrelation in sample drawn from stats::rnorm (hmh)

2018-10-05 Thread Deepayan Sarkar
On Fri, Oct 5, 2018 at 2:07 PM hmh wrote: > > On 05/10/2018 10:28, Annaert Jan wrote: > > you discard any time series structure; > But that is PRECISELY what a call a bug: > There should not be any "time series structure" in the output or rnorm, > runif and so on but there is one. > > rnorm(N,0,1)

Re: [R] Access function as text from package by name

2018-09-28 Thread Deepayan Sarkar
On Fri, Sep 28, 2018 at 2:16 PM Bert Gunter wrote: > > Do you mean: > ?get Doesn't work with :: etc: > get("graphics::box") Error in get("graphics::box") : object 'graphics::box' not found I think parse()+eval() is pretty much unavoidable. After that, it's a choice between deparse() and print()

[R] The R Journal, Volume 6, Issue 2

2015-01-31 Thread Deepayan Sarkar
Dear All, The latest issue of The R Journal is now available at http://journal.r-project.org/archive/2014-2/ Many thanks to all contributors. Regards, -Deepayan ___ r-annou...@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-announce

[R] The R Journal, Volume 6, Issue 1

2014-08-05 Thread Deepayan Sarkar
Dear All, The latest issue of The R Journal is now available at http://journal.r-project.org/archive/2014-1/ Many thanks to all contributors, and apologies for the delay. Regards, -Deepayan ___ r-annou...@r-project.org mailing list https://stat.ethz.c

Re: [R] Trellis devices and pointize

2014-06-21 Thread Deepayan Sarkar
On Thu, Jun 12, 2014 at 2:31 PM, Patrick Connolly wrote: > On Mon, 09-Jun-2014 at 08:33AM +0100, Prof Brian Ripley wrote: > > |> The issue here is not trellis.device. > |> > |> You are using lattice plots (without mentioning lattice), which are > |> based on package 'grid' and so using the grid su

Re: [R] Lattice, ggplot, and pointsize

2013-06-05 Thread Deepayan Sarkar
On Sun, May 26, 2013 at 12:47 AM, Milan Bouchet-Valat wrote: > Le mardi 21 mai 2013 à 21:39 +0100, Prof Brian Ripley a écrit : >> On 21/05/2013 21:24, Bert Gunter wrote: >> > At the risk of misunderstanding... (inline) >> > >> > On Tue, May 21, 2013 at 12:17 PM, Milan Bouchet-Valat >> > wrote: >

Re: [R] lattice dotplot reorder contiguous levels

2012-09-26 Thread Deepayan Sarkar
On Wed, Sep 26, 2012 at 3:36 PM, maxbre wrote: > sorry for my slow reply, this is what I worked out so far… > > my reproducible example and the code > > test<-structure(list(site = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, > 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, > 3L, 3L, 3

Re: [R] lattice dotplot reorder contiguous levels

2012-09-20 Thread Deepayan Sarkar
On Thu, Sep 20, 2012 at 7:48 PM, maxbre wrote: > my reproducible example > > test<-structure(list(site = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, > 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, > 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, > 4L, 4L, 4L, 4L, 4L,

Re: [R] Adding legends on plots using Lattice package

2012-09-20 Thread Deepayan Sarkar
On Mon, Sep 17, 2012 at 2:34 PM, jpm miao wrote: > To dear Dr Sarkar and anyone that knows about Lattice package, > >I make 4 graphs by Lattice package. Each of the graphs has two time > series. All the series are plotted in plain lines by default, and I would > like one series to be in plain

Re: [R] Thinning Lattice Plot

2012-07-31 Thread Deepayan Sarkar
On Tue, Jul 31, 2012 at 6:43 PM, Elliot Joel Bernstein wrote: > Thanks everyone for your replies. I didn't know about the ecdfplot function, > so I'll start using that instead of Ecdf. Why is Ecdf not a lattice plot? > The result certainly looks like other lattice plots, the arguments are > simil

Re: [R] lattice legen and auto.key conflict

2012-07-30 Thread Deepayan Sarkar
On Mon, Jul 30, 2012 at 10:16 PM, Bert Gunter wrote: > David: > > I think one needs to carefully parse the xyplot help, where it says: > > "To use more than one legend, or to have arbitrary legends not > constrained by the structure imposed by key, use the legend argument. > " > > So I presume tha

Re: [R] Thinning Lattice Plot

2012-07-30 Thread Deepayan Sarkar
On Tue, Jul 31, 2012 at 2:43 AM, Elliot Joel Bernstein wrote: > Is there an easy way to "thin" a lattice plot? I often create plots from > large data sets, and use the "pdf" command to save them to a file, but the > resulting files can be huge, because every point in the underlying dataset > is re

Re: [R] tck = 0 for the colorkey?

2012-07-13 Thread Deepayan Sarkar
On Fri, Jul 13, 2012 at 12:21 PM, Martin Ivanov wrote: > Dear R users, > > I am struggling with the colorkey on a levelplot lattice graphic. > I want that no ticks are printed on the colorkey. That is, I want their size > tck=0. > Merely setting tck=0 t in the colorkey parameter does not work. S

Re: [R] trellis margin sizes in absolute units

2012-07-12 Thread Deepayan Sarkar
On Thu, Jul 12, 2012 at 9:39 PM, Martin Ivanov wrote: > Dear R users, > > I have a lot of experience with traditional R graphics, but I decided to turn > to trellis as > it was recommended for spatial graphs by the sp package. In traditional R > graphics > I always first set the size of the dev

Re: [R] the meaning of subscripts

2012-06-30 Thread Deepayan Sarkar
On Thu, Jun 28, 2012 at 9:27 PM, startend wrote: > Hi, > > Now i am dealing with longitudinal data set and I want to see the rough > marginal plot for 2 variables separately. > I found the code from one example here, > > reading <- > read.table("http://www.ats.ucla.edu/stat/R/examples/alda/data/re

Re: [R] lattice histogram log and non log values

2012-06-30 Thread Deepayan Sarkar
On Thu, Jun 28, 2012 at 2:41 AM, LCOG1 wrote: > Hello all, >  Please consider the following > > library(lattice) > Colors. <-rep(brewer.pal(7, "Dark2"),2) > color <- 1 > > Data.X.. <- data.frame(UnitArea = c(rnorm(1000), rnorm(1000)), Type = > c(rep("Base",1000),rep("Log",1000))) > >              

Re: [R] Reordering levels of a factor within a lattice dotplot

2012-06-22 Thread Deepayan Sarkar
On Fri, Jun 22, 2012 at 5:50 PM, maxbre wrote: > Given my reproducible example > > myexample<-structure(list(site = structure(c(4L, 2L, 2L, 4L, 2L, 4L, 4L, > 3L, 1L, 3L, 1L, 1L, 3L, 4L, 5L, 2L), .Label = c("A", "B", "C", > "D", "E"), class = "factor"), obs = c(0.302, 0.956, 0.72, 1.21, > 0.887, 0.

Re: [R] aligning axis labels in a colorkey from levelplot

2012-06-22 Thread Deepayan Sarkar
On Tue, Jun 19, 2012 at 10:55 PM, Stephen Eglen wrote: >> >> Justification is hard-coded, and that's not easy to change. This is >> not only for the colorkey; e.g., >> >>   xyplot(y~1, scales = list(alternating = 3)) >> >> will also give you left-aligned axes on the right. >> >> My only suggestion

Re: [R] exact relative positioning of lattice plots

2012-06-22 Thread Deepayan Sarkar
On Wed, Jun 20, 2012 at 7:18 PM, John G. Bullock wrote: > >> In your actual use case, are there any annotations outside the panel >> (tick marks, labels, etc.)? Things would be much simpler if not (as in >> your example). In that case, just call the suitable panel function >> after setting up the

Re: [R] how to make a histogram with percentage on top of each bar?

2012-06-22 Thread Deepayan Sarkar
On Thu, Jun 21, 2012 at 10:56 PM, york8866 wrote: > I have a dataset like the following: > ID      DV > 1       0.868576818 > 2       0.337120116 > 3       0.029233775 > 4       0.719783525 > 5       0.976631182 > 6       0.672941605 > 7       0.13239462 > 8       0.99936475 > 9       0.91540604 >

Re: [R] exact relative positioning of lattice plots

2012-06-20 Thread Deepayan Sarkar
On Wed, Jun 20, 2012 at 9:26 AM, John G. Bullock wrote: > > Hello, > > I have two lattice plots for which panel.height is fixed.  I am trying to > position them > in a column so that there is exactly half an inch of vertical space between > them. > This would be a simple task if I were not fixin

Re: [R] aligning axis labels in a colorkey from levelplot

2012-06-18 Thread Deepayan Sarkar
On Sat, Jun 16, 2012 at 1:41 PM, Stephen Eglen wrote: > R does a great job with the fine details regarding plots.  e.g in the > following: > > library(lattice) > y <- -4:4/10 > xyplot(y~1, las=1) > > the y axis is labelled with numbers -0.4, -0.2, 0.0, 0.2, 0.4 with the > numbers aligned on the de

Re: [R] some help to improve "hist to plot relative frequencies"

2012-06-18 Thread Deepayan Sarkar
On Fri, Jun 15, 2012 at 9:22 PM, gianni lavaredo wrote: > Dear Researches, > > sorry for disturb. I wish to improve my figure in R plotting the relative > frequencies of my data set. > > library(lattice) > a <- c(0,0,0,1,1,2,4,5,6,7,7,7,7,7,8,8,8,8,9,9,9,9,10,10,11) > histogram(a, xlab="myData") >

Re: [R] Adding title to colorkey

2012-06-18 Thread Deepayan Sarkar
On Sat, Jun 16, 2012 at 2:10 PM, Stephen Eglen wrote: > > A recent paper on visualisation (in Neuron, a leading neuroscience > journal) surveyed how well previous articles in this journal labelled their > graphs (e.g. axis labelling and describing their error bars).  Of > particular interest is th

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 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(.)) != log(mean(.)) is > but for s

Re: [R] histogram fill lattice

2012-06-15 Thread Deepayan Sarkar
On Wed, Jun 13, 2012 at 8:10 PM, David Winsemius wrote: > > On Jun 13, 2012, at 9:55 AM, Powell, Jeff wrote: > >> >> Dear all, >> >> I would like to change the "fill" pattern of a histogram using histogram() >> in the lattice package.  I know how to do so using hist(), but would prefer >> to stay

Re: [R] Lattice 3d coordinate transformation

2012-02-11 Thread Deepayan Sarkar
On Fri, Feb 10, 2012 at 12:43 AM, ilai wrote: > Hello List! > I asked this before (with no solution), but maybe this time... I'm > trying to project a surface to the XY under a 3d cloud using lattice. > I can project contour lines following the code for fig 13.7 in > Deepayan Sarkar's "Lattice, Mu

Re: [R] how to combine grouped data and ungrouped data in a trellis xyplot

2012-01-09 Thread Deepayan Sarkar
On Sun, Jan 8, 2012 at 9:45 AM, Mike Dahman wrote: > I'm hoping the community knowledge can help me out here. I have found great > value in R, especially using it to generate charts, but I am still scaling > the learning curve in a number of ways. > > I am looking plot one grouped line and one ung

Re: [R] lattice key in blank panel

2011-12-15 Thread Deepayan Sarkar
On Fri, Dec 16, 2011 at 1:22 AM, Max Kuhn wrote: > Somewhere I've seen an example of an xyplot() where the key was placed > in a location of a missing panel. For example, if there were 3 > conditioning levels, the panel grid would look like: > > 34 > 12 > > In this (possibly imaginary) example, th

Re: [R] lines and points in xyplot()

2011-11-23 Thread Deepayan Sarkar
On Wed, Nov 23, 2011 at 10:48 PM, Doran, Harold wrote: > Given the following data, I want a scatterplot with the data points and the > predictions from the regression. > > Sigma <- matrix(c(1,.6,1,.6), 2) > mu <- c(0,0) > dat <- mvrnorm(5000, mu, Sigma) > > x <- dat[,1] * 50 + 200 > y <- dat[,2]

Re: [R] Adding units to levelplot's colorkey

2011-11-22 Thread Deepayan Sarkar
On Tue, Nov 15, 2011 at 6:53 PM, Carlisle Thacker wrote: > Sorry that I was not clear.  I was asking how to add annotation to > levelplot's colorkey, not the levelplot itself.  The only entry I can > find from the help pages is via its labels. > > Googling did yield this:  " draw.colorkey() doesn'

Re: [R] Drawing ticks in the 3rd and 4th row of a lattice

2011-11-22 Thread Deepayan Sarkar
On Fri, Nov 18, 2011 at 11:22 AM, Ashim Kapoor wrote: > Dear all, > > I want to draw ticks on the 3rd and 4th row of a lattice. How do I do this > ? In my search of the help, I discovered a parameter alternating,which kind > of says where the ticks will be but does not suffice for me. You need to

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.

Re: [R] right justify right-axis tick values in lattice

2011-10-17 Thread Deepayan Sarkar
On Sun, Oct 16, 2011 at 7:20 PM, David Winsemius wrote: > > On Oct 16, 2011, at 1:17 AM, Richard M. Heiberger wrote: > >> How can I right justify the right-axis tick values?  They appear in the >> example below as left-justified. >> >> I have tried several different ways and all fail in different

Re: [R] how to plot two surfaces with lattice::wireframe

2011-10-15 Thread Deepayan Sarkar
On Fri, Oct 14, 2011 at 3:07 AM, Carl Witthoft wrote: > Hi all, > I'd like to plot the Real and Imaginary parts of some f(z) as two different > surfaces in wireframe (the row/column axes are the real and imag axes).  I > know I can do it by, roughly speaking, something like > > plotz <- expand.gri

Re: [R] Multiple levelplot with title

2011-10-15 Thread Deepayan Sarkar
On Sun, Oct 9, 2011 at 10:00 PM, Richard O. Legendi wrote: > Hi all, > > I'm new to R and to the mailing list, so please bear with me :-) > > I would like to create multiple levelplots on the same chart with a nice > main title with something like this: > >  print(levelplot(matrix(c(1,2,3,4), 2, 2

Re: [R] Superposing mean line to xyplot

2011-10-15 Thread Deepayan Sarkar
mails in the archives and looked at some slides from Deepayan > Sarkar but still can not get the point. > > This is the context. I've got data on 9 microRNAs, each miRNA has been > measured on three different arrays and on each array I have 4 > replicates for each miRNA, which sum

Re: [R] "pos" in panel.text

2011-10-15 Thread Deepayan Sarkar
On Mon, Oct 10, 2011 at 6:31 PM, Allan Sikk wrote: > Here's the code. The problem seems to be specific for lattice as I can > easily use a vector with pos in "plot". lattice::panel.text() does not support vector 'pos'. (Not very difficult to fix, and I'll put it on my TODO list). For now, you wil

Re: [R] Legend symbols (line, points) in one column.

2011-10-15 Thread Deepayan Sarkar
On Fri, Oct 14, 2011 at 10:02 AM, David Winsemius wrote: > Legends are built in columns. You need to find a graphics symbol to put in > the "points" column or you need to find something that the lines paramater > will turn into a dot (and I'm not sure what that might be.) A 'lines' component can

  1   2   3   4   5   6   7   8   >