read_flat_table_file {rolap}R Documentation

Import flat table file

Description

Reads a text file and creates a flat_table object. The file is expected to contain a flat table whose first row contains the name of the columns. All columns are considered to be of type String.

Usage

read_flat_table_file(name, file, sep = ",", page = NULL, unknown_value = NULL)

Arguments

name

A string, flat table name.

file

A string, name of a text file.

sep

Column separator character.

page

A string, name of the new field in which to include the name of the file.

unknown_value

A string, value used to replace empty and NA values in attributes.

Details

When multiple files are handled, the file name may contain information associated with the flat table, it could be the table page information if the name of a new field in which to store it is indicated in the page parameter.

We can also indicate the value that is used in the data with undefined values.

Value

A flat_table object.

See Also

star_database

Other flat table definition functions: as_star_database(), flat_table(), get_table(), get_unknown_value_defined(), get_unknown_values(), read_flat_table_folder()

Examples


file <-
  system.file("extdata/mrs",
              "mrs_122_us_cities_1962_2016_new.csv",
              package = "rolap")

ft <- read_flat_table_file('mrs_new', file)


[Package rolap version 2.5.1 Index]