Learn R Programming

sqlutils (version 1.2)

cacheQuery: Function for working with cached queries.

Description

This will first look in the given directory for a CSV or Rda version of the file, if it exists, that will be read and returned. Otherwise it will execute the query and then saves a CSV or Rda file.

Usage

cacheQuery(query = NULL, dir = getwd(), filename = getCacheFilename(query  = query, dir = dir, ext = format, ...), format = "rda", maxLevels = 20, ...)

Arguments

dir
the directory to save and load cached data files. Defaults to the current working directory (i.e. getwd.
filename
the filename of the cached data file.
query
the query to execute.
maxLevels
the maximum number of levels a factor can have before being converted to a character vector.
...
other parameters passed to the execQuery function including query parameters.
format
either csv for comma separated value files or rda for R data files.

Value

a data frame.