Skip to contents

Data object class. Provides functionality like retrieving data or summary functions.

Public fields

table_name

(character) character string of the table name

data

(dataframe) data frame of the retrieved table

Methods


Method new()

constructor

Usage

OData$new(table_name = "factions")

Arguments

table_name

(character) character string of the table name Get Data Table


Method get_table_data()

Retrieve Data from OD DB and keep it as data

Usage

OData$get_table_data(table_name = self$table_name)

Arguments

table_name

(character) character string of the table name Create db connection from OD docker defaults


Method get_con()

Usage

OData$get_con(
  db = "next",
  host_db = "localhost",
  db_port = "5432",
  db_user = "postgres",
  db_password = "postgres"
)

Arguments

db

(character character string of the connection arg)

host_db

(character character string of the connection arg)

db_port

(character character string of the connection arg)

db_user

(character character string of the connection arg)

db_password

(character character string of the connection arg)

Returns

RPostgres conn object Count observations by grouping variables.


Method get_count()

Usage

OData$get_count(grouping_vars, sort_n_desc = FALSE)

Arguments

grouping_vars

A character vector containing grouping variables of a data table.

sort_n_desc

A boolean value indicating whether the whole data frame should be sorted in descending order by n. Default is FALSE.

table_name

(character) character string of the table name

Returns

A (grouped) data frame.


Method clone()

The objects of this class are cloneable with this method.

Usage

OData$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.