Re: [R] Cluster prediction from factor/numeric datasets

2007-07-23 Thread ngottlieb
Scott:

Suggest you look at using Discrimnant Analysis (don't know which R
package has it). 
Take the Clusters created, using Discrimnant Analysis, Get Fisher Scores
for the clusters.
Then you can take new dataset applying fisher scores to see what which
defined cluster the new dataset
will be classified into.

Neil 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott Bearer
Sent: Monday, July 23, 2007 1:39 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Cluster prediction from factor/numeric datasets

Hi all,

I have a dataset with numeric and factor columns of data which I
developed a Gower Dissimilarity Matrix for (Daisy) and used
Agglomerative Nesting
(Agnes) to develop 20 clusters.

I would like to use the 20 clusters to determine cluster membership for
a new dataset (using predict) but cannot find a way to do this (no way
to predict in the cluster package).

I know I can use predict in cclust, kcca, and flexclust- but these
algorithms do not permit factor data or use a Gower dissimilarity
matrix, so are unusable to me.

Any suggestions?

Thanks in advance,

Scott

Scott Bearer, Ph.D.
Forest Ecologist
The Nature Conservancy
  in Pennsylvania
Community Arts Center
220 West Fourth Street, 3rd Floor
Williamsport, PA  17701

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


 
 
This information is being sent at the recipient's request or...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Need Help with Dendrogram and DataFrame Leaf names

2007-06-15 Thread ngottlieb
I having problem with dendrogram leaf names when I read a tab delimited
file into dataframe;

I have a text file, tab delimited, using read.table into a data frame as
follows:
  test1-read.table(c:\\R\\data\\Tremont4.txt, header=TRUE, sep=\t)

When I do this the test1 data frame is picking up my first column
names as
part of the data and not the case names, the leafs are the numbers on
the left 1-13
As opposed to the text names to the right. 

Example Output from displaying dataframe:
 test1
 row.names X1.31.2004 X2.29.2004 X3.31.2004 X4.30.2004
X5.31.2004 X6.30.2004 X7.31.2004 X8.31.2004 X9.30.2004 X10.31.2004
1 ConvertibleArbitrage  0.014  0.003  0.004  0.005
-0.013 -0.008 -0.002  0.003 -0.001  -0.003
2   DedicatedShortBias -0.017  0.003 -0.026  0.042
0.008 -0.013  0.081  0.013 -0.019  -0.018
3  EmergingMarkets  0.025  0.014  0.018 -0.033
-0.018  0.009 -0.001  0.018  0.023   0.024
4MarketNeutral  0.008  0.008 -0.001 -0.003
0.002  0.008  0.003  0.021  0.005   0.000
5  EventDriven  0.022  0.010  0.005  0.005
0.001  0.010  0.000  0.005  0.013   0.012
6   Distressed  0.024  0.009  0.006  0.007
0.003  0.011  0.005  0.006  0.012   0.019
7  EventdriveMultiStrategy  0.020  0.011  0.003  0.005
-0.001  0.009 -0.003  0.004  0.014   0.007
8RiskArbitrage  0.008  0.005  0.007 -0.006
0.004  0.003 -0.015  0.002  0.006   0.009
9 FixedIncomeArbitrage  0.012  0.009 -0.005  0.013
0.006  0.007  0.007 -0.004 -0.008   0.011
10 GlobalMacro  0.015  0.012  0.010  0.001
0.001  0.005  0.008 -0.008 -0.005   0.012
11 LongShortEquity  0.020  0.018  0.002 -0.014
-0.004  0.007 -0.014  0.001  0.024   0.014
12  ManagedFutures  0.011  0.069 -0.009 -0.065
-0.011 -0.028 -0.020 -0.015  0.020   0.048
13  Multi-Strategy  0.016  0.004  0.004  0.003
-0.001  0.001 -0.003  0.004  0.006   0.006

