fame (version 2.21)

fameAttributes: Fame Attributes

Description

FAME has some predefined attributes (such as creation and update dates) for databases and data objects, and also allows user defined attributes for objects in a database. Currently, this package deals only with data object attributes.

Among the more useful predefined attributes you can access are an objects creation and update dates, via the fameCreated and fameUpdated convenience functions. However, you can also use the more general fameAttribute function to access a string representation of any attribute, including user-defined ones.

Setting attributes

Before user-defined attributes can be set for a data object, the database itself must know the names and types of the attributes. Each data object can have up to twenty user-defined attributes of each of six data types: boolean, date, namelist, numeric, precision, and string. The names of the user-defined attributes are stored in the database in six namelist scalars named boolean_attribute_names, date_attribute_names, and so on, one for each data type. Functions will be provided shortly to do this.

Once the database knows what attributes are allowed, they can be set via fameSetAttribute.

fameAttribute reads one attribute of one object in a Fame database and returns it as a string. fameSetAttribute sets the value of one attribute of one object in a Fame database. getFameCreated and getFameUpdated return an object's created and updated attributes, respectively, as POSIXlt dates.

Usage

fameAttribute(attribute, fname, db)
fameSetAttribute(attribute, value, fname, db)
fameCreated(fname, db)
fameUpdated(fname, db)

Arguments

attribute

string naming the attribute to be returned

fname

name of an object in a FAME database

db

string giving the relative or full path to the Fame database to read or write from. If the fameLocalPath() function is defined, it will be called on this argument to obtain a path.

value

value to set the attribute to

Value

fameAttribute returns a named string.

fameSetAttribute returns whatever strings FAME wrote to standard output while setting the attribute.

fameCreated and fameUpdated each return a POSIXlt object.

Examples

Run this code
# NOT RUN {
fameUpdated("gdp.q", db = "somedb")
# }

Run the code above in your browser using DataCamp Workspace