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 Bert Gunter
Well, of course Deepayan is right. But perhaps worth noting is that the U.S. government and presumably many others publishes tons of economic estimates of time series that are revised as later data comes in -- employment statistics were a recent prominent example that made the news. I leave it to

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

[R] How to create a proper S4 class?

2021-11-16 Thread Leonard Mada via R-help
Dear List-Members, I want to create an S4 class with 2 data slots, as well as a plot and a line method. Unfortunately I lack any experience with S4 classes. I have put together some working code - but I presume that it is not the best way to do it. The actual code is also available on

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 Christopher W Ryan via R-help
Thanks Bert, that looks promising. panel.smoother() is from latticeExtra https://rdrr.io/cran/latticeExtra/man/panel.smoother.html --Chris Ryan On Tue, Nov 16, 2021 at 2:08 PM Bert Gunter wrote: > Where did you get panel.smoother()? There is no such panel function in > lattice. > > Is

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

2021-11-16 Thread Bert Gunter
Where did you get panel.smoother()? There is no such panel function in lattice. Is something like this what you want? x <- 1:100 y <- rnorm(100, mean =5) end <- 91 # tentative smooth after this xyplot(y ~x, cutoff = end, col1 = "black", col2 = "red" , panel = function(x, y, col1, col2,

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

2021-11-16 Thread Christopher W Ryan via R-help
eclrs.3 %>% mutate(start.week = floor_date(realCollectionDate, unit = "week")) %>% group_by(start.week, k12) %>% summarise(n = n(), pctpos = 100 * mean(realResult)) %>% xyplot(pctpos ~ start.week | k12, col = "red", data = ., layout = c(1,2), ylab = "percent of test results positive", xlab =

Re: [R] How to use contour plot?

2021-11-16 Thread Ivan Krylov
On Tue, 16 Nov 2021 09:45:34 +0100 Luigi Marongiu wrote: > contour(df$X, df$Y, df$Z) contour() works on matrices (sometimes called "wide format" data). Z must be a numeric matrix, X must be a numeric vector with length(X) == nrow(Z), and Y must be a numeric vector with length(Y) == ncol(Z).

Re: [R] How to use contour plot?

2021-11-16 Thread Duncan Murdoch
On 16/11/2021 3:45 a.m., Luigi Marongiu wrote: Hello, I have a dataframe with 3 values and that I would like to plot with contour: ``` head(df) Y X Z 1 0.0008094667 50 1 2 0.0012360955 50 1 3 0.0016627243 50 1 4 0.0020893531 50 1 5

Re: [R] How to run prop.test on 3-level factors?

2021-11-16 Thread Jim Lemon
Hi Luigi, Maybe multinomial regression? https://www.r-bloggers.com/2020/05/multinomial-logistic-regression-with-r/ Jim On Tue, Nov 16, 2021 at 7:33 PM Luigi Marongiu wrote: > > Hello, > I have a large database with a column containing a factor: > ``` > > str(df) > 'data.frame': 500 obs. of

[R] How to use contour plot?

2021-11-16 Thread Luigi Marongiu
Hello, I have a dataframe with 3 values and that I would like to plot with contour: ``` > head(df) Y X Z 1 0.0008094667 50 1 2 0.0012360955 50 1 3 0.0016627243 50 1 4 0.0020893531 50 1 5 0.0025159819 50 1 6 0.0029426108 50 1 >

[R] How to run prop.test on 3-level factors?

2021-11-16 Thread Luigi Marongiu
Hello, I have a large database with a column containing a factor: ``` > str(df) 'data.frame': 500 obs. of 4 variables: $ MR : num 0.000809 0.001236 0.001663 0.002089 0.002516 ... $ FCN : num 2 2 2 2 2 2 2 2 2 2 ... $ Class: Factor w/ 3 levels "negative","positive",..: 1 1 1 1 1 1 1 1 1 1