Html report downloads and causes an Error:
Warning: Error in UseMethod: no applicable method for 'filter' applied to an object of class "c('reactiveExpr', 'reactive', 'function')" [No stack trace available]
Reactive data is used for making reports
Part of server code fo report:
owd <- setwd(tempdir())
on.exit(setwd(owd))
file.copy(src, 'reppu_report_template.Rmd', overwrite = TRUE)
out <- rmarkdown::render('reppu_report_template.Rmd',
params = list(
data_BU = inter_data_filter_react_report(),
data_BU_month = inter_data_filter_react_report_month(),
organizations = input$inter_filter_org,
timelimit = input$inter_filter_time
en_time = update_time()
projectdata = projdata(),
userdata = userinfo()
),
rmarkdown::html_document()
)
file.rename(out, file)
}
R markdown filtering which causes error
# Take year from date slicer
startyear <- parse_date_time(params$timelimit[1],"ym") %>% year()
endyear <- parse_date_time(params$timelimit[2],"ym") %>% year()
# Calculate no of unique user accounts
usersum <- userdata() %>%
filter(tolower(user_reppu_cscorgnamefi) %in% params$organizations) %>%
filter(logindisabled != TRUE | is.na(logindisabled)) %>%
filter(year >= startyear & year <= endyear) %>%
distinct(id_user) %>%
count()
# Calculate no of projects opened within timeframe
startInterval <- as.Date(parse_date_time(params$timelimit[1],"ym"))
stopInterval <- as.Date(parse_date_time(params$timelimit[2],"ym"))
# Allow range from first day of starting month and last day of ending month
times <- interval(startInterval, stopInterval + months(1) - days(1) )
opened_projects <- projectdata() %>%
filter(tolower(cscorgnamefi) %in% params$organizations) %>%
filter(!is.na(cscprjopendate) & cscprjopendate %within% times & cscprjscope != "personal") %>%
select(cscprjnum) %>%
distinct(cscprjnum) %>%
count()