Learn R Programming

rolap (version 2.5.1)

as_csv_files: Generate csv files with fact and dimension tables

Description

To port databases to other work environments it is useful to be able to export them as csv files, as this function does.

Usage

as_csv_files(db, dir, type)

# S3 method for star_database as_csv_files(db, dir = NULL, type = 1)

Value

A string, name of a dir.

Arguments

db

A star_database object.

dir

A string, name of a dir.

type

An integer, 1: uses "." for the decimal point and a comma for the separator; 2: uses a comma for the decimal point and a semicolon for the separator.

See Also

star_database

Other star database exportation functions: as_dm_class(), as_multistar(), as_rdb(), as_single_tibble_list(), as_tibble_list(), as_xlsx_file(), draw_tables()

Examples

Run this code

db1 <- star_database(mrs_cause_schema, ft_num) |>
  snake_case()
tl1 <- db1 |>
  as_csv_files()

db2 <- star_database(mrs_age_schema, ft_age) |>
  snake_case()

ct <- constellation("MRS", db1, db2)
d <- ct |>
  as_csv_files(dir = tempdir())

Run the code above in your browser using DataLab