I'm trying R and learning to use it. I'm making an application with shiny loading the data from an ORACLE base.
To load the data I have created R scripts to part of the application and to launch it I load the data before with this scirpt:
library(shiny)
library(RODBC)
source("ConexionBBDDOracle.R")
source("sectorAgrupado.R")
source("Sector.R")
source("agrupacionProductoServicio.R")
source("productoservicio.R")
source("consulta.R")
nombresSectorAgrupado <- setNames(object = as.character(sectorAgrupado$L0CODIGO), nm = as.character(sectorAgrupado$L0NOMBRE))
nombresSector <- setNames(object = as.character(sector$SECODIGO), nm = as.character(sector$SENOMBRE))
nombresProductoAgrupado <- setNames(object = as.character(agrupacionproductoservio$E8CODIGO),nm = as.character(agrupacionproductoservio$E8NOMBRE))
nombreProducto <- setNames(object = as.character(productoServicio$PSCODIGO),nm = as.character(productoServicio$PSNOMBRE))
nombresSector <- setNames(object = as.character(sector$SECODIGO), nm = as.character(sector$SENOMBRE))
nombreProducto <- setNames(object = as.character(productoServicio$PSCODIGO),nm = as.character(productoServicio$PSNOMBRE))
runApp(getwd(), port=8100)
In the data files I have information of this style
con <-conexion()
consulta <- ejecutaQuery(con,"select COCODIGO, COTEXTO,COCOSE,COCOPS,COFECHA from L2113T00")
cerrarConexion(con)
This way I already have the data frames created for when I run the app.
The problem is this: The query table has more than 500,000 records and I want to load it in its entirety. Since it has a lot of data, it takes a long time to load the shiny application, not only that, but also that the application does not show the data and blocks after a while.
I understand that I should not load the whole blow table because it is useless. But I would like to know which is the most correct way to load the data.