[R] Rolling 7 day incidence

2021-08-17 Thread Dr Eberhard Lisse
Hi, I am loading the coronavirus dataset everyday which looks something like: as_tibble(coronavirus) %>% filter(country=="Namibia" & type=="confirmed") %>% arrange(desc(date)) %>% print(n=10) # A tibble: 573 × 7

Re: [R] Rolling 7 day incidence

2021-08-17 Thread PIKAL Petr
Hi. There are several ways how to do it. You could find them easily using Google. e.g. https://stackoverflow.com/questions/19200841/consecutive-rolling-sums-in-a-vector-in-r where you find several options. Cheers Petr > -Original Message- > From: R-help On Behalf Of Dr Eberhard > L

Re: [R] Including percentage values inside columns of a histogram

2021-08-17 Thread Rui Barradas
Hello, I had forgotten about plot.histogram, it does make everything simpler. To have percentages on the bars, in the code below I use package scales. Note that it seems to me that you do not want densities, to have percentages, the proportions of counts are given by any of h$counts/sum(h$co

Re: [R] Rolling 7 day incidence

2021-08-17 Thread Dr Eberhard Lisse
Petr, thank you very much, this pointed me in the right direction (to refine my Google search :-)-O): library(tidyverse) library(coronavirus) library(zoo) as_tibble(coronavirus) %>% filter(country=='Namibia' & type=="confirmed") %>%

Re: [R] Rolling 7 day incidence

2021-08-17 Thread PIKAL Petr
Hi You're wellcome. You probably know https://www.repidemicsconsortium.org/projects/ as a collection of tools for epidemy evaluation. Cheers Petr > -Original Message- > From: R-help On Behalf Of Dr Eberhard > Lisse > Sent: Tuesday, August 17, 2021 2:30 PM > To: r-help@r-project.org >

[R] Cars2

2021-08-17 Thread George Bellas
Hi R Core team, I was looking at this link for data sets, https://stat.ethz.ch/R-manual/R-devel/library/datasets/html/00Index.html and wanted to use cars2. I found cars2 earlier this week, but now when I look at the list, it's not there! Can you tell me what happened to cars2? I have tried cal

Re: [R] Cars2

2021-08-17 Thread Ivan Krylov
On Tue, 17 Aug 2021 09:50:54 + George Bellas wrote: > I found cars2 earlier this week, but now when I look at the list, > it's not there! That sounds like a dataset provided by a contributed package. Does https://search.r-project.org/ help find it again? -- Best regards, Ivan > [[al

Re: [R] Including percentage values inside columns of a histogram

2021-08-17 Thread Bert Gunter
Inline below. On Tue, Aug 17, 2021 at 4:09 AM Rui Barradas wrote: > > Hello, > > I had forgotten about plot.histogram, it does make everything simpler. > To have percentages on the bars, in the code below I use package scales. > > Note that it seems to me that you do not want densities, to have

Re: [R] Cars2

2021-08-17 Thread Rui Barradas
Hello, That seems to be a subset of dataset cars. Are you sure that it wasn't created before by code? Hope this helps, Rui Barradas Às 10:50 de 17/08/21, George Bellas escreveu: Hi R Core team, I was looking at this link for data sets, https://stat.ethz.ch/R-manual/R-devel/library/datasets

Re: [R] Including percentage values inside columns of a histogram

2021-08-17 Thread Rui Barradas
Hello, Às 19:28 de 17/08/21, Bert Gunter escreveu: Inline below. On Tue, Aug 17, 2021 at 4:09 AM Rui Barradas wrote: Hello, I had forgotten about plot.histogram, it does make everything simpler. To have percentages on the bars, in the code below I use package scales. Note that it seems

[R] Package for "design graphs"

2021-08-17 Thread madsmh
Hi, in our course littrature a "design graph" of two factors R and S with associated maps s : I -> S and f : I -> S where I is some finite index set, is a graph with factor labeles as vertices and lines f(i) to s(i) for all observations i in I. Is there a package on CRAN that can draw graphs like

Re: [R] Including percentage values inside columns of a histogram

2021-08-17 Thread Bert Gunter
Ah yes. Duhhh... Thanks Rui. So h$density *diff(h$breaks) *100 will give the percentages. No need for arithmetic beyond that. Bert On Tue, Aug 17, 2021 at 12:03 PM Rui Barradas wrote: > > Hello, > > > > Às 19:28 de 17/08/21, Bert Gunter escreveu: > > Inline below. > > > > > > > > On Tue, Aug 1

Re: [R] Package for "design graphs"

2021-08-17 Thread Bert Gunter
Have you looked at the gR Task View on CRAN: https://cran.r-project.org/web/views/gR.html (I have no idea whether it's relevant to your query, though). Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed

Re: [R] Package for "design graphs"

2021-08-17 Thread Jeff Newmiller
Perhaps igraph or DiagrammeR? On August 16, 2021 9:55:50 AM PDT, mad...@gmail.com wrote: >Hi, > >in our course littrature a "design graph" of two factors R and S with >associated maps s : I -> S and f : I -> S where I is some finite index >set, is a graph with factor labeles as vertices and lines

Re: [R] [External] Package for "design graphs"

2021-08-17 Thread Richard M. Heiberger
can you post an example of the graph? From: R-help on behalf of mad...@gmail.com Sent: Tuesday, August 17, 2021 16:02 To: r-help@r-project.org Subject: [External] [R] Package for "design graphs" Hi, in our course littrature a "design graph" of two factors R an