2

For my work I do data analysis. Most of these analysis are done on big databases with milions of records. I would like to make a manipulate (or animate) using a external dataset and create a CDF without sending this external dataset to other people.

As import syntax I use:

data = Import["E:\\file\\filename.TXT", 
  "Table", {"FieldSeparators" -> "|", "CharacterEncoding" -> "ASCII", 
   "HeaderLines" -> 1, "EmptyField" -> "", 
   "RepeatedSeparators" -> False}]

Examples of the imported dataset are:

{{0, 1, 0, 0, 0, 5}, {1, 1, 1, 1, 1, 297}, {1, 2, 0, 1, 1, 5}, {1, 3, 1, 1, 1, 1}, {2, 1, 2, 2, 2, 1310}, {2, 2, 1, 2, 2, 51}, {2, 3, 1, 2, 2, 5}, {3, 1, 3, 3, 3, 1894}, {3, 2, 1, 3, 2, 164}, {3, 3, 1, 2, 2, 23}, {3, 5, 1, 1, 1, 1}, {4, 1, 4, 4, 4, 2656}, {4, 2, 2, 4, 3, 295}, {4, 3, 1, 3, 2, 34}, {4, 4, 1, 2, 2, 5}, {4, 5, 1, 1, 1, 1}, {4, 7, 1, 1, 1, 1}, {5, 1, 5, 5, 5, 2693}, {5, 2, 2, 5, 4, 400}, {5, 3, 2, 4, 3, 70}, {5, 4, 1, 3, 2, 16}

I wrote this syntax to create a Manipulate

Manipulate[
 ListLinePlot[
  {Select[data[[All, {1, 2, 3}]], #[[1]] == bonbedrag &][[All, {2, 3}]], 
   Select[data[[All, {1, 2, 4}]], #[[1]] == bonbedrag &][[All, {2, 3}]], 
   Select[data[[All, {1, 2, 5}]], #[[1]] == bonbedrag &][[All, {2, 3}]]},
  Filling -> {1 -> {2}}, FillingStyle ->  LightBrown, 
  PlotStyle -> {{Red, , Thick}, {Blue, Thick}, {Green, Dashed, Thick}},
  PlotLegends -> Placed[{"ondergrens", "bovengrens", "gemiddeld"}, Below], 
  InterpolationOrder -> 2,
  AxesLabel -> {Style["aantal artikelen gekocht", Bold, Red], 
    Style["prijs duurste artikel", Bold, Blue]}, ImageSize -> Large, 
  PlotLabel -> Style[Framed[StringForm["Bonbedrag = Euro `1`", bonbedrag]]],
  GridLines -> Automatic, 
  GridLinesStyle -> Directive[Orange, Dashed], 
  PlotRange -> {{0, 20}, {0, 200}}, AxesOrigin -> {0, 0}
  ],
 {bonbedrag, 1, 200, 1}]

The result is the next picture

example manipulate

Then I save the presentation in CDF format, without the import-syntax. When I send the presentation it doesn't work. Can somebody help me how to deal with external files in a manipulate syntax?

Dr. belisarius
  • 115,881
  • 13
  • 203
  • 453
Michiel van Mens
  • 2,835
  • 12
  • 23

2 Answers2

3

Data import and export are not supported from within CDF Player with the exception of Wolfram-curated data sources (ChemicalData, CountryData, WordData, etc.).

Because CDF Player cannot load custom data at runtime, you must ensure that all necessary information is embedded within the interactive elements of your .cdf file. This can be done with either Initialization or SaveDefinitions; both are options to Manipulate.

– from the Mathematica How-To

cormullion
  • 24,243
  • 4
  • 64
  • 133
0

This screencast shows the main features of an application for data importing and analysis in Mathematica. Although data importing is not shown in the screencast the application has a very nice interface for data importing from databases, spreadsheets and other data formats or sources. BEST Viewpoints can be used to standardize many common data mining and analytics tasks. You can download a trial version from here.

Ariel Sepulveda
  • 1,687
  • 10
  • 20
  • Please disclose your job relationship with the product maker in each answer promoting it. Also, try to keep that kind of marketing at a minimum. – Dr. belisarius Dec 16 '13 at 16:04