redSplitOut: convert the vector returned by redExec into commands and...

View source: R/redcas.R

redSplitOutR Documentation

convert the vector returned by redExec into commands and command output.

Description

REDUCE output contains both the commands issued and the output from the commands. Since the output is of interest, redSplitOut separates the input vector into a list containing vectors of output, commands and the input to redSplitOut.

Usage

redSplitOut(x)

Arguments

x

a character vector containing REDUCE output

Details

Although it is possible to use the REDUCE switch ECHO to prevent display of commands, this does not prevent display of the sequence numbers for the commands. redSplitOut can be called by redExec to separate the output from the commands. It can also be used after the call if the split option was not used or on an arbitrary output file from REDUCE, for example the full output which can be retrieved by redClose.

Value

A list containing three elements:

out

the command output

cmd

the commands

raw

the input to redSplitOut, i.e. the combined cmd and out vectors.

Author(s)

Martin Gregory

See Also

redExec

Examples

result <- c("5: ",
            "{x=-1}",
            "",
            "6: ",
            "b := {{2,12},{11,1}}",
            "",
            "7: ",
            "8: ",
            "               - m",
            "la := ---------------------",
            "                2       2",
            "       sqrt(v(3)  + v(2) )",
            "",
            "9: ",
            "",
            "10: ")
split <- redSplitOut(result)
writeLines(split$out)

redcas documentation built on April 12, 2025, 1:40 a.m.