[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rewrite of structs - advice sought
From: |
John W. Eaton |
Subject: |
Re: rewrite of structs - advice sought |
Date: |
Wed, 23 Jun 2010 13:47:37 -0400 |
On 23-Jun-2010, fork wrote:
| > May I suggest enhancing the
| > | basic load and save operation, implementing something similar to R data
| > | frame, which are:
| > | A data frame, a matrix-like structure whose columns may be of differing
| > | types (numeric, logical, factor and character and so on).
| > |
| > | Basically, load and save should try to return a structure array in case
of a
| > | first non-comment line of fields name, a matrix if all values are of
similar
| > | types, and an error code otherwise ?
|
| (this should be a different thread if we really want to pursue it)
|
| data.frames (and smart categorical data handling) are some of the few things I
| miss about R. It is really nice to be able to write
|
| data[10:15, 'colname']
|
| and get something reasonable.
|
| > Feel free to enter a feature request in the bug tracker, but please
| > remember that Octave is developed by volunteers and you may have to
| > provide some additional incentive to get someone interested in working
| > on a particular project.
|
| If there were a well designed data.frame-ish idea, I think it would be fairly
| easy (as in 100 lines or so) to write an m-function to handle the OP's basic
| idea for importing. We have scanf and split functions...
|
| > Also, we have compatibility with Matlab (not R) to consider. Perhaps
| > it would be best if someone were to write a function for Octave that
| > is compatible with Matlab's importdata function.
|
| While this would be cool, it wouldn't address the issue of different column
| types or column names. Unless I am misreading the online docs.
It looks to me like spreadsheet data doesn't have to be all numeric,
but I have no experience with actually using the function, so maybe I
misunderstand what it can do.
| And I personally think sophisticated data-handling would be a good reason to
| allow non-TMW based functions and protocols. I am all for Octave being a
strict
| superset of matlab, and in this case there is no good matlab approach.
There is nothing preventing you from writing and contributing a set of
functions for reading R-like data frames (even R data files) into some
kind of struct- or cell-array data structure with all the appropriate
tags and data included in one object. But I think that overloading
Octave's load function for that purpose is not the right thing to do.
jwe
Re: rewrite of structs - advice sought, CdeMills, 2010/06/23