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

2021-10-11 Thread Luigi Marongiu
Thank you, but on the example in use, it draws at each x a triplet of y from the same class linked by a segment. It is essentially a strip plot rather than a scatter plot... On Mon, Oct 11, 2021 at 10:28 PM Bert Gunter wrote: > > Your panel function needs to plot the points! See at b

Re: [R] assumptions about how things are done

2021-10-11 Thread Avi Gross via R-help
I appreciate the feedback from several people. As noted, I do not want a deep philosophical discussion here and my main point remains not to expect software you "borrow" to do what you WANT but to accommodate it doing what it should. Most of the time, I would say that a I want a vectorized funct

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

2021-10-11 Thread Bert Gunter
Your panel function needs to plot the points! See at below xyplot(Value ~ Concentration, group = Substance, data = df, pch = 16, cex = 1.2, type = "b", xlab=expression(bold(paste("Concentration (", mu, "M)"))), ylab=expression(bold("Infection rate")),

Re: [R] unexpected behavior in apply

2021-10-11 Thread Rolf Turner
On Mon, 11 Oct 2021 09:15:27 + PIKAL Petr wrote: > > data.frame is not matrix or array (even if it rather resembles one) > > So if you put a cake into oven you cannot expect getting fried > potatoes from it. Another fortune nomination! cheers, Rolf -- Honorary Research Fellow Depar

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

2021-10-11 Thread Luigi Marongiu
Thanks, now I got the bars (although without notch) but I lost the main plot: ``` xyplot(Value ~ Concentration, group = Substance, data = df, pch = 16, cex = 1.2, type = "b", xlab=expression(bold(paste("Concentration (", mu, "M)"))), ylab=expression(bold("Infection rate")), col=COLS, scales = list(

Re: [R] [External] Missing text in lattice key legend

2021-10-11 Thread Luigi Marongiu
Yes, that was the case. Now it works! Thanks On Mon, Oct 11, 2021 at 4:22 PM Richard M. Heiberger wrote: > > looks like a paren outof place. the text is inside the points. it should be > parallel to the points in the calling sequence. > > Get Outlook for iOS > >

Re: [R] How to read from a file within a gzipped file

2021-10-11 Thread Rui Barradas
Hello, You can create a connection and read from it. desc <- "X:/Mkt Science/Projects/ tv/202109.ext/tsa.20210901.xml.zip" fname <- "20210901.socioDemos.a.xml" zz <- unz(desc, fname) Now read from zz. Example: xml <- XML::xmlParse(zz) Hope this helps, Rui Barradas Às 17:24 de 11/10/21, C

Re: [R] How to read from a file within a gzipped file

2021-10-11 Thread Ivan Krylov
On Mon, 11 Oct 2021 16:24:01 + "Conklin, Mike (GfK) via R-help" wrote: > Is there a way to return a connection to a single file within a > zipped file using gzfile or some other method. Sure! Use unz() instead of gzfile(). -- Best regards, Ivan

[R] How to read from a file within a gzipped file

2021-10-11 Thread Conklin, Mike (GfK) via R-help
Hi have a large number of zipped files, each containing 3 xml files that I want to read. I would like to read one of the xml files without having to decompress each zip file first. If I run gzfile(path2zipped file) I get A connection with description "X:/Mkt Science/Projects/ tv/202109.ext/t

Re: [R] assumptions about how things are done

2021-10-11 Thread Jorgen Harmse via R-help
As noted by Richard O'Keefe, what usually happens in an R function is that any argument is evaluated either in its entirety or not at all. A few functions use substitute or similar trickery, but then expectations should be documented. I can understand that you want something like ifelse(y>x,x/y,

Re: [R] [External] Missing text in lattice key legend

2021-10-11 Thread Richard M. Heiberger
looks like a paren outof place. the text is inside the points. it should be parallel to the points in the calling sequence. Get Outlook for iOS From: R-help on behalf of Luigi Marongiu Sent: Monday, October 11, 2021 7:46:36 AM To: r-help

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 Luigi Marongiu
Awesome, thanks! On Mon, Oct 11, 2021 at 2:19 PM Deepayan Sarkar wrote: > > 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") > > xypl

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 =

[R] How to add error bars to lattice xyplot

2021-10-11 Thread Luigi Marongiu
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, 92.3733, 98.9567, 1.4833, 0.6467, 50.6600,

[R] Missing text in lattice key legend

2021-10-11 Thread Luigi Marongiu
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 = 1.2, type = "b", xlab=expression(bold(paste("Concentration (", mu,

Re: [R] unexpected behavior in apply

2021-10-11 Thread PIKAL Petr
Hi it is not surprising at all. from apply documentation Arguments X an array, including a matrix. data.frame is not matrix or array (even if it rather resembles one) So if you put a cake into oven you cannot expect getting fried potatoes from it. For data frames sapply or lapply is pr