Many thanks, herewith a reprex for the issue at hand:
In Global.R the code is:
con <- dbConnect(MySQL(),
user = ('root'),
password = ('ruvimboML55AMG'),
host = ('localhost'),
dbname = ('healthcare_mining'))
onStop(function(){
dbDisconnect(con)
})
get_data <- function(con) {
MBA_Online <- dbGetQuery(con, "SELECT Transaction,Item, Date, Quantity, CustomerID, Amount FROM onlineRetail WHERE Amount > 0 and Quantity > 0;")
# return(MBA_Online)
}
MBA_Online <- get_data(con = con)
An then in the server, I have the following:
``` r
MBA_Online <- reactivePoll(60000, session,
checkFunc = function(){
print("Entered Check")
Sys.time()
print(Sys.time())
# get max date from database table to determine if data has been updated
max_date <- dbGetQuery(con, "SELECT UNIX_TIMESTAMP(date_updated) FROM onlineRetail;")
return(max_date)
},
valueFunc = function(){
print("Entered Value")
Sys.time()
print(Sys.time())
get_data(con)
# return(MBA_Online)
}
)
ord <- function(MBA_Online) {
print(data)
}
# ord(isolate(pollData()))
observe(ord(MBA_Online()))
# Create transactions data reactively for access to associative rule mining
transactions <- reactive({
transactionsDS <- new.env()
transactionsDS$data <- as(split(MBA_Online()$Item, MBA_Online()$Transaction),"transactions")
})
Regards,
Chris