Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
stats[importdata] - Read Statistical Data from a File
Calling Sequence
stats[importdata](filename, n)
importdata(filename, n)
Parameters
filename
-
name of the file to be read
n
(optional, default=1) number of streams into which to split the file data
Description
Important: The stats package has been deprecated. Use the superseding package Statistics instead.
The function importdata of the stats package reads statistical data from a file.
The data in the file are just a sequence of numbers, separated by spaces or the end of line. They will be processed by a sscanf(..., `%f`).
The character # introduces a comment that ends at the end of that line.
Missing data are represented in the data file by the * character. It will be converted to the keyword missing.
If the number of streams, which is indicated by the parameter n, is one, the data in the file given by filename are returned as an expression sequence. If the number of streams is greater than one then the data in the file are returned as an expression sequence of n lists. The first item in the file goes into the first list, the second item goes into the second list, and so on, until there is an item in each list. The next item in the file then goes at the end of the first list, and so on until the whole file is imported.
More sophisticated data files can be read using readline and sscanf. The function {readdata} is very similar to stats[importdata].
The command with(stats,importdata) allows the use of the abbreviated form of this command.
Examples
where the datafile could contain the following ------------------------
| # this is a comment
| 2 3
| 4 5
| 6 * # one missing data
| # another comment
------------------------
At the end T will be
See Also
readdata, readline, sscanf, Statistics, stats(deprecated)[data], transform(deprecated)[split]
Download Help Document