Input file looks like this:
row.names   1/31/2004 2/29/2004 3/31/2004
4/30/2004   5/31/2004   6/30/2004   7/31/2004
8/31/2004
ConvertibleArbitrage0.0140.003  0.004  0.005-0.013
-0.008  -0.002  0.003
DedicatedShortBias  -0.017   0.003  -0.026  0.042  0.008
-0.013  0.081 0.013
EmergingMarkets   0.0250.0140.018-0.033
-0.0180.009  -0.001   0.018
MarketNeutral 0.0080.008-0.001  -0.003  0.002
0.008 0.003   0.021
Etc...

Would appreciate why the read.table into dataframe sees the text as part
of the data oand
Not the observation names and is making the numbers the leaf names and
observation names.


Thanks for any help,
Neil Gottlieb


 
 
This information is being sent at the recipient's request or...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R Book Advice Needed

2007-06-13 Thread ngottlieb
Roland:

Thanks for your reply.

I have sort of pay my dues with statistics and doing the hard math
reading of
Proofs.

Years ago reading lots of books on Multi-variate Methods such
As Principal Components, Cluster Analysis, Discriminant Analysis,
Multi Dimensional Scaling(MDS), Optimization both LP and QP and more.

At this point, want to jump in avoiding all the
Mathematical proofs and just apply R and the packages for what I want to
do.

So as example, How to set-up a dataset (timeseries of returns),
formatted so I can do
A cluster Analysis and nicely format a dendrogram.

I am hoping the right books can show me, not concerned about
which distance measure and cluster method (i.e. Ward's, Single Linkage
etc)
Done this and know based on type of data what works best.

Just some simple books to jump start me right into practically applying
R.


Thanks for your response.

Regards,
Neil

-Original Message-
From: Roland Rau [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 13, 2007 10:14 AM
To: Gottlieb, Neil
Cc: R-help@stat.math.ethz.ch
Subject: Re: [R] R Book Advice Needed

Hi,

[EMAIL PROTECTED] wrote:
 I am new to using R and would appreciate some advice on which books to

 start with to get up to speed on using R.
 
 My Background:
 1-C# programmer.
 2-Programmed directly using IMSL (Now Visual Numerics).
 3- Used in past SPSS and Statistica.
 
 I put together a list but would like to pick the best of 
 and avoid redundancy.
 
 Any suggestions on these books would be helpful (i.e. too much 
 overlap, porly written etc?)
 
 Books:
 1-Analysis of Integrated and Co-integrated Time Series with R (Use R) 
 - Bernhard Pfaff 2-An Introduction to R - W. N. Venables
 3-Statistics: An Introduction using R - Michael J. Crawley 4-R 
 Graphics (Computer Science and Data Analysis) - Paul Murrell 5-A 
 Handbook of Statistical Analyses Using R - Brian S. Everitt 
 6-Introductory Statistics with R - Peter Dalgaard 7-Using R for 
 Introductory Statistics - John Verzani 8-Data Analysis and Graphics 
 Using R - John Maindonald; 9-Linear Models with R (Texts in 
 Statistical Science) - Julian J.
 Faraway
 10-Analysis of Financial Time Series (Wiley Series in Probability and 
 Statistics)2nd edition - Ruey S. Tsay

as one other message says, it depends a lot on your ideas what you want
to do with R. And, I'd like to add, how familiar you are with
statistics.
One book I am missing in your list is Venables / Ripley: Modern Applied
Statistics with S. I can highly recommend it.
If you are going to buy yourself only one book, then I would say: buy
Venables/Ripley

Best,
Roland


 
 
This information is being sent at the recipient's request or...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R Book Advice Needed

2007-06-13 Thread ngottlieb
Thanks Alain.

Guess bite the bullet with limited budget buy bunch
From Amazon and see what reads best and return the rest!.

One ends up collecting so many books (most of bought 5 books on Bayesian 
analysis years ago), 
still like browsing shelfs! 

Regards,
Neil

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Alain Reymond
Sent: Tuesday, June 12, 2007 6:23 PM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] R Book Advice Needed

