Re: [R] aggregation of irregular interval time-series

2021-06-13 Thread Enrico Gabrielli
Hello thanks to my friend Diego, a computer agronomist, I was able to figure out how to do it. I still have only one problem: how do I calculate the data for the first week? The traps were set up on the fields on May 5th. On that date, a 0 could be entered for all time-series. But how to do it with

Re: [R] aggregation of irregular interval time-series

2021-06-10 Thread Enrico Gabrielli
sorry, i'm a bit of a bummer at copying and saving various pieces of code and I'm not very experienced with R - I am trying to build a partnership with a local IT cooperative, but this is a job that was not foreseen and it is not covered by budget, so I am trying to solve it myself - I do not want

Re: [R] aggregation of irregular interval time-series

2021-06-09 Thread Bert Gunter
I have *not* followed this in any detail, but this line seems wrong: arvaia_catture_order <- arvaia_catture[order(arvaia_catture$tempo)] Perhaps it should be: arvaia_catture_order <- arvaia_catture[order(arvaia_catture$tempo), ] ## note the comma! If I am mistaken, just ignore and move on. Chee

Re: [R] aggregation of irregular interval time-series

2021-06-09 Thread Rui Barradas
Hello, I'm not getting your simple sum: arvaia_catture_order[, week := as.integer(format(tempo, "%U"))] aggregate(catture ~ week, arvaia_catture_order, sum) # week catture #1 19 15 #2 20 5 #3 21 78 #4 22 120 Can you explain your result better? Hope this helps, R