Listing Octave Variables

Description

Lists currently defined variables in Octave global context.

Usage

o_who(..., options, rm.ans = FALSE, unique = TRUE)

Arguments

...
filtering patterns or extra arguments passed to o_who and o_whos. Only names matching any of the patterns are returned.
rm.ans
a logical that indicates if the automatic Octave variable ans should be included in the result (FALSE) or removed (TRUE).
options
options passed to Octave function who. See section Octave Documentation.
unique
a logical that indicates whether unique names should be returned. This argument is relevant in the case multiple patterns are specified in ....

Value

None

Octave Documentation for <em>who</em>

 -- Command: who
 -- Command: who pattern ...
 -- Command: who option pattern ...
 -- Command: C = who ("pattern", ...)
     List currently defined variables matching the given patterns.
     Valid pattern syntax is the same as described for the 'clear'
     command.  If no patterns are supplied, all variables are listed.
     By default, only variables visible in the local scope are
     displayed.

     The following are valid options but may not be combined.

     'global'
          List variables in the global scope rather than the current
          scope.

     '-regexp'
          The patterns are considered to be regular expressions when
          matching the variables to display.  The same pattern syntax
          accepted by the 'regexp' function is used.

     '-file'
          The next argument is treated as a filename.  All variables
          found within the specified file are listed.  No patterns are
          accepted when reading variables from a file.

     If called as a function, return a cell array of defined variable
     names matching the given patterns.

     See also: whos, isglobal, isvarname, exist, regexp

[Generated from Octave-3.6.4 on 2014-05-21 11:08:22 ]

Examples


## Don't show: 
# roxygen generated flag
options(R_CHECK_RUNNING_EXAMPLES_=TRUE)
## End Don't show

## Don't show: 
 o_clear() 
## End Don't show
o_who()
## character(0)
l <- as.list(setNames(1:10, letters[1:10]))
o_assign(l)
o_who()
##  [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"
## Don't show: 
  stopifnot( identical(o_who(), names(l)) ) 
## End Don't show

prefnames <- paste('pref', letters[1:10], sep='')
o_assign( setNames(l, prefnames) )
o_who()
##  [1] "a"     "b"     "c"     "d"     "e"     "f"     "g"     "h"    
##  [9] "i"     "j"     "prefa" "prefb" "prefc" "prefd" "prefe" "preff"
## [17] "prefg" "prefh" "prefi" "prefj"
o_who('pref*')
##  [1] "prefa" "prefb" "prefc" "prefd" "prefe" "preff" "prefg" "prefh"
##  [9] "prefi" "prefj"
## Don't show: 
  stopifnot( identical(o_who('pref*'), prefnames) ) 
## End Don't show

See also

Other listoct: o_ls, o_whos