Re: [R] Create new data frame with conditional sums

2023-10-16 Thread Bert Gunter
Sorry, misstatements. It should (of course) read: If one makes the reasonable assumption that Pct is much larger than Cutoff, sorting Pct is the expensive part e.g O(nlog2(n) for Quicksort (n = length Pct). I believe looping is O(n^2). etc. On Mon, Oct 16, 2023 at 7:48 AM Bert Gunter wrote: > >

Re: [R] Ynt: creating a time series

2023-10-16 Thread Jeff Newmiller via R-help
Then your data has extra data points... either duplicates or records with timestamps not on 15min intervals. On October 16, 2023 7:29:25 AM PDT, "ahmet varlı" wrote: >hello, > >because ı have data between these times and it has 177647 elements > >Gönderen: Marc

Re: [R] Create new data frame with conditional sums

2023-10-16 Thread Bert Gunter
If one makes the reasonable assumption that Pct is much larger than Cutoff, sorting Cutoff is the expensive part e.g O(nlog2(n) for Quicksort (n = length Cutoff). I believe looping is O(n^2). Jeff's approach using findInterval may be faster. Of course implementation details matter. -- Bert On Mo

[R] Ynt: creating a time series

2023-10-16 Thread ahmet varlı
hello, because ı have data between these times and it has 177647 elements Gönderen: Marc Girondot via R-help adına R-help Gönderildi: 16 Ekim 2023 Pazartesi 13:43 Kime: r-help@r-project.org Konu: Re: [R] creating a time series Why did you expect to have 177647

Re: [R] Create new data frame with conditional sums

2023-10-16 Thread Leonard Mada via R-help
Dear Jason, The code could look something like: dummyData = data.frame(Tract=seq(1, 10, by=1),     Pct = c(0.05,0.03,0.01,0.12,0.21,0.04,0.07,0.09,0.06,0.03),     Totpop = c(4000,3500,4500,4100,3900,4250,5100,4700,4950,4800)) # Define the cutoffs # - allow for duplicate entries; by = 0.03; # by

Re: [R] creating a time series

2023-10-16 Thread Marc Girondot via R-help
Why did you expect to have 177647 elements ? I found that 177642 is the correct number: Marc baslangic <- as.POSIXct("2017-11-02 13:30:00", tz = "CET") bitis <- as.POSIXct("2022-11-26 23:45:00", tz = "CET")  # zaman_seti <- seq.POSIXt(from = baslangic, to = bitis, by = 60 * 15) y2017_11_02 <-

Re: [R] creating a time series

2023-10-16 Thread Rui Barradas
Às 11:12 de 16/10/2023, ahmet varlı escreveu: Hello everyone, � had 15 minutes of data from 2017-11-02 13:30:00 to 2022-11-26 23:45:00 and number of data is 177647 � would like to ask why my time series are less then my expectation. baslangic <- as.POSIXct("2017-11-02 13:30:00", tz = "CET"

[R] creating a time series

2023-10-16 Thread ahmet varlı
Hello everyone, � had 15 minutes of data from 2017-11-02 13:30:00 to 2022-11-26 23:45:00 and number of data is 177647 � would like to ask why my time series are less then my expectation. baslangic <- as.POSIXct("2017-11-02 13:30:00", tz = "CET") bitis <- as.POSIXct("2022-11-26 23:45:00", tz