Re: [R] plotrix: Bug in `sizetree()` function

2021-07-30 Thread Jim Lemon
It will fix the problem by loading plotrix and then overwriting size tree: library(plotrix) source("/sizetree.R") Jim On Sat, Jul 31, 2021 at 2:16 AM Reza Norouzian wrote: > Thank you, Jim. Just to make sure, does the function you've shared work > independently or it depends on the current ve

Re: [R] plotrix: Bug in `sizetree()` function

2021-07-30 Thread Reza Norouzian
Thank you, Jim. Just to make sure, does the function you've shared work independently or it depends on the current version of the package which has the bug? Thanks again, Reza *Reza Norouzian (he/him/his)* *Visiting Assistant Professor, Quantitative Methods* *Department of Educational Psychology*

Re: [R] Cumulates of snowfall within a given interval

2021-07-30 Thread Jim Lemon
Hi Stefano, Try using rollsum from the zoo package: library(zoo) rollsum_index<-function(x,window,val) return(which(rollsum(x,window) >= val)) rollsum_index(mydf$hn,2,80) [1] 6 13 18 19 Jim On Fri, Jul 30, 2021 at 5:24 PM Stefano Sofia wrote: > > Dear R users, > I have a data frame with daily

Re: [R] Cumulates of snowfall within a given interval

2021-07-30 Thread Stefano Sofia
Thank you Petr, simply perfect. Thank you again Stefano (oo) --oOO--( )--OOo-- Stefano Sofia PhD Civil Protection - Marche Region - Italy Meteo Section Snow Section Via del Colle Ameno 5 60126 Torrette di Ancona, Ancona (AN) Uff: +39 071 806 7743 E-ma

Re: [R] Cumulates of snowfall within a given interval

2021-07-30 Thread PIKAL Petr
Hi I would use ?embed function. nr <- which(rowSums(embed(mydf$hn, 2))>=80) mydf[nr,] But I feel strange that variant 40,50 should be accepted but 0, 90 should not. Both after two consecutive days result in more than 80cm cumulative snow. What about 1,80 how it differs from 0, 81. basically w

[R] Cumulates of snowfall within a given interval

2021-07-30 Thread Stefano Sofia
Dear R users, I have a data frame with daily snow cumulates (these quantities are known as "hn" and are expressed in cm), from the 1st of December to the 30th of April, for more than twenty years. I would need to find days when the sum of a given short interval (I might choose two consecutive d