I have a dataframe with 2 column first: date-hour(every one hour one observation) and second column is temperature(th).I am trying to find What is the largest temperature change in my data series within a specific time (6 hours)? Consider both, rapid temperature increase and decrease. I implement a function to calculate the range between the max(x) and min(x) of a vector x. and then Use this function in the FUN = argument of the rollapply-function (from zoo package).
t_range<- function(x)diff(range(x))
th<-Th %>% mutate(t06 = rollapply(th,
width = 6,
FUN = t_range,
fill = NA,
align= "right",
arrange = desc(th)))
But I faced the following error : unused argument (arrange = c(.....
what is the problem of arrange= .. here?