Skip to content

Language: Save Statement

Maurice HT Ling edited this page Dec 13, 2015 · 5 revisions

Save an object into an external file. Current objects that can be saved:

  • the current session
  • a data frame

Syntax:

  1. SAVE SESSION AS FILENAME: Saves current session into a file.

  2. SAVE DATAFRAME ID AS CSV FILENAME: Saves a data frame into a CSV file.

where

  • FILENAME is the file name (just file name, not entire path) to be saved in. Note that the file will be written into the current working directory.
  • ID is the name of the object.

Example:

# Set relative current working directory and load a CSV file
set rcwd data
load csv STI_2015.csv as STI

# Save STI as CSV file
save dataframe STI as csv STI_duplicate.csv

# Save the current session
save session as example_session.txt

Advanced Topics

  1. Bytecodes generated are:
    • savecsv
    • savesession