Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
1  
Do your recipients have copies of Mathematica or Wolfram Player Pro? I do not believe it is possible to import data in a CDF without one of those. –  Mr.Wizard Sep 18 '13 at 18:36
    
related - load big data to CDF –  Kuba Sep 18 '13 at 19:08
add comment

2 Answers

up vote 3 down vote accepted

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

share|improve this answer
add comment

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.

share|improve this answer
    
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. –  belisarius Dec 16 '13 at 16:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.