Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1750

Re: Sharing numerical data along with a Mathematica notebook

From Murray Eisenberg <murray@math.umass.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Sharing numerical data along with a Mathematica notebook
Date 2011-04-17 11:55 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ioekf7$n47$1@smc.vnet.net> (permalink)

Show all headers | View raw


Here's a simple strategy:

1. Instruct the users to put the data file in the same directory where 
the notebook is.

2. Include in your notebook (perhaps as an Initialization cell):

    SetDirectory[NotebookDirectory[]]

    You can see for yourself the result of this by evaluting then, say,
    FileNames[] and you'll see the list of files in that directory.

3. Now you can just refer to the data files by name, without any need 
for a path or to search, and do your Import or however you're grabbing 
the data from the file.

On 4/16/2011 7:33 AM, Andrew DeYoung wrote:
> Hi,
>
> I use Mathematica a lot to manipulate large lists of numerical data
> (rather than another system, because I find Mathematica's plot options much
> easier to understand and use).  Often, I like to share my Mathematica
> plots (including the raw data) with others.  I typically send the raw
> data (such as an Excel file or CSV file) and the Mathematica notebook
> with the import commands and the plotted data.  However, this can be a
> little complicated, because then my collaborators have to either make
> sure to put the Excel file in the same directory as the Mathematica
> notebook when they detach it from my email, or I have to put a command
> like:
>
> fileName=SystemDialogInput["FileOpen"]
> Import[fileName]
>
> which allows the user to use the Windows interface to select where on
> their hard drives the Excel file is.  The slight problem with this is
> that the user cannot then simply re-execute the entire notebook (to
> update the plot after changing their parameters) without again using
> the Windows interface to set fileName every time.
>
> Of course, another option is to include the raw data in the same
> Mathematica notebook, but this can lead to large and cluttered
> notebooks.
>
> My question is, is there any better way that I can saving my numerical
> data and sharing it with collaborators?
>
> Thank you,
>
> Andrew DeYoung
> Carnegie Mellon University
>

-- 
Murray Eisenberg                     murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Sharing numerical data along with a Mathematica notebook Murray Eisenberg <murray@math.umass.edu> - 2011-04-17 11:55 +0000

csiph-web