[EMAIL PROTECTED] a écrit :
 I am new to using R and would appreciate some advice on which books to 
 start with to get up to speed on using R.

 My Background:
 1-C# programmer.
 2-Programmed directly using IMSL (Now Visual Numerics).
 3- Used in past SPSS and Statistica.

 I put together a list but would like to pick the best of 
 and avoid redundancy.

 Any suggestions on these books would be helpful (i.e. too much 
 overlap, porly written etc?)

 Books:
 1-Analysis of Integrated and Co-integrated Time Series with R (Use R) 
 - Bernhard Pfaff 2-An Introduction to R - W. N. Venables
 3-Statistics: An Introduction using R - Michael J. Crawley 4-R 
 Graphics (Computer Science and Data Analysis) - Paul Murrell 5-A 
 Handbook of Statistical Analyses Using R - Brian S. Everitt 
 6-Introductory Statistics with R - Peter Dalgaard 7-Using R for 
 Introductory Statistics - John Verzani 8-Data Analysis and Graphics 
 Using R - John Maindonald; 9-Linear Models with R (Texts in 
 Statistical Science) - Julian J.
 Faraway
 10-Analysis of Financial Time Series (Wiley Series in Probability and 
 Statistics)2nd edition - Ruey S. Tsay

 Thanks.

 Neil Gottlieb
   
Neil,

I am also new to R and I just bought the book of Peter Dalgaard (n°6).
I find it very practical. It covers a large panel of principal statistical 
techniques that you can use directly. I thinkk it is a good start for a R 
beginner. At least, it is good for me!
Don't forget the many resources on the R website.

Regards.

--
Alain Reymond
CEIA
Bd Saint-Michel 119
1040 Bruxelles
Tel: +32 2 736 04 58
Fax: +32 2 736 58 02
[EMAIL PROTECTED]
PGPId :  0xEFB06E2E

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


 
 
This information is being sent at the recipient's request or...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R Book Advice Needed

2007-06-13 Thread ngottlieb
Cody:

Think you might have asked the question for me Neil.

I do time series analysis of return data in finance.

I will be creating a factor model based on PCA
Or Single Value Decomposition to get Eigenvectors 
Of the correlation matrix (tends to work better for finance data
Than covariance).

From there will be doing style analysis, some optimization,
Regime switching, co-intregration testing and some
Statistical Process Control charting such as CUSUM.

Ultimately, what I learned over the years with statistics,
visualization is critical for my end-users. The don't
care what cluster method I use, be it Hierarchical
or Rosseau' newer methods such as Fanny, which
I find more robust.

In end I need practical stuff: as a programmer on 
Data types, data structures and even how to format and read in
Data.

So that's basically stuff I will be doing.

Neil

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, June 12, 2007 6:36 PM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] R Book Advice Needed



Alain,

Can you tell us what you plan to use R for?

Regards,
-Cody

[EMAIL PROTECTED] a écrit :
 I am new to using R and would appreciate some advice on which books to 
 start with to get up to speed on using R.

 My Background:
 1-C# programmer.
 2-Programmed directly using IMSL (Now Visual Numerics).
 3- Used in past SPSS and Statistica.

 I put together a list but would like to pick the best of
 and avoid redundancy.

 Any suggestions on these books would be helpful (i.e. too much 
 overlap, porly written etc?)

 Books:
 1-Analysis of Integrated and Co-integrated Time Series with R (Use R) 
 - Bernhard Pfaff 2-An Introduction to R - W. N. Venables
 3-Statistics: An Introduction using R - Michael J. Crawley 4-R 
 Graphics (Computer Science and Data Analysis) - Paul Murrell 5-A 
 Handbook of Statistical Analyses Using R - Brian S. Everitt 
 6-Introductory Statistics with R - Peter Dalgaard 7-Using R for 
 Introductory Statistics - John Verzani 8-Data Analysis and Graphics 
 Using R - John Maindonald; 9-Linear Models with R (Texts in 
 Statistical Science) - Julian J.
 Faraway
 10-Analysis of Financial Time Series (Wiley Series in Probability and 
 Statistics)2nd edition - Ruey S. Tsay

 Thanks.

 Neil Gottlieb


