Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions R/codesets.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ argos$set(
#' differ from `name`.
#' @param indexes A list of columns on which indexes should be created.
#' @param db A connection to the database into which to load the codeset.
#' @param .chunk_size An integer specifying that the data should be written
#' out in chunks of the specified number of rows.
#'
#' @return A tbl pointing to the table in the database
#' @export
Expand All @@ -99,17 +101,18 @@ load_codeset <- function(name,
table_name = name,
indexes = list('concept_id'),
full_path = FALSE,
db = config('db_src'))
db = config('db_src'),
.chunk_size = 5000)
get_argos_default()$load_codeset(name, col_types, table_name, indexes,
full_path, db)
full_path, db, .chunk_size)

argos$set(
'public', 'load_codeset',
#' @name load_codeset-method
#' @inherit load_codeset
function(name, col_types = 'iccc', table_name = name,
indexes = list('concept_id'), full_path = FALSE,
db = self$config('db_src')) {
db = self$config('db_src'), .chunk_size = 5000) {

if (self$config('cache_enabled')) {
if (is.null(self$config('_codesets'))) self$config('_codesets', list())
Expand All @@ -122,7 +125,8 @@ argos$set(
full_path = full_path),
name = table_name,
overwrite = TRUE,
indexes = indexes)
indexes = indexes,
.chunk_size = .chunk_size)

if (self$config('cache_enabled')) {
cache[[name]] <- codes
Expand Down