To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/cc095ad8-0823-4401-b6a5-1872921e5d5e%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/fd52ab5e-baea-4a4b-8ab4-02e8481def9e%40googlegroups.com.
Hey everyone,
just as Joe mentioned, there is no solution, it just requires its time.
Using an external DB (benchmarked Redis and MongoDB for my use case) is not feasible, both systems are way to slow. I kept going with data.table, keep everything in memory and accept some extra time during startup. Setting the timeout for an app to ~20h did the job in my case.
Best,
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/b5b8d953-cf4e-4963-99e4-e6a15ca09554%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/b76429ef-2527-49e1-83c2-1146644356aa%40googlegroups.com.
Error in thisFunc() : object 'session' not found
Here is a (slightly abridged) copy of my code;
library(shiny)
library(dplyr)
library(lubridate)
data <- reactivePoll(100000, session,
checkFunc = function() {
if (difftime(Sys.time(), attr(sales,”TIMESTAMP"), units="mins") > 1) {
return("Old")
} else {
return("Current")
}
},
valueFunc = function() {
sales <- read.csv(“Sales_Data.pip", header = TRUE, sep = "|", quote = "\"")
attr(sales, “TIMESTAMP”) <- Sys.time()
summary <-
summarise(
group_by(
sales,
y=as.integer(year(Sales_Date)),
m=as.integer(month(Sales_Date)),
o=Office,
p=as.character(Product)
),
c=n_distinct(Sales_ID)
)
return(summary)
})
shinyServer(function(input, output, session) {
output$mytable2 = renderDataTable({
data()
}
output$plot1 = renderPlot({
plot<-ggplot(data(), aes(x=m, y=c))+
geom_bar(stat = "identity", colour='black', fill='#B1005D') +
xlab(“Sales by Product“) +
ylab("Month") +
scale_x_discrete()+
facet_wrap(~p) +
theme(strip.text.x = element_text(size = 14))
plot(plot)
})
})
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/170f9a3e-f8ae-45b3-a82c-242eedbf3004%40googlegroups.com.
data <- reactive({
sales <- read.csv(“Sales_Data.pip", header = TRUE, sep = "|", quote = "\"")
summary <-
summarise(
group_by(
sales,
y=as.integer(year(Sales_Date)),
m=as.integer(month(Sales_Date)),
o=Office,
p=as.character(Product)
),
c=n_distinct(Sales_ID)
)
invalidateLater(60*1000, NULL)
return(summary)
})
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/16d90fdb-4671-4f3a-9f5d-92afc977b5dc%40googlegroups.com.