Learn R Programming

RcppOctave (version 0.9.5)

o_ls: Listing Objects from the Current Octave Session

Description

The function o_ls is an enhanced listing function, which also lists user-defined functions, as opposed to o_who or o_whos, which only list variables. Note that this function works properly on Octave >= 3.6.1, but is known not to list user-defined functions on Octave 3.4.1 (for some unknown reason the Octave function completion_matches does not return the names of user-defined functions).

Usage

o_ls(long = FALSE, rm.ans = TRUE)

Arguments

rm.ans
a logical that indicates if the automatic Octave variable ans should be included in the result. Default (TRUE) is not to include it.
long
logical that indicates the desired type of output: if FALSE (default) then only the names of the variables are returned (like dispatched o_who), otherwise a list with more detailed information about each variable is retur

Value

  • a character vector or a list depending on the value of argument long.

See Also

Other listoct: o_who, o_whos

Examples

Run this code
o_clear(all=TRUE)

# only variables
o_assign(list(a=1, b=2, c=5))
o_ls()
# compare with the output of standard Octave functions
o_who() # should be the same output
o_whos()

# variables and user-defined functions
o_clear(all=TRUE) # first clear Octave session
o_source(system.file('scripts/ex_source.m', package='RcppOctave'))
o_ls()
o_ls(long=TRUE)
# compare with the output of standard Octave functions
o_who()
o_whos()

Run the code above in your browser using DataLab