Command Reference : Command Reference
  
 
xput
Send an EViews object to an external application.
Syntax
xput(options) ob_list @drop ob1 @smpl sample
xput is used to push data from EViews to an COM external application (either R or MATLAB). An existing connection to the external application must have already been opened, using xopen.
ob_list should be a space delimited list of EViews objects to push into the application. An asterisk (*) can be used as a wildcard. Objects that can be pushed include series, alphas, matrices, syms, vectors, svectors, rowvectors, coefs, scalars and strings. if the object list contains an object you do not wish to be pushed to the external application, you can use @drop followed by the name of the object.
For series and alphas, you may enter a sample to specify which observations you wish to be pushed, using @smpl followed by the sample specification or the name of a sample object.
Options
 
name=arg
Specify the name or names of the objects to be created in the destination application. Multiple names may be specified using a wildcard or a space-delimited list of names.
Names specified using the name option are case-sensitive so that destination objects will preserve the case of arg.
If the name option is not specified, the created objects will have the same name as the EViews objects that are being pushed, with the case determined by the case established for the COM connection (see xopen).
mode=arg (default= “overwrite”)
Merge options: “protect” (protect destination – only put values if destination does not already exist), “overwrite” (replace all destination values with source values, and resize if necessary).
wf=arg
Specify the workfile containing the objects to be pushed. The specified workfile must be currently open inside EViews. If the “wf=” option is not specified, the objects will be taken from the current default workfile.
page=arg
Specify the workfile page containing the objects to be pushed. If the “page=” option is not specified, the objects will be taken from the current default page.
map
Write value-mapped series using map labels instead of underlying values.
R-specific options
 
rtype=arg
Specify the type of object to be created in R. arg can be “vector”, “ts”, “data.frame” or “list”.
MATLAB-specific options
 
mtype =arg
Specify the type of object to be created in MATLAB: “matrix” (matrix object), “cell” (cell object).
workspace=arg (default=“base”)
MATLAB environment in which to place the data: “base” (base workspace), “global” (global workspace).
Examples
xopen(type=m)
xput(name=g) group01
opens a connection to MATLAB and then pushes the group GROUP01 to MATLAB, giving it the name G.
xopen(type=r)
xput(page=page2, rtype=vector) x @smpl 1990 1999
Opens a connection to R and pushes the series X from page PAGE2 of the current default workfile into a vector in R. Only the 10 observations for X from 1990 and 1999 are pushed into R. X will be named in R using the name “X” with the default case specified in the global options.
xopen(type=r, case=upper)
xput(rtype=data.frame, name=df1) x* @drop x2
Opens a connection to R and puts all objects whose name starts with “X”, apart from the object X2, into a data frame, named “df1”. The names of the “X*” objects will be uppercased in R.
Cross-references
See “EViews COM Automation Client Support (MATLAB, R, Python)” for discussion. See also “External Program Interface” for global options setting of the default case for names.
See also @xputnames, xopen, xclose, xget, xrun, and xlog.