# sample(String) -- creates an object of type Sample from a sample stored in a directory on disk

## Synopsis

• Function: sample
• Usage:
sample(String)
• Inputs:
• , name of the directory where the sample is stored
• Outputs:
• an instance of the type Sample, Sample read from the specified directory

## Description

A random sample of objects can be generated from an arbitrary model and stored to a directory on disk using the function writeSample. This shows how to retrieve that stored sample and have it loaded as an object of type Sample:

 i1 : writeSample(sample(ER(2,3,0.1),5), "testDirectory") i2 : mySample = sample("testDirectory") o2 = Sample{...4...} o2 : Sample i3 : peek mySample o3 = Sample{ModelName => Erdos-Renyi } Parameters => (2, 3, .1) SampleSize => 5 2 2 2 2 2 Data => {{x , x x }, {0}, {x x , x x }, {0}, {x x }} 1 1 2 1 2 1 2 1 2