Typing and structure checking for r object.

r_type_checking(
  r_object,
  type,
  length = NULL,
  allowed_value = NULL,
  output = "error"
)

Arguments

r_object

R object expected.

type

Object of class character expected. Type or class expected of the r object. you can choose between arguments "character", "list", "PostgreSQLConnection", "numeric", "integer", "logical", "data.frame", "tbl" or "NULL".

length

Object of class integer expected. By default NULL. Specify the vector length expected. Fill with NULL with you don't know the length expected.

allowed_value

Object of class vector (excepted a list) expected. Be default NULL. Allowed value(s) in the r object.

output

character expected. Kind of expected output. By default "error". You can choose between "error", "message" or "logical".

Value

The function returns error with output is "error" and if the parameters are not respected, a character with output is "message", a logical with output is "logical"