Cody Hamilton, PhD
Edwards Lifesciences
[[alternative HTML version deleted]]


 
 
This information is being sent at the recipient's request or...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R Book Advice Needed

2007-06-13 Thread ngottlieb
Thanks Roland, fortunately I dug up MASS by Venables/Ripley
buried under all my econometric and statistic books.

Will be reading it today and order a few of the R books
for additional support.


Thanks for your suggestions...
Regards,
Neil 

-Original Message-
From: Roland Rau [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 13, 2007 10:40 AM
To: Gottlieb, Neil
Cc: R-help@stat.math.ethz.ch
Subject: Re: [R] R Book Advice Needed

Hi Neil,

[EMAIL PROTECTED] wrote:
 
 At this point, want to jump in avoiding all the Mathematical proofs 
 and just apply R and the packages for what I want to do.
 
I'd still recommend Venables/Ripley: Modern Applied Statistics with S
(or often abbrev. MASS, which is also name of the package which supports
this book and is part of any standard distribution of R).
Have a look at the table of contents. It is possible via amazon.com (and
I guess also for a series of other books on your list).
I think using MASS together with the included manuals (especially An
Introduction to R) is probably the best way to get you started.

Best,
Roland


 
 
This information is being sent at the recipient's request or...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R Book Advice Needed

2007-06-13 Thread ngottlieb
Pat:

I have done PCA to extract eigenvectors on return series for equities.

Rotation does help and does make factors more understandable,
have had success doing this.

You are right, when doing pure statistical factors, one tends to find first 
factor
which explains most of the variance is the Market Beta.

Our scree score showed 20 factors explains most of the variance in equity 
returns.

If you sort on the factor loadings, the other first few factors tend to things 
such as 
interest rates,Energy prices, currency exposure. After that it gets a little 
more
complicated what the factors are but they tend to be sector specific. 

That's the major complaint about pure statistical factor analysis...
Interpretation but can get reasonable idea by sorting factor cores.

As for missing values, a lot of work has been done there with sampling
such as EM and Maximum Likehood.

I will check out your R code. Hopefully it will get included
Eventually in the Portfolio package.

Being new to R, will need to figure out how to source the code to R!

Regards,
Neil

-Original Message-
From: Patrick Burns [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 13, 2007 12:56 PM
To: Gottlieb, Neil
Subject: Re: [R] R Book Advice Needed

Neil,

'factor.model.stat' is a part of POP, which is an R package (that runs under 
S-PLUS as well).

We've made 'factor.model.stat' public domain so you don't have to have POP in 
order to use it.  The version of 'factor.model.stat' in the Public Domain area 
is not in a package.
You can just 'source' the code.  I just checked and 'factor.model.stat' is not 
in the 'portfolio' package -- I'm not sure why they haven't included it.

The statistical factors are already orthogonal.  Rotation is only aimed at 
trying to make them more interpretable.  I'm not very optimistic about that, 
other than the first factor represents the market.  But if you do have success, 
I'd be interested in hearing of it.

A caveat to the paragraph above is that orthogonality assumes no missing 
values.  Having no missing values is not a very common occurrence though (at 
least for a lot of us).  Most of the code in 'factor.model.stat' is handling 
missing values.

I haven't had call for rotations, but I'd be extremely surprised if there 
weren't a bunch somewhere in R.  The 'RSiteSearch' function should be your 
friend for this.

Pat


[EMAIL PROTECTED] wrote:

Thank Patrick. Is factor.model.stat part of r packages?

Also want to rotate the factors so they are orthogonal. 
Do you have varimax or promax rotation functio?

Neil

-Original Message-
From: Patrick Burns [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 13, 2007 11:28 AM
To: Gottlieb, Neil
Subject: Re: [R] R Book Advice Needed

Most or all of the work for your factor model should be done in 
'factor.model.stat' from the Public Domain page of the Burns Statistics 
website.  It is also in the 'portfolio' package, I believe.

Patrick Burns
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)

[EMAIL PROTECTED] wrote:

  

Cody:

Think you might have asked the question for me Neil.

I do time series analysis of return data in finance.

I will be creating a factor model based on PCA Or Single Value 
Decomposition to get Eigenvectors Of the correlation matrix (tends to 
work better for finance data Than covariance).

From there will be doing style analysis, some optimization,
Regime switching, co-intregration testing and some Statistical Process 
Control charting such as CUSUM.

Ultimately, what I learned over the years with statistics, 
visualization is critical for my end-users. The don't care what 
cluster method I use, be it Hierarchical or Rosseau' newer methods 
such as Fanny, which I find more robust.

In end I need practical stuff: as a programmer on Data types, data 
structures and even how to format and read in Data.

So that's basically stuff I will be doing.

Neil

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of 
[EMAIL PROTECTED]
Sent: Tuesday, June 12, 2007 6:36 PM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] R Book Advice Needed



Alain,

Can you tell us what you plan to use R for?

Regards,
-Cody

[EMAIL PROTECTED] a écrit :
 



I am new to using R and would appreciate some advice on which books 
to start with to get up to speed on using R.

My Background:
1-C# programmer.
2-Programmed directly using IMSL (Now Visual Numerics).
3- Used in past SPSS and Statistica.

I put together a list but would like to pick the best of
and avoid redundancy.

Any suggestions on these books would be helpful (i.e. too much 
overlap, porly written etc?)

Books:
1-Analysis of Integrated and Co-integrated Time Series with R (Use R)
- Bernhard Pfaff 2-An Introduction to R - W. N. Venables
3-Statistics: An Introduction using R - Michael J. Crawley 4-R 
Graphics (Computer Science and Data Analysis) - Paul Murrell 5-A 
Handbook of Statistical 

Re: [R] Read Windows-like .INI files into R data structure?

2007-06-13 Thread ngottlieb
Earl:

Really depends on the need. XML yes can get crazy (having had to deal
with some
ugly XML).

One can do a correctly formatted XML, that parses via the DOM which does
not mean well formatted XML. It's all 
a matter of design and data structures.

XML advantages: one can define own data types with attributes,
do data validation and nice searching with XPATH which
Is a whole subject in itself.

Sounds like XML is overkill for what you need.

Based on what you indicated, since not an R expert, writing a
Simple C function or Fortran routine would be best way to go,
Also gives you re-usable code if you are processing .ini
Files outside of the R environment.


If you program in Visual Basic or C you can develop a simple
DLL to call the old .ini functions which are document
On MSDN (Microsoft Developers Network). 

However, Looks like the R experts from threads gave a nice solution
using R.

Neil

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Earl F. Glynn
Sent: Wednesday, June 13, 2007 2:57 PM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] Read Windows-like .INI files into R data structure?

