A nice feature of the mathematica documentation is the copious use of ExampleData
in illustrating functionality. I would like to provide some example data for a package I have written, but there is apparently no guidance in the docs or on the net on how to do this. Consequently, I have two related questions:
Is there a hook into the system's
ExampleData
function for providing your own example data? I'm thinking along the lines of theImportExport`RegisterImport[]
function that provides seamless integration of a custom import converter to theImport[]
command.If not, what is a good way to provide example data from a custom package? Ideally, the data would be available from the documentation browser when someone tries one of the examples.
I would prefer to package the data together with the package code, rather than store it on a remote server and access it with Import["http://myserver.com/exampledata.zip"]
.
myData[stuff]
, add aFormat
rule and some selectors? $\endgroup$Import
it from there?Import[FileNameJoin[{NotebookDirectory[], "testfile.xls"}]]
or so. What would anExampleData
version do more than that? $\endgroup$ExampleData
, one does not need to know the location of the data, as in jVincent's answer below. WithImport
, you need to know the location of the data file... $\endgroup$ExampleData
, and start playing. Is there a standard directory for storing data in a package, where Mma does not need to know the path? (I see $UserBaseDirectory<>"/ApplicationData", perhaps there?) $\endgroup$