R/convert_type.R

Defines functions convert_laftype convert_type convert_rtype

convert_rtype = function(type){
  switch(
    EXPR = type,
    'character' = 'STRING',
    'integer' = 'INTEGER',
    'numeric' = 'REAL',
    'Date' = 'DATETYPE',
    'factor' = 'ENUM',
    stop('type "', type, '" not implemented')
  )
}

convert_type = function(type){
  switch(
    EXPR = type,
    'STRING' = 'character',
    'INTEGER' = 'integer',
    'REAL' = 'numeric',
    'DATETYPE' = 'Date',
    'ENUM' = 'factor',
    stop('type "', type, '" not implemented')
  )
}

convert_laftype = function(type){
  switch(
    EXPR = type,
    'STRING' = 'character',
    'INTEGER' = 'integer',
    'REAL' = 'numeric',
    'DATETYPE' = 'character',
    'ENUM' = 'factor',
    'DUMMY' = 'character',
    stop('type "', type, '" not implemented')
  )
}

Try the blaise package in your browser

Any scripts or data that you put into this service are public.

blaise documentation built on Aug. 18, 2023, 5:06 p.m.