[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
 .Ini files are, for lack of a better description, ancient.

In this case a device is creating the INI files as part of an
experiment, so 
the file format cannot be changed (at least easily).

I've looked at XML files from time to time and I'm amazed more don't 
complain how bloated, if not wasteful, they are.  I've seen XML files
that 
were megabytes long when they held kilobytes worth of data.  INI files
may 
be ancient, but they can be efficient and effective compared with XML.
In 
some cases, newer may not really be better (but newer may have the 
momentum behind it).


Gabor Grothendieck [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]...
 In thinking about this a bit more here is an even shorter solution
where
 Lines.raw is as before:

 # Lines - readLines(myfile.ini)
 Lines - readLines(textConnection(Lines.raw))
 Lines2 - chartr([], ==, Lines)
 DF - read.table(textConnection(Lines2), as.is = TRUE, sep = =, fill
= 
 TRUE)
 L - DF$V1 == 
 subset(transform(DF, V3 = V2[which(L)[cumsum(L)]])[1:3], V1 != )

Thanks for your helpful suggestions, Gabor.  Perhaps your zoo option
is 
more elegant, but I try to use as few packages as possible, so this
option 
seemed the best for me.

Since in my problem the structure of the INI sections is almost static
and 
always present, I extended your example to create an in-memory list of 
everything in the INI file with this function:

# Prototype of how to read INI files to process olfactometer data
# efg, 13 June 2007
# Thanks to Gabor Grothendieck for helpful suggestions in the R-Help
# mailing list on how to parse the INI file.
Parse.INI - function(INI.filename)
{
  connection - file(INI.filename)
  Lines  - readLines(connection)
  close(connection)

  Lines - chartr([], ==, Lines)  # change section headers

  connection - textConnection(Lines)
  d - read.table(connection, as.is = TRUE, sep = =, fill = TRUE)
  close(connection)

  L - d$V1 == # location of section breaks
  d - subset(transform(d, V3 = V2[which(L)[cumsum(L)]])[1:3],
   V1 != )

  ToParse  - paste(INI.list$, d$V3, $,  d$V1,  - ',
d$V2, ', sep=)

  INI.list - list()
  eval(parse(text=ToParse))

  return(INI.list)
}


Here's an example of using the above function (I'll put the sample input

file below):

INI1 - Parse.INI(sample.ini)

# Explore INI contents
summary(INI1)

INI1$SystemSetup$OlfactometerCode
INI1$DefaultLevels
unlist(INI1$DefaultLevels)
INI1$Map

INI1$Map$port1
as.integer( unlist( strsplit(INI1$Map$port1, ,) ) )

= = = = =
Sample output:

 INI1 - Parse.INI(sample.ini)

 # Explore INI contents
 summary(INI1)
  Length Class  Mode
SystemSetup   1  -none- list
Files 8  -none- list
DefaultLevels 4  -none- list
OdorNames 2  -none- list
Map   3  -none- list

 INI1$SystemSetup$OlfactometerCode
[1] 3
 INI1$DefaultLevels
$FC00
[1] 50

$FC01
[1] 100

$FC02
[1] 50

$FC10
[1] 50

 unlist(INI1$DefaultLevels)
 FC00  FC01  FC02  FC10
 50 100  50  50
 INI1$Map
$port0
[1] 0,0,0,0,0,0,0,0,0,0,0,0

$port1
[1] 0,0,0,0,0,0,0,0,0,0,0,0

$port2
[1] 0,0,0,0,0,0,0,0,0,0,0,0


 INI1$Map$port1
[1] 0,0,0,0,0,0,0,0,0,0,0,0
 as.integer( unlist( strsplit(INI1$Map$port1, ,) ) )
 [1] 0 0 0 0 0 0 0 0 0 0 0 0

= = = = =
Sample input file, sample.ini:

[SystemSetup]
OlfactometerCode=3
[Files]
prelog0=Part0.txt
date0=2:06:27.461 PM 6/9/2007
note0=group1-1
name0=group1
prelog1=Part1.txt
date1=2:09:16.809 PM 6/9/2007
note1=group1-1
name1=group1-1
[DefaultLevels]
FC00=50
FC01=100
FC02=50
FC10=50
[OdorNames]
port0=None
port1=None
[Map]
port0=0,0,0,0,0,0,0,0,0,0,0,0
port1=0,0,0,0,0,0,0,0,0,0,0,0
port2=0,0,0,0,0,0,0,0,0,0,0,0

= = = = =

Thanks again, Gabor!

efg

Earl F. Glynn
Scientific Programmer
Stowers Institute for 

Re: [R] Read Windows-like .INI files into R data structure?

2007-06-12 Thread ngottlieb
Earl:

.Ini files are, for lack of a better description, ancient.

There are old windows functions such as GetProfileString.
However you will have to make reference to load these from the windows
Kernel.dll.
Probably not worth the effort to code really old things as .ini files.

From what I see of packages, better to change these files to XML format
see if the XML package on CRAN will solve your requirement.

The section names would be top nodes with
XML tags containing the data at the sub level. XML is really
The best way to go; get away from .ini files.

Look at the XML package, reading nodes, parsing DOM.

Neil 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Earl F. Glynn
Sent: Tuesday, June 12, 2007 12:48 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Read Windows-like .INI files into R data structure?

I need to process some datasets where the configuration information was
stored in .INI-like files, i.e., text files with sections like this:

[Section1]
var1=value1
var2=value2
[Section2]
A=value3
B=value4

...

From Google and other searches I haven't found any package, or function
within a package, that reads .INI files into an R list, or other data
structure.



Any suggestions, or do I need to write my own?

efg

Earl F. Glynn
Stowers Institute for Medical Research

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


 
 
This information is being sent at the recipient's request or with their 
specific understanding. The recipient acknowledges that by sending this 
information via electronic means, there is no absolute assurance that the 
information will be free from third party access, use, or further 
dissemination. This e-mail contains information that is privileged and/or 
confidential and may be subject to legal restrictions and penalties regarding 
its unauthorized disclosure or other use. You are prohibited from copying, 
distributing or otherwise using this information if you are not the intended 
recipient. Past performance is not necessarily indicative of future results. 
This is not an offer of or the solicitation for any security which will be made 
only by private placement memorandum that may be obtained from the applicable 
hedge fund. If you have received this e-mail in error, please notify us 
immediately by return e-mail and delete this e-mail and all attachments from 
your system. Than!
 k You.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R Book Advice Needed

2007-06-12 Thread ngottlieb
I am new to using R and would appreciate some advice on
which books to start with to get up to speed on using R.

My Background:
1-C# programmer.
2-Programmed directly using IMSL (Now Visual Numerics).
3- Used in past SPSS and Statistica.

I put together a list but would like to pick the best of 
and avoid redundancy.

Any suggestions on these books would be helpful (i.e. too much overlap,
porly written etc?)

Books:
1-Analysis of Integrated and Co-integrated Time Series with R (Use R) -
Bernhard Pfaff
2-An Introduction to R - W. N. Venables
3-Statistics: An Introduction using R - Michael J. Crawley
4-R Graphics (Computer Science and Data Analysis) - Paul Murrell
5-A Handbook of Statistical Analyses Using R - Brian S. Everitt
6-Introductory Statistics with R - Peter Dalgaard
7-Using R for Introductory Statistics - John Verzani
8-Data Analysis and Graphics Using R - John Maindonald;
9-Linear Models with R (Texts in Statistical Science) - Julian J.
Faraway
10-Analysis of Financial Time Series (Wiley Series in Probability and
Statistics)2nd edition - Ruey S. Tsay

Thanks.

Neil Gottlieb


 
 
This information is being sent at the recipient's request or with their 
specific understanding. The recipient acknowledges that by sending this 
information via electronic means, there is no absolute assurance that the 
information will be free from third party access, use, or further 
dissemination. This e-mail contains information that is privileged and/or 
confidential and may be subject to legal restrictions and penalties regarding 
its unauthorized disclosure or other use. You are prohibited from copying, 
distributing or otherwise using this information if you are not the intended 
recipient. Past performance is not necessarily indicative of future results. 
This is not an offer of or the solicitation for any security which will be made 
only by private placement memorandum that may be obtained from the applicable 
hedge fund. If you have received this e-mail in error, please notify us 
immediately by return e-mail and delete this e-mail and all attachments from 
your system. Than!
 k You.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.