I am trying to use a little function inside a shiny app. It works perfectly on my local machine. But when I upload it to
shinyapps.io, I get the following error (from the
shinyapps.io log files):
Error in round(frequency) : non-numeric argument to mathematical function
Its really just a simple filter operation:
highPassFilter <- function(x) {
alpha1 <- (cos(.707*2*pi/48)+sin(.707*2*pi/48)-1)/cos(.707*2*pi/48)
HP <- (1-alpha1/2)*(1-alpha1/2)*(x-2*lag(x)+lag(x,2))
HP <- HP[-c(1,2)]
HP <- filter(HP, c(2*(1-alpha1), -1*(1-alpha1)*(1-alpha1)), method="recursive")
HP <- c(NA, NA, HP)
return(HP)
}
Any hint at why it works locally but not on the shinyapps server?
many thanks,
d