Timeline for How to provide your own example data for a custom package?
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 9, 2012 at 21:04 | vote | accept | JxB | ||
Aug 16, 2012 at 19:20 | comment | added | rm -rf♦ |
Well, it depends on to what extents the OP is willing to go to mimic the built-in feature. For example, the no argument definition could be modified to, say, ExampleData[] := DataPaclets`ExampleDataDump`Collections ~Join~ {"JxBs Package"} // Sort and so on... Anyway, I think we both agree that this is a reasonable way to go for the OP :)
|
|
Aug 16, 2012 at 19:16 | comment | added | jVincent | @R.M I called it cheating because you end up with functionality which appears like ExampleData fully handles the new data, which it of cause doesn't, maybe a different term would be more appropriate. | |
Aug 16, 2012 at 18:24 | comment | added | rm -rf♦ |
why is it cheating? I think this is perfectly fine way to do it, except that some commands like ExampleData[] won't list your custom data, because it gets the list directly from DataPaclets`ExampleDataDump`Collections . Of course, one could easily modify it to handle these too. If the OP doesn't want to use a custom example data function, then this is a reasonable way out (although, standard warnings about modifying built-ins in a package apply and should probably be mentioned)
|
|
Aug 16, 2012 at 18:03 | history | answered | jVincent | CC BY-SA 3.0 |