Command Reference : Command Reference
  
 
xget
Retrieve data from an external application into an EViews object.
Syntax
xget(options) object @smpl sample
xget is used to retrieve data from an external COM application (support is currently provided for MATLAB and R). An existing connection to the external application must have already been opened using xopen. The xget command should be followed by the name of the object to retrieve, followed by an optional @smpl keyword and a sample specification, or the name of a sample object. Including @smpl lets you specify the observations into which the data will be retrieved.
Options
 
name=arg
Specify the name of the object to be created in EViews. If the name option is not specified, the created object will have the same name as the external application object that is being retrieved.
wf=arg
Specify the workfile into which the retrieved objects will be placed. The specified workfile must be currently open inside EViews. If the wf option is not specified, the objects will be put into the current default workfile.
page=arg
Specify the workfile page into which the retrieved objects will be placed. If the page option is not specified, the objects will be put into the current default page.
type=arg
Specify the EViews object type to be created. arg can be “series”, “alpha”, “matrix”, “vector”, “svector”, “coef”, “sym”, “scalar” or “string”. If the type option is not set, EViews will automatically decide which object type to create.
mode = arg (default=“merge”)
Merge options: “protect” (protect destination – only retrieve values if destination does not already exist), “merge” (prefer source -– merge only if source value is non-missing), “mergedest” (prefer destination – merge only if destination value is missing), “update” (replace all destination values in the retrieval sample with source values), “overwrite” (replace all destination values in retrieval sample with source values, and NAs outside of sample).
R-specific options
 
fdata=arg
When reading a factor object, specifies how to read the factor data: as numbers (default), as labels (“labels”), as both numbers and labels (“both”).
If “fdata=both”, the labels will be read into a valmap object, and the valmap will be attached to the destination series (the data target must be a series for this setting).
fmap=arg
Name of the valmap object to hold the factor labels (when “fdata=both”).
fmode=arg
Specifies settings for reading factor label data into a valmap: merge with preference to the existing values in the map (default), merge with preference to the factor map values (“merge”), overwrite existing valmap definitions (“overwrite”), do not alter an existing valmap (“protect”).
The default method adds definitions from the factor to an existing valmap, retaining existing valmap entries that conflict with definitions from the factor.
“Merge” adds definitions from the factor to an existing valmap, replacing conflicting valmap entries with definitions from the factor.
“Overwrite” replaces an existing valmap specification with the factor definitions.
“Protect” ensures that an existing valmap is not altered.
MATLAB-specific options
 
workspace=arg (default=“base”)
MATLAB environment in which to obtain the data: “base” (base workspace), “global” (global workspace).
Examples
xget X
retrieves an object “X” from the current open external application connection, and stores it into the current default workfile.
xget(type=vector, name=x1) Ymat
retrieves the object named “Ymat” and stores it into the current default workfile as a vector named X1.
xget(wf=mywf, type=series, name=x2) X @smpl 1990 1999
retrieves X and stores it in the MYWF workfile as a series called X2, where only the observations between 1990 and 1999 are filled in.
Cross-references
See “EViews COM Automation Client Support (MATLAB and R)” for discussion.
See also xopen, xclose, xput, xrun and xlog.