yaml_read_informant {pointblank}R Documentation

Read a pointblank YAML file to create an informant object

Description

With yaml_read_informant() we can read a pointblank YAML file that describes table information (typically generated by the yaml_write() function. What's returned is a new informant object with the information intact. The informant object can be given more information through use of the ⁠info_*()⁠ functions.

Usage

yaml_read_informant(filename, path = NULL)

Arguments

filename

File name

⁠scalar<character>⁠ // required

The name of the YAML file that contains fields related to an informant.

path

File path

⁠scalar<character>⁠ // default: NULL (optional)

An optional path to the YAML file (combined with filename).

Value

A ptblank_informant object.

Examples

There's a YAML file available in the pointblank package that's called "informant-small_table.yml". The path for it can be accessed through system.file():

yml_file_path <- 
  system.file(
    "yaml", "informant-small_table.yml",
    package = "pointblank"
  )

The YAML file can be read as an informant by using the yaml_read_informant() function.

informant <- yaml_read_informant(filename = yml_file_path)

informant
This image was generated from the third code example in the `yaml_write()` help file.

As can be seen from the information report, the available table metadata was restored and reported. If you expect metadata to change with time, it might be beneficial to use incorporate() to query the target table. Or, we can perform this querying directly from the YAML file with yaml_informant_incorporate().

Function ID

11-3

See Also

Other pointblank YAML: yaml_agent_interrogate(), yaml_agent_show_exprs(), yaml_agent_string(), yaml_exec(), yaml_informant_incorporate(), yaml_read_agent(), yaml_write()


[Package pointblank version 0.12.1 Index]