Re: [R] ROracle connection problem

2004-11-18 Thread Prof Brian Ripley
I guess the issue is the use of R-1.9.0 (2.0.1 is current).  Please ask 
the person who provided you with a Windows binary for ROracle which 
version it worked with.

On Thu, 18 Nov 2004, Andi Felber wrote:
Hi,
I found the same question in the mailing list already a few months ago - but 
there was no answer to it - so I'll try it again

Could somebody help me to solve this following problem? I just begin to learn 
how to connect my Oracle database with R.

library(DBI)

library(ROracle)
Warning message:
DLL attempted to change FPU control word from 8001f to 9001f
ora=dbDriver(Oracle)
Error in initialize(value, ...) : Invalid names for slots of class OraDriver: 
Id

My system is:
Windows 2000,
Oracle 9.2
R1.9.0
Thank you very much
andi
 
Andreas Felber
Swiss Federal Institute for Snow and Avalanche Research
Flüelastrasse 11
CH-7260 Davos Dorf
phone ++41 81 417 02 52
email: [EMAIL PROTECTED]
personal homepage: http://www.slf.ch/staff/pers-home/felber/felber-en.html
web www.slf.ch

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] Redirect standard input and output of R

2004-11-18 Thread Uwe Ligges
Victor Robles wrote:
Dear R-people!
Im trying to write a C program that write to the standard input of R
and read the standard output.
I can perfectly read the R output, but Im not able of writing anything
to R.
This program really works with the cat UNIX command, but it does not
work with R. What Im doing wrong??? It is possible to do it???

Please read the manual Writing R Extensions, in particular the lines 
about Rprintf.

Uwe Ligges

I want to start R once and use it thousands of times... thats why Im
trying to use this system.
  pipe(fdW);
  pipe(fdR);
	pid = fork();
	if (pid==-1)
		perror(Error fork);
	
	if (pid==0)
	{
		close(0);
		dup(fdW[0]);
		close(fdW[0]);
		close(fdW[1]);
		
		close(1);
		dup(fdR[1]);
		close(fdR[1]);
		close(fdR[0]);
		
		execlp(R,R,--slave,NULL);
		perror(Error exec);
	}
	else
	{
		close(fdW[0]);
	close(fdR[1]); 

write(fdW[1], 3+7, 3);
total = 0;
while (total3)
{
leidos = read(fdR[0], k, sizeof(k));
printf(leidos son %d \n,leidos);
k[leidos]='\0';
if (leidos  0){
total = total + leidos;
printf(%s\n,k);
}
}
}
exit(0);
Best regards,
Victor
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Power sampling

2004-11-18 Thread Uwe Ligges
Thomas Schönhoff wrote:
Hello,
after a unsuccessful search in lists maliarchive I wonder how I could 
estimate the power of a sample size related to an unknown population.

Given the following (fake))situation:
I do have a database containing about 5 millions observations over 70 
variables.
I would like to compute (as epidemiologists are used to) the required 
 size of a sample to do some test on a test sample (test data), later 
doing some subsequent analysis of a new sample to build a prediction model.

Help facilities of R show some entries regarding power, but none of them 
seemed to be appropriate for my purpose (maybe I am wrong, but sometimes 
I have some difficulties to decipher the message of those tiny hints for 
available packages)
You have to tell us for which test you are going to calculate the power 
... (and there might be nothing, since calculating the power precisely 
is not always that easy).

Uwe Ligges

I would appreciate somebody effort to point me to the right 
package/function to archieve this task!

regards
Thomas
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] OOP pkg compilation failure

2004-11-18 Thread Uwe Ligges
Gorden Jemwa wrote:
Hi all,
I'm trying to install the OOP package (http://www.omegahat.org/OOP) but 
having difficulty in resolving the errors generated during compilation. 
Googling doesn't seem to be giving much help.

Can anyone please help. Below is the transcript of what I get from my 
command prompt. (I'm running on rw_2.0.0 WIN XP SP2 platform).

Thanks in advance
---transcript
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\...\R CMD INSTALL OOP.tar.gz
-- Making package OOP 
  adding build stamp to DESCRIPTION
  making DLL ...
making treeApply.d from treeApply.c
gcc   -Ic:/R/rw2000/include -Wall -O2   -c treeApply.c -o treeApply.o
ar cr OOP.a treeApply.o
ranlib OOP.a
windres --include-dir c:/R/rw2000/include  -i OOP_res.rc -o OOP_res.o
gcc  --shared -s  -o OOP.dll OOP.def OOP.a OOP_res.o 
-Lc:/R/rw2000/src/gnuwin32  -lg2c -lR
  ... DLL made
  installing DLL
  installing R files
  save image
[1] TRUE
Initializing OOP objects in database 1
execution of package source for 'OOP' failed
make[2]: *** [c:/R/rw2000/library/OOP/R/OOP] Error 1
make[1]: *** [all] Error 2
make: *** [pkg-OOP] Error 2*** Installation of OOP failed ***

Removing 'c:/R/rw2000/library/OOP'
a) The package does not pass the checks under R-2.0.1 on Windows, so 
please contact the maintainer!
b) It can be installed, I guess something is wrong with your settings or 
collection of tools.
c) I have *temporarily* put a binary up to 
http://www.statistik.uni-dortmund.de/~ligges/OOP_0.5-1.zip

Uwe Ligges


---end transcript
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re[2]: [R] Where has the Debian respository gone?

2004-11-18 Thread stats
Hello Dirk,

Monday, November 15, 2004, 1:35:27 AM, you wrote:

DE On Sun, Nov 14, 2004 at 10:53:42PM +0100, Christoph Bier wrote:
 Hi all!
 
 Did I miss something or is it just a temporary problem? Where has
 the Debian respository
 
 http://cran.r-project.org woody/main Packages
 resp.
 http://cran.r-project.org/bin/linux/debian/
 
 gone? I tried it for about the last 7 hours.

DE Current R and CRAN packages are on the Debian archives; you can install
DE these on testing too.  To the best of my knowledge, there are no backports
DE of current R and Debian CRAN packages to Debian stable. 

I'm a bit puzzled.  I had
deb http://cran.r-project.org/bin/linux/debian woody main
in /etc/apt/sources.list and had hoped, perhaps rather unwisely, that
this would look after the transition from 1.8.0 on my internet server (Debian
stable) where it serves up some cgi-bin work.  (Most of my R work is
on a Win2k machine, much though I'd like to go Debian all the way,
that isn't possible for my main job in near future.)

Is there an easy way of upgrading R on a Debian stable machine?  I
don't want to move off stable as the security side of that server is
too important.  I also don't really want to compile it myself if I can
avoid that, the server is pretty old iron and that might back up all
the Email stuff it does.

Advice anyone?

TIA,

Chris

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Chinese character

2004-11-18 Thread john zhao
Hello R-help team,

I am a R user in China.  I just downloaded the latest R which is R2001 for
Windows. This new version can not store Chinese character which the previous
version R 1.9.1 does.  Specifically when I enter

x-²âÊÔ
then type x, I got
 x
[1] \262\342\312\324 .

Please kindly give me a clue how to fix it.

Thanks
John

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R/S-related projects on Sourceforge? Trove Categorization

2004-11-18 Thread Witold Eryk Wolski
Hi,
This are the project which I have extracted from all your mails.
 
1. http://sourceforge.net/projects/rpgsql/  R PostgreSQL Interface
2. http://sourceforge.net/projects/r-spatial/   R package for spatial 
data classes
3. http://sourceforge.net/projects/rpy/ RPy (R from Python)
4. http://sourceforge.net/projects/ep-sf/   Expression Profiler
5. http://sourceforge.net/projects/fsap fish stock assessment for R
6. http://sourceforge.net/projects/flr/ R packages for use in 
fisheries modelling
7. https://sourceforge.net/projects/runit/  R Unit Test Framework
8. http://sourceforge.net/projects/ep-sf/   Expression Profiler
9. http://sourceforge.net/projects/r-asp/   Analysis of Spatial Data 
in R
10. http://sourceforge.net/projects/r4proteomics/  R Packages for proteomics
11. http://sourceforge.net/projects/rdbi/  R Database Interface
12. http://sourceforge.net/projects/nlmeode/   R package combining 
nlme and odesolve
13. http://sourceforge.net/projects/rarcinfo/  RArcInfo
14. http://sourceforge.net/projects/rgdal  GDAL Package for R
15. http://sourceforge.net/projects/gretl/ GNU Regression, 
Econometrics and Time-series Library
16. ...

Sorry if I have missed any. But it is surely more than five.
Thanks all of you for your numerous response and also for some more 
general thoughts concerning
*collaboratory* development using source code repositories:
https://stat.ethz.ch/pipermail/r-devel/2004-November/031398.html.
If I see how R is evolving I believe that this ideas will be realized soon.
Especially that there are already repositories covering some of the 
functionality and dedicated to R --  Bioconductor  with a svn archive. 
Unfortunately, as I was told by Geff Gentry the costs of administering 
the svn, cvs servers are high, hence the number of developers must be 
limited. Also CRAN has some of the functionality but the svn or cvs 
support is missing.
Luckily hosting the sources on e.g. sourceforge and the builds on CRAN 
or Bioconductor gives already some of the essential functionality.

Therefore at this place big thanks to the Bioconductor, CRAN and 
sourceforge people.

/E
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Fwd: Re: [R] 3d scatter plot with drop line

2004-11-18 Thread Robin Hankin


Hi

try this:




p3dpairs - function(x,x1, 
xlim=NULL,ylim=NULL,zlim=NULL,col=par(col), pch=par(pch), 
cex=par(cex), ...){
   if(is.matrix(x)){
 z - x[,3]
 y - x[,2]
 x - x[,1]
   }

 if(is.matrix(x1)){
 z1 - x1[,3]
 y1 - x1[,2]
 x1 - x1[,1]
   }

   if(missing(zlim)) {
 z.grid - matrix(range(z),2,2)
   } else {
 z.grid - matrix(zlim,2,2)
   }

   if(missing(xlim)){ xlim - range(x) }
   if(missing(ylim)){ ylim - range(y) }

   persp(xlim, ylim, z.grid, col = NA, border=NA, ...) - res

   trans3d - function(x,y,z, pmat) {
 tr - cbind(x,y,z,1) %*% pmat
 list(x = tr[,1]/tr[,4], y= tr[,2]/tr[,4])
   }

   out - trans3d(x,y,z,pm=res)
   out1 - trans3d(x1,y1,z1,pm=res)
   points(out, col=col, pch=pch, cex=cex, ...)

   for(i in 1:length(out$x)){
 lines(c(out$x[i],out1$x[i]),c(out$y[i],out1$y[i]), col=gray, ...)
   }
   return(invisible(out))
}




then


a - matrix(rnorm(60),20,3)
  b - a
b[,3] - 0
  p3dpairs(a,b)


gives you a good approximation to what you want

HTH

rksh


This is a follow up to my question from yesterday. I want to do in R
what is called a 3d scatter plot with drop lines in S-PLUS.

Basically, it's a 3dscatterplot with lines connecting the x-y grid to
the z points.
The lines give a better perspective on the shape of the data surface.

How to?

Joel Bremson
UC Davis Statistics

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


--

Robin Hankin
Uncertainty Analyst
Southampton Oceanography Centre
SO14 3ZH
tel +44(0)23-8059-7743
[EMAIL PROTECTED] (edit in obvious way; spam precaution)


-- 
Robin Hankin
Uncertainty Analyst
Southampton Oceanography Centre
SO14 3ZH
tel +44(0)23-8059-7743
[EMAIL PROTECTED] (edit in obvious way; spam precaution)
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] summary.lme() vs. anova.lme()

2004-11-18 Thread Dan Bebber
For anyone following this thread in the future:
Following Prof. Ripley's advice, I compared models fitted with ML, with and
without treatment as a predictor:

 anova(mconc.lme1,mconc.lme2)
   Model df   AIC   BIC   logLik   Test L.Ratio p-value
mconc.lme1 1 10 -1366.184 -1327.240 693.0919   
mconc.lme2 2 16 -1363.095 -1300.785 697.5475 1 vs 2 8.91124  0.1786

I can't reject the null hypothesis of no effect of treatment.

Many thanks.
Dan Bebber

Department of Plant Sciences
University of Oxford
South Parks Road
Oxford OX1 3RB
UK
Tel. 01865 275000



 -Original Message-
 From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] 
 Sent: 17 November 2004 15:32
 To: Dan Bebber
 Cc: [EMAIL PROTECTED]
 Subject: Re: [R] summary.lme() vs. anova.lme()
 
 
 On Wed, 17 Nov 2004, Dan Bebber wrote:
 
  I modelled changes in a variable (mconc) over time (d) for 
 individuals
  (replicate) given one of three treatments (treatment) 
 using: mconc.lme 
  - lme(mconc~treatment*poly(d,2), random=~poly(d,2)|replicate,
  data=my.data)
 
  summary(mconc.lme) shows that the linear coefficient of one of the 
  treatments is significantly different to zero, viz.
 Value Std.Error  DF   t-value p-value
  ...  ... ...  ...
  ...
  treatmentf:poly(d, 2)1  1.3058562 0.5072409 315  2.574430  0.0105
 
  But anova(mconc.lme) gives a non-significant result for the 
  treatment*time interaction, viz.
  numDF denDF   F-value p-value
  (Intercept)  1   315 159.17267  .0001
  treatment239   0.51364  0.6023
  poly(d, 2)   2   315  17.43810  .0001
  treatment:poly(d, 2) 4   315   2.01592  0.0920
 
  Pinheiro  Bates (2000) only discusses anova() for single arguments 
  briefly on p.90. I would like to know whether these results 
 indicate 
  that the significant effect found in summary(mconc.lme) is spurious 
  (perhaps due to multiplicity).
 
 Probably yes (but p values of 9% and 1% are not that 
 different, and in 
 both cases you are looking at a few p values).
 
 But since both summary.lme and anova.lme use Wald tests, I 
 would use a 
 LRT, using anova on two fits (and I would use ML fits to get 
 a genuine 
 LRT but that is perhaps being cautious).
 
 To  Dimitris Rizopoulos: as this is the last term in the 
 sequential anova, 
 it is the correct Wald test.
 
 -- 
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Redirect standard input and output of R

2004-11-18 Thread Paul Roebuck
On Wed, 17 Nov 2004, Victor Robles wrote:

 I'm trying to write a C program that write to the standard input of R
 and read the standard output. I can perfectly read the R output, but
 I'm not able of writing anything to R.
 [SNIP C code]

Several years ago, I wrote some software that used S-plus as its
back-end and Java for the front-end. I found what worked best was
to add a pseudoterminal inbetween; you can use the code from
UNIX Programming Environment to create one. The solution was
later reused when a similar project used R for its back-end.

--
SIGSIG -- signature too long (core dumped)

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R-gui] RE: [R] The hidden costs of GPL software?

2004-11-18 Thread Philippe Grosjean
John W. Eaton wrote:
 On 17-Nov-2004, Philippe Grosjean [EMAIL PROTECTED] wrote:
 
 | - There is no possibility to make a commercial GUI for R (thanks to 
 | the GPL),
 
 This is false.  Please don't confuse commercial (Red Hat 
 and SuSE GNU/Linux distributions are commercial software) 
 with proprietary.
 
 jwe

Ooops! Sorry, and thank you for correcting me. I mean proprietary, of
course.
Best,

Philippe Grosjean

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Power sampling

2004-11-18 Thread Thomas Schnhoff
Hello Uwe,
Uwe Ligges schrieb:
Thomas Schönhoff wrote:

You have to tell us for which test you are going to calculate the power 
... (and there might be nothing, since calculating the power precisely 
is not always that easy).
Given my example from the first message I asked for a function which 
enables me to calculate a reasonable sample size.

I don't know the true mean or standard deviation of the population, I 
only know:

n= 5.000.000 observations over 70 variables
determined alpha = 0.01
I want to know how to generate a sufficiently sized sample based upon 
above mentioned facts to make some valid predictions regarding my 
population.

All I can hink of for now is that a two-tailed power test is required 
to find out if H0= random effect  or H1= no random effect hypothesis 
is accepted/rejected.

In epidemiological studies this situation is described like this:
How many cases do I have to include in my sample (s) to gain some 
representative results from a unknown population (=true mean, 
std-deviation etc.)?

How can I approach a situation like this in R ?

Regards
Thomas

platform i386-pc-linux-gnu
arch i386
os   linux-gnu
system   i386, linux-gnu
status
major2
minor0.1
year 2004
month11
day  15
language R
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] The hidden costs of GPL software?

2004-11-18 Thread Tim Cutts
On 17 Nov 2004, at 2:27 pm, Patrick Burns wrote:
I think Ted Harding was on  the mark when he said that it is the help
system that needs enhancement.  I can imagine a system that gets the
user to the right function and then helps fill in the arguments; all 
of the
time pointing them towards the command line rather than away from
it.
I think this is spot on.  My situation is that I am a scientist turned 
system administrator, and R is a package which I am increasingly being 
asked to install for the use of scientists at this Institute.  I am by 
no means a statistician;  the statistics I learned in A-level maths 
almost 20 years ago were as far as I got, and most of that I have 
forgotten.  But I like to have some understanding of the software 
packages I am asked to support, so I've been looking at R with a view 
to learning some of its more basic functions.  It looks potentially 
very useful to me anyway for summarising activity on the supercomputing 
cluster that I run.

So I'm a newbie to R, armed with only a very basic knowledge of 
statistics (I know the difference between a Normal and a Poisson 
distribution at least, and with a bit of prodding could probably 
remember a binomial distribution too).  I'm an experienced programmer 
in several languages, and a PhD-level scientist.

And yet I have still found R really quite hard to learn, and this is 
principally because the on-line help is a reference manual.  I'm sure 
it's a fabulous resource if you're a statistician who uses R every day, 
but for me it's not very helpful.

The R Intro PDF is good, but it would be nice if it were integrated 
better, with hyperlinks to the reference documentation, or to other 
parts of the introduction, for those platforms that support such things 
(it looks like this was intended for MacOS X, which is the version I am 
playing with for my own use, although the version I maintain for users 
is on Linux [ and would be on Alpha/Tru64 too if I could get it to pass 
its tests ]) but the on-line help link to the Intro on the Aqua R 
version brings up a blank page, so I'm using the generic PDF document 
instead.

I think the GUI question has nothing to do with the hidden costs of the 
GPL, or otherwise.  This is the age-old ease-of-use versus power and 
capability argument.

I don't think a fancy GUI is necessary - the GUI aspects that have been 
added to R on Mac OS X are sufficient.  I get the impression that the 
real power of R is the fact that really it's a programming language, 
and should probably be treated and learned as such.  Quite apart from 
the fact that a GUI will necessarily be a somewhat restricted subset of 
the total functionality, and a lot slower to use once you've taken the 
effort to learn the software, I think there is another danger, which I 
have already seen in other pieces of software in the bioinformatics 
community.  Users frequently run completely pointless analyses through 
the GUI wrappers we provide.  The users using the command line 
interfaces typically do much more sensible things.

If you make a piece of software trivial for a user to use without 
thinking about what they're doing, then the users won't think.  I may 
not know much about statistics, but what little I do know is that 
understanding exactly what form of analysis or significance test is 
required to be meaningful is a real skill that takes a lot of 
experience to master.   Having to perform that analysis with written 
commands means that your method is recorded, and could be published, 
and more importantly be checked and reproduced by other researchers.  
It also gives you ample time to think about what you're doing, rather 
than just bashing out a pretty graph which actually has no real meaning 
whatsoever.

Any GUI to R could (and should) be able to store the command line 
equivalent to what it has just done, to satisfy the reproducible 
criterion above, but I suspect it could still lead to some pretty 
shoddy work being done by careless and lazy scientists, and we get 
enough of that already.

Tim
--
Dr Tim Cutts
Informatics Systems Group, Wellcome Trust Sanger Institute
GPG: 1024D/E3134233 FE3D 6C73 BBD6 726A A3F5  860B 3CDD 3F56 E313 4233
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] changing (core) function argument defaults?

2004-11-18 Thread Peter Dalgaard
Berton Gunter [EMAIL PROTECTED] writes:

 Yes, I think for all practical purposes it (usually?) is. Here's an example.
 Suppose I wish to change the default constant argument of mad from 1.48 to
 2. Then
 
  z-formals(mad)
  z$constant-2
  mad-as.function(c(z,body(mad)))

Actually, formals(mad)$constant-2 will do the same. In either case,
you need to be careful to note that the environment of the function is
changed to the current frame. So if you redefine median(), this will
be picked up by your mad(), but not by stats::mad(). 

 If you now attach the workspace/environment containing this newly defined
 mad function to the search list before the stats package (which contains the
 original mad()) you have effectively changed the default argument without
 changing the function.
 
 I hope experts will let us know when this can't be done (perhaps with
 .internal functions or non-exported functions in namespaces, though it isn't
 clear to me that one couldn't manually export them and do this here, too).

I'd expect that it works whenever the function has default arguments
to modify (.Primitive functions do not). The namespace mechanism only
ensures that you don't overwrite the original, and that packages
expecting to use the original can continue to do so.
 
 Of course, all the usual warnings about masking existing functions apply.

Yes, R is not preventing users from shooting themselves in the foot,
nor preventing package writers from shooting users in the foot (as a
recent query involving [.factor showed). 

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Lexical Scoping: eval(expr,envir=)

2004-11-18 Thread Eric Lecoutre
Hi R-listers,
I am trying to better undertand what we would call functional paradigm 
use of S/R to better map my programming activities in other languages.

This little function is aimed to create an object (at the end end, it would 
have it's own class):

--
  myObject =function(){
list(
  a=1,
  foo=function(b)
  {
  cat(b:,b)
  cat(\na:, a)
  }
)
  }
--
To my minds, a would be a property of the object and foo one of it's 
method.

Let instantiate one version of this object:
--
 tmp = myObject()
 tmp
$a
[1] 1
$foo
function(b)
  {
  cat(b:,b)
  cat(\na:, a)
  }
environment: 012DDFC8
--
Now I try to invoke it's foo method (definitively not a S terminology!)
For sure, tmp$foo() wont work, as it can't know anything about a.
Reading eval() help page, It is said:
envir: the 'environment' in which 'expr' is to be evaluated.  May
  also be a list, a data frame, or an integer as in 'sys.call' was
so that I was thinking that
 eval(tmp$foo(),envir=tmp)
Error in cat(b:, b) : Argument b is missing, with no default
would solve my problem, which is not the case.
tmp is a list, in which a is defined hand has a value.
Where is my fault?

Eric
R version 2.0.1, Windows

Eric Lecoutre
UCL /  Institut de Statistique
Voie du Roman Pays, 20
1348 Louvain-la-Neuve
Belgium
tel: (+32)(0)10473050
[EMAIL PROTECTED]
http://www.stat.ucl.ac.be/ISpersonnel/lecoutre
If the statistics are boring, then you've got the wrong numbers. -Edward 
Tufte

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] AYUDA

2004-11-18 Thread Trujillo L.
Hi Brian

You could check the R-Documentation: functions KalmanLike, KalmanRun, 
KalmanSmooth, KalmanForecast and makeARIMA.

Leonardo Trujillo
-- 
Leonardo Trujillo
Southampton Statistical Sciences Research - S3RI
University of Southampton
--
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Brian pfeng
Sent: 17 November 2004 20:44
To: [EMAIL PROTECTED]
Subject: [R] AYUDA

Hola, necesito informacion sobre como aplicar un modelo espacio estado y filtro 
de kalman en R. Soy nuevo en R.

Gracias

_

Información de Estados Unidos y América Latina, en Yahoo! Noticias.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] The hidden costs of GPL software?

2004-11-18 Thread Tim Cutts
On 18 Nov 2004, at 10:27 am, Tim Cutts wrote:
The R Intro PDF is good, but it would be nice if it were integrated 
better, with hyperlinks to the reference documentation, or to other 
parts of the introduction, for those platforms that support such 
things
I should correct myself here, and note that there are some 
cross-references within the PDF document, it's not completely devoid of 
them.

Tim
--
Dr Tim Cutts
Informatics Systems Group, Wellcome Trust Sanger Institute
GPG: 1024D/E3134233 FE3D 6C73 BBD6 726A A3F5  860B 3CDD 3F56 E313 4233
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] The hidden costs of GPL software?

2004-11-18 Thread Michael Grant
H, interesting thread and minds will not be
changed but regarding GUIs...I thought S (aka R) was a
PROGRAMMING LANGUAGE with a statistical and numerical
slant, and not a statistics application. ;O)  

Certainly there is an important place for GUIs but I
believe that it is very much overemphasized in modern
computer culture. My experience and bias--and I
started in the 1960's-- is that except for 'trivial'
uses, GUIs are a detriment to any reasonably complex
CREATIVE computational task. They are adequate for the
simple, common task. But even then, typing a command
or two is not overly taxing--- particularly when
compared to navigating layer upon layer of submenus as
is some times needed. If I need to, I will add a
little syntactical sugaring when coding and move on. 

GUIs encourage a passive approach to using computers
when solving problems. In addition, it is regretable
that a lot of people in the 'workplace' will carry out
incomplete and/or incorrect quantitative work because
of the real or perceived limitations of the particular
(GUI) apps they are using. There is no inclination to
go beyond the menu and even then many menu items
gather 'electronic dust'.

Finally, there are times for many of us when work
'goes home' at the end of the day. That just comes
with the territory. I (and most others) can not afford
the luxury of S-plus, Statistica, SPSS, etc. at home.
So in a sense there is a very real 'loss of
productivity' cost associated with using commercial
software. Now that does bring us around to supporting
R doesn't it? (Mea culpa. And I resolve to do better!)
What value does one put on the vitality of the R
community?

Best regards,
Michael Grant, Ph.D. 

* The requirements for creating packages are on
target,  and have the desired impact on both the
quality and breadth of R. 

--- Philippe Grosjean [EMAIL PROTECTED] wrote:

 Hello,
 
 In the latest 'Scientific Computing World' magazine
 (issue 78, p. 22), there
 is a review on free statistical software by Felix
 Grant ...2.)

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] The hidden costs of GPL software?

2004-11-18 Thread Thomas Schnhoff
Tim Cutts schrieb:
Any GUI to R could (and should) be able to store the command line 
equivalent to what it has just done, to satisfy the reproducible 
criterion above, but I suspect it could still lead to some pretty shoddy 
work being done by careless and lazy scientists, and we get enough of 
that already.
In that respect you should have a look at Emacs/XEmacs/ESS package. 
This package combines the power of command line and reproducibility of 
what has been done to generate graphs or whatever you like. Its also 
equipped with a nice ref-card-pdf which is very helpful to learn 
common shortcuts to increase your productivity levels. I wouldn't call 
ESS necessarily a GUI in a traditional sense, though.

When I started using R I was inclined to use the RCommander-GUI. After 
fiddling with this for a while I came to the conclusion that its 
possibilities are, at least for the moment, really limited. 
Furthermore some things increased my irritation levels, i.e. 
orientation to push the correct buttons to achieve a specific task. If 
I hit a false button I hardly wasn't able to find out what actually 
went wrong.

Nevertheless, for me as a beginner in GNU R, who never used S before, 
but primarily SPSS and BMDP in early times, it is a long way to gain 
some control of advanced aspects of using R. This is also true despite 
the fact that I took statistics courses for several years and do have 
experiences in research projects (social sciences and epidemiology), 
so I'll would agree that using GNU R has some hidden costs for me!

To sum up, what I am in need to is an extensive example based 
help-system, focused on how to do things in R. In parts this is 
already there, i.e. SimpleR from Verzani (contributed docs area) etc.

Hopefully I can  contribute to this in future, since it is seems to me 
invaluable to learn R by going through example-based lessons (some are 
found in vignette() ).
These are much more comprehensible to me than those short reference 
like entries in the current help-system, mostly due to their very 
technical approach (same is to be said about the official GNU R 
manuals, especially The R Language, which wasn't a great help for me 
when I took my first look at GNU R). In this context something like 
the GuideMaps of Vista come to my mind!

But to be as clear as possible, I think GNU R is great and I 
appreciate all the efforts done by the R core team and associates!

Nevertheless it seems to be valuable to re-think the help-system in R 
with respect to those who may have a good understanding in statistics, 
but lacking some basic experiences in how to introduce themselves to 
sophisticated world of R/S languages.


Regards
Thomas
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Lexical Scoping: eval(expr,envir=)

2004-11-18 Thread francoisromain
Hello,

I'm quite new to the objet-oriented vision of life in R, but I think you are
looking for

?setClass

or other functions in the methods package.



Selon Eric Lecoutre [EMAIL PROTECTED]:


 Hi R-listers,

 I am trying to better undertand what we would call functional paradigm
 use of S/R to better map my programming activities in other languages.

 This little function is aimed to create an object (at the end end, it would
 have it's own class):

 --
myObject =function(){
  list(
a=1,
foo=function(b)
{
cat(b:,b)
cat(\na:, a)
}
  )
}
 --
 To my minds, a would be a property of the object and foo one of it's
 method.

 Let instantiate one version of this object:

 --
   tmp = myObject()
   tmp
 $a
 [1] 1

 $foo
 function(b)
{
cat(b:,b)
cat(\na:, a)
}
 environment: 012DDFC8
 --

 Now I try to invoke it's foo method (definitively not a S terminology!)
 For sure, tmp$foo() wont work, as it can't know anything about a.

 Reading eval() help page, It is said:

 envir: the 'environment' in which 'expr' is to be evaluated.  May
also be a list, a data frame, or an integer as in 'sys.call' was

 so that I was thinking that

   eval(tmp$foo(),envir=tmp)
 Error in cat(b:, b) : Argument b is missing, with no default

 would solve my problem, which is not the case.
 tmp is a list, in which a is defined hand has a value.

 Where is my fault?



 Eric

 R version 2.0.1, Windows




 Eric Lecoutre
 UCL /  Institut de Statistique
 Voie du Roman Pays, 20
 1348 Louvain-la-Neuve
 Belgium

 tel: (+32)(0)10473050
 [EMAIL PROTECTED]
 http://www.stat.ucl.ac.be/ISpersonnel/lecoutre

 If the statistics are boring, then you've got the wrong numbers. -Edward
 Tufte

 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Lexical Scoping: eval(expr,envir=)

2004-11-18 Thread Dimitris Rizopoulos
Hi Eric,
this my novice point of view (since I'm still learning R) about what 
is happening:

First, `tmp' is not an evironment. Check:
is.environment(tmp)
[1] FALSE
If you'd like to create an environment based on tmp then a simple way 
could be:

e1 - new.env()
for(i in seq(along=tmp)) assign(names(tmp)[[i]], tmp[[i]], envir=e1)
Then, `tmp$foo()' is defined in the enviroment of `myObject()', thus 
you could set its evironment to be e1 using:

environment(tmp$foo) - e1
now
eval(tmp$foo(2), envir=e1)
maybe is what you want.
Of course maybe someone more experienced than me has a better 
solution-explanation but I hope this helps.

Best,
Dimitrs

Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/396887
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat
http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm
- Original Message - 
From: Eric Lecoutre [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, November 18, 2004 12:05 PM
Subject: [R] Lexical Scoping: eval(expr,envir=)


Hi R-listers,
I am trying to better undertand what we would call functional 
paradigm use of S/R to better map my programming activities in 
other languages.

This little function is aimed to create an object (at the end end, 
it would have it's own class):

--
  myObject =function(){
list(
  a=1,
  foo=function(b)
  {
  cat(b:,b)
  cat(\na:, a)
  }
)
  }
--
To my minds, a would be a property of the object and foo one of 
it's method.

Let instantiate one version of this object:
--
 tmp = myObject()
 tmp
$a
[1] 1
$foo
function(b)
  {
  cat(b:,b)
  cat(\na:, a)
  }
environment: 012DDFC8
--
Now I try to invoke it's foo method (definitively not a S 
terminology!)
For sure, tmp$foo() wont work, as it can't know anything about a.

Reading eval() help page, It is said:
envir: the 'environment' in which 'expr' is to be evaluated.  May
  also be a list, a data frame, or an integer as in 
'sys.call' was

so that I was thinking that
 eval(tmp$foo(),envir=tmp)
Error in cat(b:, b) : Argument b is missing, with no default
would solve my problem, which is not the case.
tmp is a list, in which a is defined hand has a value.
Where is my fault?

Eric
R version 2.0.1, Windows

Eric Lecoutre
UCL /  Institut de Statistique
Voie du Roman Pays, 20
1348 Louvain-la-Neuve
Belgium
tel: (+32)(0)10473050
[EMAIL PROTECTED]
http://www.stat.ucl.ac.be/ISpersonnel/lecoutre
If the statistics are boring, then you've got the wrong 
numbers. -Edward Tufte

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Errors checking a library

2004-11-18 Thread michael watson (IAH-C)
Hi

I am writing an R library.  The documentation for one of my functions
includes an example that I *know* works - simply cut and paste into R on
either Windows and Linux and it works perfectly, no errors or warnings,
nothing, nyet.

However, when I run R CMD check on the library, I get an error.  I am
running R CMD check on linux, and the offending piece of code appears to
be:

cox[cox$group %in% onc,]

cox is a data frame, one of the columns of which is group, which
contains numbers.  onc is a vector of numbers.

The output on Linux from R CMD check is this:

 # lots of code
 # lots of code
cox[cox$group
+
+
+ # the rest of my code
Error: syntax error
Execution halted

As can be seen, my code cox[cox$group %in% onc,] seems to have been
executed incorrectly.  Does R CMD check have a problem with the %in%
operator?  It would seem that R has somehow got mixed up and has lost
the rest of my command.

I'm using R 1.9.1 on Suse Linux 8.2.  The example code works fine on
both Windows and Linux when cut-and-pasted into an R window.

Mick

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Lexical Scoping: eval(expr,envir=)

2004-11-18 Thread Eric Lecoutre

Hi again,
In a sense, I have answered myself my question.
The functional paradigm is very well described in the article
lexical scope and Statistical computing by Ross Ihaka and Robert Gentleman.
And I did have read it several times...
Solution is function closure. And following code will work as I want.
Except i dont understand the help page on eval.
What about the ability to pass a list for the value of environment()? Can I 
have an example of such a use?

My (now working) code:
---
 ### First version: function closure

   myObject1 =function(){
+ # Function Closure
+ function(){
+   a=1
+   list(foo=function(b=3)
+   {
+   cat(b:,b)
+   cat(\na:, a)
+   }
+)
+   }
+   }

   (tmp=myObject())
function(){
  a=1
  list(
  foo=function(b=3){
cat(b:,b)
cat(\na:, a)
},
   set.a=function(newval) a -newval
   )
  }
environment: 012B2CAC
   tmp()$foo()
b: 3
a: 1   tmp()$foo(b=32)
b: 32
a: 1
 ### Second version: add a function that allows to change the property a
 myObject2 =function(){
+ function(){
+   a=1
+   return(list(
+   foo=function(b=3){
+ cat(b:,b)
+ cat(\na:, a)
+ },
+set.a=function(newval) a -newval
+))
+   }
+   }

(tmp=myObject2()())
$foo
function(b=3){
cat(b:,b)
cat(\na:, a)
}
environment: 012BBF08
$set.a
function(newval) a -newval
environment: 012BBF08
   tmp$foo(b=32)
b: 32
a: 1   tmp$set.a(10)
   tmp$foo(b=32)
b: 32
a: 10
---
This achieves exactly the object-oriented aspect I wanted to have. And in 
fact myObject()() acts as a new instantiation of my object.

Best wishes,
Eric

At 12:05 18/11/2004, Eric Lecoutre wrote:
Hi R-listers,
I am trying to better undertand what we would call functional paradigm 
use of S/R to better map my programming activities in other languages.

This little function is aimed to create an object (at the end end, it 
would have it's own class):

--
  myObject =function(){
list(
  a=1,
  foo=function(b)
  {
  cat(b:,b)
  cat(\na:, a)
  }
)
  }
--
To my minds, a would be a property of the object and foo one of it's 
method.

Let instantiate one version of this object:
--
 tmp = myObject()
 tmp
$a
[1] 1
$foo
function(b)
  {
  cat(b:,b)
  cat(\na:, a)
  }
environment: 012DDFC8
--
Now I try to invoke it's foo method (definitively not a S terminology!)
For sure, tmp$foo() wont work, as it can't know anything about a.
Reading eval() help page, It is said:
envir: the 'environment' in which 'expr' is to be evaluated.  May
  also be a list, a data frame, or an integer as in 'sys.call' was
so that I was thinking that
 eval(tmp$foo(),envir=tmp)
Error in cat(b:, b) : Argument b is missing, with no default
would solve my problem, which is not the case.
tmp is a list, in which a is defined hand has a value.
Where is my fault?

Eric
R version 2.0.1, Windows

Eric Lecoutre
UCL /  Institut de Statistique
Voie du Roman Pays, 20
1348 Louvain-la-Neuve
Belgium
tel: (+32)(0)10473050
[EMAIL PROTECTED]
http://www.stat.ucl.ac.be/ISpersonnel/lecoutre
If the statistics are boring, then you've got the wrong numbers. -Edward Tufte
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Errors checking a library

2004-11-18 Thread Uwe Ligges
michael watson (IAH-C) wrote:
Hi
I am writing an R library.  The documentation for one of my functions
includes an example that I *know* works - simply cut and paste into R on
either Windows and Linux and it works perfectly, no errors or warnings,
nothing, nyet.
However, when I run R CMD check on the library, I get an error.  I am
running R CMD check on linux, and the offending piece of code appears to
be:
cox[cox$group %in% onc,]
You need to quote %: \%.
Uwe Ligges

cox is a data frame, one of the columns of which is group, which
contains numbers.  onc is a vector of numbers.
The output on Linux from R CMD check is this:

# lots of code
# lots of code
cox[cox$group
+
+
+ # the rest of my code
Error: syntax error
Execution halted
As can be seen, my code cox[cox$group %in% onc,] seems to have been
executed incorrectly.  Does R CMD check have a problem with the %in%
operator?  It would seem that R has somehow got mixed up and has lost
the rest of my command.
I'm using R 1.9.1 on Suse Linux 8.2.  The example code works fine on
both Windows and Linux when cut-and-pasted into an R window.
Mick
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Lexical Scoping: eval(expr,envir=)

2004-11-18 Thread Duncan Murdoch
On Thu, 18 Nov 2004 12:05:34 +0100, Eric Lecoutre
[EMAIL PROTECTED] wrote :


Hi R-listers,

I am trying to better undertand what we would call functional paradigm 
use of S/R to better map my programming activities in other languages.

This little function is aimed to create an object (at the end end, it would 
have it's own class):

--
   myObject =function(){
 list(
   a=1,
   foo=function(b)
   {
   cat(b:,b)
   cat(\na:, a)
   }
 )
   }
--
To my minds, a would be a property of the object and foo one of it's 
method.

To work with lexical scoping, you could do it as

 myObject  - function(){
a - 1 
 list(
   a=function() a,
   a- = function(x, value) a - value,
   foo=function(b)
   {
   cat(b:,b,\n)
   cat(a:, a,\n)
   }
 )
   }

Then you can access the a property pretty easily, but changing it is
really ugly:

 m - myObject()
 m$a()
[1] 1
 m$foo()
Error in cat(b:, b, \n) : Argument b is missing, with no default
 m$foo(1)
b: 1 
a: 1 
 (m$a-)(m, 4)
 m$foo(1)
b: 1 
a: 4 

It would be slightly nicer (but still ugly) if this worked:

 (m$a)(m) - 4
Error: invalid function in complex assignment

but it doesn't.

Duncan Murdoch

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] JGR Tablet PC

2004-11-18 Thread White, Charles E WRAIR-Wash DC
(1) A minor point; the JGR console recognizes when the input panel (think tool 
bar) is docked at the top of the screen and acts appropriately. However, the 
editor opens under the input panel. I can close the input panel, move the 
editor, and open the input panel to continue work. On the other hand, it would 
be real nice if the editor just opened in a more appropriate place.

(2) I am very impressed with JGR as it is and I have completely switched from 
XEmacs to JGR.

Chuck

Charles E. White, Senior Biostatistician, MS
Walter Reed Army Institute of Research
503 Robert Grant Ave., Room 1w102
Silver Spring, MD 20910-1557
301 319-9781
Personal/Professional Site: http://users.starpower.net/cwhite571/professional/

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Errors checking a library

2004-11-18 Thread Roger Bivand
On Thu, 18 Nov 2004, michael watson (IAH-C) wrote:

 Hi
 
 I am writing an R library.  The documentation for one of my functions
 includes an example that I *know* works - simply cut and paste into R on
 either Windows and Linux and it works perfectly, no errors or warnings,
 nothing, nyet.
 
 However, when I run R CMD check on the library, I get an error.  I am
 running R CMD check on linux, and the offending piece of code appears to
 be:
 
 cox[cox$group %in% onc,]
 
 cox is a data frame, one of the columns of which is group, which
 contains numbers.  onc is a vector of numbers.
 
 The output on Linux from R CMD check is this:
 
  # lots of code
  # lots of code
 cox[cox$group
 +
 +
 + # the rest of my code
 Error: syntax error
 Execution halted
 
 As can be seen, my code cox[cox$group %in% onc,] seems to have been
 executed incorrectly.  Does R CMD check have a problem with the %in%
 operator?  It would seem that R has somehow got mixed up and has lost
 the rest of my command.

I'm guessing at what you may mean, so excuse me getting it wrong. If the 
code is in an example in a help file (*.Rd, \examples{} block), then the % 
may be being interpreted as a comment character, and the remainder of the 
line not processed - see Writing R Extensions - Writing R documentation 
files - Insertions.

If that is the problem, then escaping the % by \% should fix it, that it 
what is done in src/library/base/man/match.Rd anyway.

 
 I'm using R 1.9.1 on Suse Linux 8.2.  The example code works fine on
 both Windows and Linux when cut-and-pasted into an R window.
 
 Mick
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Informix database

2004-11-18 Thread Yasser El-Zein
We use Informix database. I was able to connect to the database with
S-PLUS by using its CONNECT/Java through the JDBC driver.
How can I connect to Informix with R, wither using JDBC or any other
method? we run Linux so I prefer a method other than ODBC.

Thankx for the help

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Errors checking a library

2004-11-18 Thread Peter Dalgaard
michael watson (IAH-C) [EMAIL PROTECTED] writes:

 I am writing an R library.  

A whole library? Shouldn't you try a package first?

 The documentation for one of my functions
 includes an example that I *know* works - simply cut and paste into R on
 either Windows and Linux and it works perfectly, no errors or warnings,
 nothing, nyet.
 
 However, when I run R CMD check on the library, I get an error.  I am
 running R CMD check on linux, and the offending piece of code appears to
 be:
 
 cox[cox$group %in% onc,]
 
 cox is a data frame, one of the columns of which is group, which
 contains numbers.  onc is a vector of numbers.
 
 The output on Linux from R CMD check is this:
 
  # lots of code
  # lots of code
 cox[cox$group
 +
 +
 + # the rest of my code
 Error: syntax error
 Execution halted
 
 As can be seen, my code cox[cox$group %in% onc,] seems to have been
 executed incorrectly.  Does R CMD check have a problem with the %in%
 operator?  It would seem that R has somehow got mixed up and has lost
 the rest of my command.

Think: What is the comment character in .Rd files?

Checking out src/library/base/man/match.Rd should be enlightening, but
since you might not have R sources installed, here are the relevant
bits:

\name{match}
\alias{match}
\alias{\%in\%}
\title{Value Matching}
\description{
  \code{match} returns a vector of the positions of (first) matches of
  its first argument in its second.

  \code{\%in\%} is a more intuitive interface as a binary operator,
  which returns a logical vector indicating if there is a match or not
  for its left operand.
}
\usage{
match(x, table, nomatch = NA, incomparables = FALSE)

x \%in\% table
}

\examples{
## The intersection of two sets :
intersect - function(x, y) y[match(x, y, nomatch = 0)]
intersect(1:10,7:20)

1:10 \%in\% c(1,3,5,9)
sstr - c(c,ab,B,bba,c,@,bla,a,Ba,\%)
sstr[sstr \%in\% c(letters,LETTERS)]

\%w/o\% - function(x,y) x[!x \%in\% y] #--  x without y
(1:10) \%w/o\% c(3,7,12)
}
\keyword{manip}
 

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] how to rewrite this without a loop ?

2004-11-18 Thread Stijn Lievens
Dear Rexperts,
First of all let me say that R is a wonderful and useful piece of 
software.

The only thing is that sometimes it takes me a long time to find out how 
something can be done, especially when aiming to write compact (and 
efficient) code.

For instance, I have the following function (very rudimentary) which 
takes a (very specific) data frame as input and for certain subsets
calculates the rank correlation between two corresponding columns.
The aim is to add all the rank correlations.

code
add.fun - function(perf.data) {
   ss - 0
   for (i in 0:29) {
   	ss - ss + cor(subset(perf.data, dataset == i)[3], 
subset(perf.data, dataset == i)[7], method = kendall)
   }
   ss	
}
/code

As one can see this function uses a for-loop.  Now chapter 9 of 'An 
introduction to R' tells us that we should avoid for-loops as much as 
possible.

Is there an obvious way to avoid this for-loop is this case ?
I would like to see something in the lines of
(maple style)
code
add( seq(FUN(i), i = 0..29) )
/code
Greetings
Stijn.
--
==
Dept. of Applied Mathematics and Computer Science, University of Ghent
Krijgslaan 281 - S9, B - 9000 Ghent, Belgium
Phone: +32-9-264.48.91, Fax: +32-9-264.49.95
E-mail: [EMAIL PROTECTED], URL: http://allserv.ugent.be/~slievens/
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Re: Informix database

2004-11-18 Thread Vito Ricci
Hi,

see DBI: R/S-Plus Database Interface, maybe it could
help you: 

http://stat.bell-labs.com/RS-DBI
http://www.ci.tuwien.ac.at/Conferences/DSC-2001/Proceedings/HothornJamesRipley.pdf

I found:

Other Database Connections from S-Plus

Depending on the platform it's running, S-Plus
provides access to some DBMS through the
importData/exportData functions. Under Microsoft
Windows you may import/export data through ODBC; under
Solaris (and only Solaris) you may import data from
Informix, Oracle, and Sybase. See also the function
executeSQL.  

Best regards
Vito

You wrote:
We use Informix database. I was able to connect to the
database with
S-PLUS by using its CONNECT/Java through the JDBC
driver.
How can I connect to Informix with R, wither using
JDBC or any other
method? we run Linux so I prefer a method other than
ODBC.

Thankx for the help

=
Diventare costruttori di soluzioni
Became solutions' constructors

The business of the statistician is to catalyze 
the scientific learning process.  
George E. P. Box


Visitate il portale http://www.modugno.it/
e in particolare la sezione su Palese  http://www.modugno.it/archivio/palese/

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Lexical Scoping: eval(expr,envir=)

2004-11-18 Thread Gabor Grothendieck
Eric Lecoutre lecoutre at stat.ucl.ac.be writes:

: 
: Hi R-listers,
: 
: I am trying to better undertand what we would call functional paradigm 
: use of S/R to better map my programming activities in other languages.
: 
: This little function is aimed to create an object (at the end end, it would 
: have it's own class):
: 
: --
:myObject =function(){
:  list(
:a=1,
:foo=function(b)
:{
:cat(b:,b)
:cat(\na:, a)
:}
:  )
:}
: --
: To my minds, a would be a property of the object and foo one of it's 
: method.
: 
: Let instantiate one version of this object:
: 
: --
:   tmp = myObject()
:   tmp
: $a
: [1] 1
: 
: $foo
: function(b)
:{
:cat(b:,b)
:cat(\na:, a)
:}
: environment: 012DDFC8
: --
: 
: Now I try to invoke it's foo method (definitively not a S terminology!)
: For sure, tmp$foo() wont work, as it can't know anything about a.
: 
: Reading eval() help page, It is said:
: 
: envir: the 'environment' in which 'expr' is to be evaluated.  May
:also be a list, a data frame, or an integer as in 'sys.call' was
: 
: so that I was thinking that
: 
:   eval(tmp$foo(),envir=tmp)
: Error in cat(b:, b) : Argument b is missing, with no default
: 
: would solve my problem, which is not the case.
: tmp is a list, in which a is defined hand has a value.
: 
: Where is my fault?
: 
: Eric
: 
: R version 2.0.1, Windows

An example of lexical scoping lose to yours
is found by issuing the R command:

   demo(scoping) 

However, you probably want to use the builtin
facilities, namely the S3 or S4 object oriented
system or possibly the more conventional oo system
defined in the R.oo package of the R.classes bundle
found at:
   http://www.maths.lth.se/help/R/R.classes/

In S3 your problem is done like this:

   # use S3 to define 2 objects of class myObject and a method

   tmp - list(a=1); class(tmp) - myObject
   tmp2 - list(a=2); class(tmp2) - myObject

   foo - function(obj, b) UseMethod(foo)
   foo.myObject - function(obj, b) cat(b, b, \a, obj$a, \n)

   # try out the method
   foo(tmp, 3)
   foo(tmp2, 5)

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Re: Informix database

2004-11-18 Thread Yasser El-Zein
There is no DBI implementation for Informix. I would appreciate some
pointers to R's Java extension, if exists.
I already have a solution for S-PLUS. I am interested in finding one
for R to compare the two, otherwise my company will go with S-PLUS.


On Thu, 18 Nov 2004 15:45:25 +0100 (CET), Vito Ricci
[EMAIL PROTECTED] wrote:
 Hi,
 
 see DBI: R/S-Plus Database Interface, maybe it could
 help you:
 
 http://stat.bell-labs.com/RS-DBI
 http://www.ci.tuwien.ac.at/Conferences/DSC-2001/Proceedings/HothornJamesRipley.pdf
 
 I found:
 
 Other Database Connections from S-Plus
 
 Depending on the platform it's running, S-Plus
 provides access to some DBMS through the
 importData/exportData functions. Under Microsoft
 Windows you may import/export data through ODBC; under
 Solaris (and only Solaris) you may import data from
 Informix, Oracle, and Sybase. See also the function
 executeSQL.
 
 Best regards
 Vito
 
 
 
 You wrote:
 We use Informix database. I was able to connect to the
 database with
 S-PLUS by using its CONNECT/Java through the JDBC
 driver.
 How can I connect to Informix with R, wither using
 JDBC or any other
 method? we run Linux so I prefer a method other than
 ODBC.
 
 Thankx for the help
 
 =
 Diventare costruttori di soluzioni
 Became solutions' constructors
 
 The business of the statistician is to catalyze
 the scientific learning process.
 George E. P. Box
 
 Visitate il portale http://www.modugno.it/
 e in particolare la sezione su Palese  http://www.modugno.it/archivio/palese/
 
 
 ___
 Nuovo Yahoo! Messenger: E' molto pi divertente: Audibles, Avatar, Webcam, 
 Giochi, Rubrica Scaricalo ora!
 http://it.messenger.yahoo.it


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] The hidden costs of GPL software?

2004-11-18 Thread Mike Prager
At 11/18/2004 07:01 AM Thursday, Thomas Schönhoff wrote:
To sum up, what I am in need to is an extensive example based help-system, 
focused on how to do things in R. In parts this is already there, i.e. 
SimpleR from Verzani (contributed docs area) etc.

Hopefully I can  contribute to this in future, since it is seems to me 
invaluable to learn R by going through example-based lessons (some are 
found in vignette() ).
These are much more comprehensible to me than those short reference like 
entries in the current help-system, mostly due to their very technical 
approach (same is to be said about the official GNU R manuals, especially 
The R Language, which wasn't a great help for me when I took my first 
look at GNU R). In this context something like the GuideMaps of Vista come 
to my mind!

But to be as clear as possible, I think GNU R is great and I appreciate 
all the efforts done by the R core team and associates!

Nevertheless it seems to be valuable to re-think the help-system in R with 
respect to those who may have a good understanding in statistics, but 
lacking some basic experiences in how to introduce themselves to 
sophisticated world of R/S languages.
(I posted similar material before, but it was moved to R-devel, and I 
wanted to express a bit of it here.)

I have frequently felt, like Thomas, that what could make R easier to use 
is not a GUI, but a help system more focused on tasks and examples, rather 
than on functions and packages.  This has obvious and large costs of 
development, and I am unlikely to contribute much myself, for reasons of 
time and ability.  Yet, I mention it for the sake of this discussion.

Such a help system could be a tree (or key) structure in which through 
making choices, the user's description of the desired task is gradually 
narrowed.  At the end of each twig of the tree would be a list of suggested 
functions for solving the problem, hyperlinked into the existing help 
system (which in many ways is outstanding and has evolved just as fast as R 
itself).  This could be coupled with the continued expansion of the number 
of examples in the help system.

Now I must express appreciation for what exists already that helps in this 
regard:  MASS (in its many editions), Introductory Statistics with R, 
Simple R, and the other free documentation that so many authors have 
generously provided.  Not to mention the superlative contribution of R 
itself, and the work of the R development team.  It is beyond my 
understanding how something so valuable and well thought out has been 
created by people with so many other responsibilities.

Mike
--
Michael Prager, Ph.D.
Population Dynamics Team, NMFS SE Fisheries Science Center
NOAA Center for Coastal Fisheries and Habitat Research
Beaufort, North Carolina  28516
http://shrimp.ccfhrb.noaa.gov/~mprager/
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Chinese character

2004-11-18 Thread Prof Brian Ripley
On Thu, 18 Nov 2004, john zhao wrote:
Hello R-help team,
I am a R user in China.  I just downloaded the latest R which is R2001 for
Windows. This new version can not store Chinese character which the previous
version R 1.9.1 does.  Specifically when I enter
The previous version was 2.0.0.
x-²âÊÔ
then type x, I got
x
[1] \262\342\312\324 .
That is because your locale is saying those are non-printable characters. 
It's an OS issue, not an R issue (and has been discussed before for R 
2.0.0).

--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] Where has the Debian respository gone?

2004-11-18 Thread Dirk Eddelbuettel
On Thu, Nov 18, 2004 at 08:52:38AM +, stats wrote:
 Hello Dirk,
 
 Monday, November 15, 2004, 1:35:27 AM, you wrote:
 
 DE On Sun, Nov 14, 2004 at 10:53:42PM +0100, Christoph Bier wrote:
  Hi all!
  
  Did I miss something or is it just a temporary problem? Where has
  the Debian respository
  
  http://cran.r-project.org woody/main Packages
  resp.
  http://cran.r-project.org/bin/linux/debian/
  
  gone? I tried it for about the last 7 hours.
 
 DE Current R and CRAN packages are on the Debian archives; you can install
 DE these on testing too.  To the best of my knowledge, there are no backports
 DE of current R and Debian CRAN packages to Debian stable. 
 
 I'm a bit puzzled.  I had
 deb http://cran.r-project.org/bin/linux/debian woody main
 in /etc/apt/sources.list and had hoped, perhaps rather unwisely, that
 this would look after the transition from 1.8.0 on my internet server (Debian
 stable) where it serves up some cgi-bin work.  (Most of my R work is
 on a Win2k machine, much though I'd like to go Debian all the way,
 that isn't possible for my main job in near future.)
 
 Is there an easy way of upgrading R on a Debian stable machine?  I
 don't want to move off stable as the security side of that server is
 too important.  I also don't really want to compile it myself if I can
 avoid that, the server is pretty old iron and that might back up all
 the Email stuff it does.
 
 Advice anyone?

More than advice, we need a volunteer to backport the current R package(s)
for Debian to the Debian stable distribution. As I said, testing and
unstable are taken care of (and yes, testing is still lagging because of the
now much more formal interdependence of packages; R 2.0.* will appears once
all dependent packages are available on all architectures)

Dirk

-- 
If your hair is standing up, then you are in extreme danger.
  -- http://www.usafa.af.mil/dfp/cockpit-phys/fp1ex3.htm

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Informix database

2004-11-18 Thread Prof Brian Ripley
On Thu, 18 Nov 2004, Yasser El-Zein wrote:
We use Informix database. I was able to connect to the database with
S-PLUS by using its CONNECT/Java through the JDBC driver.
How can I connect to Informix with R, wither using JDBC or any other
method? we run Linux so I prefer a method other than ODBC.
ODBC runs perfectly well under Linux.  There is an Informix driver, see
http://www.unixodbc.org/doc/informix.html
R does not have a JDBC driver, and trying to use one under RSJava is 
likely to be *far* more work that using ODBC.

Vito Ricci mentioned DBI, but I am unaware of any Informix backend for 
DBI, which is not of itself a DBMS interface, more a meta-driver (as ODBC 
is).

--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R-gui] Re: [R] The hidden costs of GPL software?

2004-11-18 Thread Philippe Grosjean
Hello,

I appreciate many comments and the various points of view, especially
because there are a couple of clear explanations why several people do not
need (or even do not want) a GUI for R!

Another part of the discussion seems to switch to the never-ending question
of what kind of GUI... which will never be answered, because there is not
one best GUI, and it also depends on the use (both the application and the
user). It's a long time I hesitate to propose in R-SIG-GUI + the R GUI
projects web site to place a description for one or several prototype
GUI(s) we would like for R, with the intention to include all the good ideas
everybody has in this list.

I never did that, because I am pretty sure it is useless! Now, I feel that
one guy, with a clear view of what he wants, a lot of free time, a lot of
energy, and some decent skills in programming, is actually required to make
real what he has in his head! Indeed, it is such a huge work that several
people are required! Here are the topics currently developed (sorry if I
don't cite Bioconductor stuff: I don't know it):

- Most of the low-level work is done, I think, like interface with
graphical toolkits: tcltk by Peter Dalgaard, of course, but many others
(Gtk, wxPython, ...), a better control of Rgui under Windows (ongoing,
Duncan Murdoch), ESS, ... All this is already available, even if one could
always argue that it is not optimal in some respects.

- A better console (multiple-lines editing, syntax coloring, code tip
presenting the syntax of a function when you type it, contextual completion
list, ...). This is ongoing project in both JGR and SciViews-R.

- A better table editor: RKward team.

- A classical menus/dialog box approach: John Fox's R commander,

- An object explorer: JGR, RKward, SciViews-R, experimental functions in R,

- A plug-in approach, that is, a piece of code that brings a GUI for a
targeted analysis and builds R code for you: RKward team, but also some
functions in svDialogs (part of the SciViews bundle, R GUI API),

- Interactive documents mixing formatted text, graphs, etc... with R
input/output: Rpad, Sweave (not interactive), and some other,

- Rich-formatted output of R objects (in/out, views, reporting,...): Eric
Lecoutre's R2HTML + SciViews-R,

- Code editor with interaction with R: Tinn-R, WinEdt, Emacs, and many
others, 

- IDE (humm, some code editors are not so far away from an IDE, but there is
still some lack here),

- A R GUI API: SciViews.

I hope all these projects will continue, will mature, and their developers
will ultimately realize that they provide complementary pieces of a giant
puzzle and start to work together. This is when it will become most
exciting! I hope also that it will result in an original GUI that keeps most
of the spirit of R, that is, not a simplified pointclick UI, leading to
meaningless analyses by lazy people, but a real tool whose goal is to make R
easier and faster to learn for beginner, and pretty usable for occasional
users.

May be, I am just a dreamer, but all I read in this discussion reinforce my
conviction that an **innovative** GUI would be a good addition to R: most
criticisms clearly relate to the kind of inflexible GUI, with a forest of
menus and submenus, and other bad things one could find. I never, and will
never advocate for such a GUI!

For sure, the alternate GUI will only support you in writing R code, and
will deliver plenty of help to achieve this goal. I think it is possible...
with enough people collaborating in a common project! I think the later
point is really the problem: not enough people, too many projects! Is it a
consequence of the way R is developed (GPL)? Well, I think so, but only
partly. It is also the consequence of ego (everybody wants to be the leader
of his own project), and a lack of communication (R-SIG-GUI is not what one
would call an active list!) Or, may be, a good GUI for R is a fuzzy target
and it is not possible to cristallize enough power around a common goal: to
reach it!

Anyway, despite R GUI projects are progressing very slowly, I think only
when we would have a good GUI available for R, we would be able to
evaluate if there are really hidden costs in R, as Felix Grant suggests in
his paper.

Best regards and thank you all for your comments and suggestions.

Philippe Grosjean

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Informix database

2004-11-18 Thread Yasser El-Zein
The Informix linux ODBC driver is not free, isn't it?
Shoudl I be worried of ODBC performance on linux? 


On Thu, 18 Nov 2004 15:22:56 + (GMT), Prof Brian Ripley
[EMAIL PROTECTED] wrote:
 On Thu, 18 Nov 2004, Yasser El-Zein wrote:
 
 
 
  We use Informix database. I was able to connect to the database with
  S-PLUS by using its CONNECT/Java through the JDBC driver.
  How can I connect to Informix with R, wither using JDBC or any other
  method? we run Linux so I prefer a method other than ODBC.
 
 ODBC runs perfectly well under Linux.  There is an Informix driver, see
 
 http://www.unixodbc.org/doc/informix.html
 
 R does not have a JDBC driver, and trying to use one under RSJava is
 likely to be *far* more work that using ODBC.
 
 Vito Ricci mentioned DBI, but I am unaware of any Informix backend for
 DBI, which is not of itself a DBMS interface, more a meta-driver (as ODBC
 is).
 
 --
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] how to rewrite this without a loop ?

2004-11-18 Thread Stijn Lievens
Stijn Lievens wrote:
Dear Rexperts,
First of all let me say that R is a wonderful and useful piece of software.
The only thing is that sometimes it takes me a long time to find out how 
something can be done, especially when aiming to write compact (and 
efficient) code.

For instance, I have the following function (very rudimentary) which 
takes a (very specific) data frame as input and for certain subsets
calculates the rank correlation between two corresponding columns.
The aim is to add all the rank correlations.

code
add.fun - function(perf.data) {
   ss - 0
   for (i in 0:29) {
   ss - ss + cor(subset(perf.data, dataset == i)[3], 
subset(perf.data, dataset == i)[7], method = kendall)
   }
   ss   
}
/code

As one can see this function uses a for-loop.  Now chapter 9 of 'An 
introduction to R' tells us that we should avoid for-loops as much as 
possible.

Is there an obvious way to avoid this for-loop is this case ?
Using the lapply function in the e-mail of James, I came up with the 
following.

code
 sum (as.numeric( lapply( split(perf.data, perf.data$dataset), 
function(x) cor(x[3],x[7],method=kendall) ) ))
/code

So, first I split the dataframe into a list of dataframes using split,
and using lapply I get a list of correlations, which I convert to
numeric and finally sum up.
I definitely avoided the for-loop in this way, although I am not sure 
whether this is more efficient or not.

Cheers,
Stijn.

I would like to see something in the lines of
(maple style)
code
add( seq(FUN(i), i = 0..29) )
/code
Greetings
Stijn.


--
==
Dept. of Applied Mathematics and Computer Science, University of Ghent
Krijgslaan 281 - S9, B - 9000 Ghent, Belgium
Phone: +32-9-264.48.91, Fax: +32-9-264.49.95
E-mail: [EMAIL PROTECTED], URL: http://allserv.ugent.be/~slievens/
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R-gui] RE: [R] The hidden costs of GPL software?

2004-11-18 Thread Thomas Lumley
On Thu, 18 Nov 2004, Philippe Grosjean wrote:
John W. Eaton wrote:
On 17-Nov-2004, Philippe Grosjean [EMAIL PROTECTED] wrote:
| - There is no possibility to make a commercial GUI for R (thanks to
| the GPL),
This is false.  Please don't confuse commercial (Red Hat
and SuSE GNU/Linux distributions are commercial software)
with proprietary.
jwe
Ooops! Sorry, and thank you for correcting me. I mean proprietary, of
course.
Best,
And it isn't obvious that it is true even if you mean proprietary. A GUI 
that ran R just by sending commands to stdin and getting results from 
stdout could clearly be proprietary without violating the GPL.  The 
question of exactly what level of closer integration is allowed would get 
complicated and I won't speculate.

-thomas
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] The hidden costs of GPL software?

2004-11-18 Thread Marc Schwartz
On Thu, 2004-11-18 at 03:24 -0800, Michael Grant wrote:
 H, interesting thread and minds will not be
 changed but regarding GUIs...I thought S (aka R) was a
 PROGRAMMING LANGUAGE with a statistical and numerical
 slant, and not a statistics application. ;O)  

From the R web site:

R is a language and environment for statistical computing and
graphics.


I think that this is a critical point and that there is, to my mind, a
false predicate at play here.

That predicate is that somehow one should be able to rapidly learn R (or
any programming language for that matter) solely via the available
online reference help or via the freely provided documentation (whether
via R Core or via Contributors).

How many people here have learned to use C, FORTRAN, SAS, VBA, Perl or
any other language strictly by using built-in reference help systems. If
any, it will be a very small proportion.

Sure, SAS comes with documentation that can be measured in hernia
inducing tonnage, but at a substantial annual cost, which I have
referenced here and elsewhere previously. R is free.

Is there anyone who has learned to code in C that does not have a copy
of KR someplace on their shelf, probably along with copies of other
both general and application specific C references published by
Prentice-Hall, Addison-Wesley, McGraw-Hill or Hayden?

It has been years since I actively coded in C, but I have almost 3
shelves filled with C reference books. I have books dating back to the
early 80's for 80x86 Assembly, MS-DOS/BIOS interrupts and Windows API
technical references and other such books that I used to use on a daily
basis in a former life.

For Linux, I have two shelves filled with various O'Reilly and other
references running the gambit from general Linux stuff to Perl,
Procmail, Postfix, Bash, Regex, Emacs, Admin, Firewalls and others.

For R, I have most of a shelf filled with multiple references, including
three of the four editions of MASS (somehow I missed the 2nd edition). I
have a copy of Peter's ISwR (because on occasion I have an acute attack
of cerebral flatulence and have to go back to basics) along with copies
of Pinheiro  Bates, Fox, Maindonald  Braun, Krause  Olson, Everitt 
Rabe-Hesketh and VR's S Programming. I have copies of the White Book
and the Green Book and I have copies of Harrell and Therneau 
Grambsch for specific applications of R.

There are a fair number of already published books on R/S with more
coming by Faraway, Heiberger  Holland, Verzani and others including a
new series from Springer.

My point being that the old philosophy of No Pain, No Gain is a
component of the learning curve with R. R is not going to be for
everybody. That's why there are other point and click statistical
_applications_ like JMP (albeit not cheap). They are relatively easy,
but at the same time, they are self-limiting. No single math/statistical
product is going to meet the needs of the entire spectrum of the
potential user space.

As I have mentioned previously, I am a firm believer in Pareto's 80/20
Rule. In this case, you develop a product to meet the needs of 80% of
your target user space, because you will go bankrupt meeting the needs
of the other 20%. Said differently, meeting the needs of the other 20%
will consume 80% of your development resources, restricting your ability
to meet the needs of the larger audience.

Having spent 12 years previously with a commercial medical software
company, I will also suggest that typically 20% of your user base will
consume 80% of your support resources.

I will also note that having been on both sides of that equation, the
support provided here within this community is superb and has no peer in
the commercial arena.

In R's case, the 80% of the user space has perhaps been extended by the
kind offerings of those who have made specialty packages available via
CRAN, BioC and others.

It takes a certain level of commitment and time with R to become
effective with it.

That commitment includes, in my mind, supplementing the available _free_
documentation that has kindly been provided by R Core and others, with
other available resources. That does not mean that everyone needs to get
on Amazon.com and spend hundreds of $YOUR_MONETARY_UNIT on books. Many
are available via libraries and/or other resources, especially for those
here in academic environments.

This is a community effort folks and not everything is going to be
provided to you free of charge, with that notion being either in actual
financial cost or time.

It appears that, since this is not the first time this subject has come
up, there is strong interest in building a c(new, different,
better, ...) documentation/help system for R. That's fine. For those
that have interest in pursuing this, perhaps the time has come for a
group to form a new r-sig-doc list and move forward with the development
of a framework for a new system that can be developed and implemented by
that same group and then provided back to the community. 


Re: [R] Re: Informix database

2004-11-18 Thread David Whiting
Yasser El-Zein [EMAIL PROTECTED] writes:

 There is no DBI implementation for Informix. I would appreciate some
 pointers to R's Java extension, if exists.
 I already have a solution for S-PLUS. I am interested in finding one
 for R to compare the two, otherwise my company will go with S-PLUS.

unixODBC works fine for me using MySQL with R and there appears to be
an Informix driver that works:

The driver from informix works fine, but you need to have a look at
the doc in the manuals section of the this site

http://www.unixodbc.org/drivers.html

I haven't tried it, but it looks in principle like you should be able
to access the Informix database from R via unixODBC.

Dave

-- 
David Whiting
University of Newcastle upon Tyne, UK

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] how to rewrite this without a loop ?

2004-11-18 Thread Thomas Lumley
On Thu, 18 Nov 2004, Stijn Lievens wrote:
code
add.fun - function(perf.data) {
  ss - 0
  for (i in 0:29) {
  	ss - ss + cor(subset(perf.data, dataset == i)[3], subset(perf.data, 
dataset == i)[7], method = kendall)
  }
  ss	}
/code

As one can see this function uses a for-loop.  Now chapter 9 of 'An 
introduction to R' tells us that we should avoid for-loops as much as 
possible.

You don't say whether `dataset' is the name of a column in `perf.data'. 
Assuming it is, and assuming that 0:29 are all the values of `dataset'

sum(by(perf.data, list(perf.data$dataset),
  function(d)  cor(d[,3],d[,7], method=kendall)))
would work.  If this is faster it will be because you don't call subset() 
twice per iteration, rather than because you are avoiding a loop.  However 
it has other benefits: it doesn't have the variable `i', it doesn't have 
to change the value of `ss', and it doesn't have the range of `dataset' 
hard-coded into it.  These are all clarity optimisations.

-thomas
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] hashing using named lists

2004-11-18 Thread ulas karaoz
hi all,
I am trying to use named list to hash a bunch of vector by name, for 
instance:
test = list()
test$name = c(1,2,3)

the problem is that when i try to get the values back by using the 
name, the matching isn't done in an exact way, so
test$na is not NULL.

is there a way around this?
Why by default all.equal.list doesnt require an exact match?
How can I do hashing in R?
thanks.
ulas.
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Re: The hidden costs of GPL software?

2004-11-18 Thread Tiago R Magalhaes
My background:
I am a biologist coming to R via Bioconductor. I have no computer 
background in computer sciences and only basic undergraduate training 
level in statistics.

I have used R with great pleasure and great pains. The most difficult 
thing is to know what functions to use - sometimes I know that one 
function is most likely available, but there's really no easy way to 
get it (yes, even going to the archives and reading the help files). 
I feel that more examples in the help files would definitely be a 
good way to fully understand the potencial of the functions. I know 
how difficult this is to do and how much of a time sink it must be.

One thing I defeinitely think would be a great improvement is to have 
a beefed up Object Explorer as Splus does. I think it's the great 
advantage of Splus when compared to R is to have much easier access 
to what type of object, col names, classes and so on there are. And 
how much easier it is to change all these attributes in Splus. I 
think R 2.0 in Mac did a lot to improve this, but I think that for 
someone that very frequently needs to know whether the object created 
turned out to be a vector or a list, the easy access to objects is 
very, very, very important and would be a great improvement in the 
ease of use of R.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] The hidden costs of GPL software?

2004-11-18 Thread David Forrest
On Wed, 17 Nov 2004, Mike Prager wrote:

...
 Using CLI software, an infrequent user has trouble remembering the known
 functions needed and trouble finding new ones (especially as that user gets
 older).  What might help is an added help facility more oriented towards
 tasks, rather than structured around functions or packages.
...

Another good (non-GUI) tool for the CLI is keyword completion.  R in ESS
does this, giving you lists of possible functions, variables and objects,
or feedback if there isn't any.  R's CLI completes, but only with
filenames in the current directory.

Dave
-- 
 Dave Forrest
 [EMAIL PROTECTED](804)684-7900w
 [EMAIL PROTECTED] (804)642-0662h
   http://maplepark.com/~drf5n/

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] The hidden costs of GPL software?

2004-11-18 Thread Ted Harding
On 17-Nov-04 Patrick Burns wrote:
 [...]
 Perhaps an overly harsh summary of some of Ted Harding's
 statements is: You can make a truck easier to get into
 by taking off the wheels, but that doesn't make it more useful.

Yes, perhaps overly harsh ... but if you had said instead
by deflating the tyres then I think I'd agree that you were spot on!

Otherwise I agree with your other comments.

All best wishes,
Ted.



E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861  [NB: New number!]
Date: 18-Nov-04   Time: 16:57:20
-- XFMail --

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] hashing using named lists

2004-11-18 Thread Roger D. Peng
You could try using environments:
 e - new.env(hash = TRUE)
 e$new - 1:4
 ls(e)
[1] new
 e$new
[1] 1 2 3 4
 e$ne
NULL
-roger
ulas karaoz wrote:
hi all,
I am trying to use named list to hash a bunch of vector by name, for 
instance:
test = list()
test$name = c(1,2,3)

the problem is that when i try to get the values back by using the name, 
the matching isn't done in an exact way, so
test$na is not NULL.

is there a way around this?
Why by default all.equal.list doesnt require an exact match?
How can I do hashing in R?
thanks.
ulas.
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

--
Roger D. Peng
http://www.biostat.jhsph.edu/~rpeng/
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] hashing using named lists

2004-11-18 Thread Prof Brian Ripley
On Thu, 18 Nov 2004, ulas karaoz wrote:
hi all,
I am trying to use named list to hash a bunch of vector by name, for 
instance:
test = list()
test$name = c(1,2,3)

the problem is that when i try to get the values back by using the name, the 
matching isn't done in an exact way, so
test$na is not NULL.

is there a way around this?
?match on the names
Why by default all.equal.list doesnt require an exact match?
What do you mean by that?  It (by default or not) tests all the 
attributes, including the names:

test - list(name=1:3)
test2 - list(na=1:3)
all.equal(test, test2)
[1] Names: 1 string mismatches
Now, all.equal does not require an exact match, deliberately: that is what 
identical() is for:

identical(test, test2)
[1] FALSE
How can I do hashing in R?
?match
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Re: The hidden costs of GPL software?

2004-11-18 Thread Arne.Muller
[...]
 I am a biologist coming to R via Bioconductor. I have no computer 
 background in computer sciences and only basic undergraduate training 
 level in statistics.
 
 I have used R with great pleasure and great pains. The most difficult 
 thing is to know what functions to use - sometimes I know that one 
 function is most likely available, but there's really no easy way to 
 get it (yes, even going to the archives and reading the help files). 
 I feel that more examples in the help files would definitely be a 
 good way to fully understand the potencial of the functions. I know 
 how difficult this is to do and how much of a time sink it must be.

Yes, I' often have the same problem when it comes to programming in R (data 
manipulation, formatting etc ...). When thinking about a solution, I often come 
up with something slow and complicated. A positng to this list usually reveals 
a very simple solution thanks to a function that I didn't find when exploring 
help, help.search and the archives (and thanks to those who give me the hint 
;-). However, I don't know how to improve this, i.e. how to implement a more 
sophisticated help.search. Maybe the keywords in the help files or some kind of 
free text mining would help - well, maybe this is a bit over the top.

On the other hand, when it comes to the statistics (I'm a not a statistician) 
and it's minimal formatting of data etc , I think that developing an 
understanding of the stats itself is the main probelm and a GUI doesn't help 
very much in for this. Once the basic understanding is there (which one needs 
anyway, even with a GUI), the rest is not too difficult. In addition I usually 
need to script the calculations for many different datasets, and again most 
GUIs are bad in repeating tasks systematically.

I've spent quite some time with learing R (and I haven't stoped yet ;-), but 
it's devinitely worth it. As a scientists I appreciate it, and since it is a 
tool that use often, I would not exchange the command-line for any GUI.

This list and the many books and manuals (mentioned in the other postings here) 
do a pretty good job in teaching R!

kind regards,

Arne

[...]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] hashing using named lists

2004-11-18 Thread Barry Rowlingson
ulas karaoz wrote:
is there a way around this?
 yes...
Why by default all.equal.list doesnt require an exact match?
 because we're lazy? :)
How can I do hashing in R?
 you can explicitly test the names for equality, eg with this 2-element 
list:

  x
 $name
 [1] 1 2 3
 $n
 [1] 3 2 1
 You can do:
  x[names(x)=='name']
 $name
 [1] 1 2 3
  x[names(x)=='na']
 list()
  x[names(x)=='n']
 $n
 [1] 3 2 1
 Of course, the right way would be to create a new class, 'hash' 
perhaps, that did all this in its '$' or '[' methods.

Baz
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R/S-related projects on Sourceforge? Trove Categorization - GDAL

2004-11-18 Thread Martin Maechler
 Dirk == Dirk Eddelbuettel [EMAIL PROTECTED]
 on Wed, 17 Nov 2004 12:25:16 -0600 writes:

Dirk On Wed, Nov 17, 2004 at 11:52:57AM -0500,
Dirk [EMAIL PROTECTED] wrote:
 Gretl, RPad and RMetrics, plus Ernesto's FLR and fsap
 make five.

Dirk Isn't RMetrics at rmetrics.org at the ETH in Zuerich, CH?

that's definitely correct.
There might have been oral plans to change the development
process, but I'm not even sure about that.

Martin Maechler (at ETH, but not connected to Rmetrics in any ways).

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] hashing using named lists

2004-11-18 Thread Tony Plate
Use match() for exact matching,
i.e.,
 test[[match(name, names(test))]]
Yes, it is more cumbersome.  This partial matching is considered by some to 
be a design fault, but changing it would break too many programs that 
depend upon it.

I don't understand your question about all.equal.list() -- it does seem to 
require exact matches on names, e.g.:

 all.equal(list(a=1:3), list(aa=1:3))
[1] Names: 1 string mismatches
 all.equal(list(aa=1:3), list(a=1:3))
[1] Names: 1 string mismatches

(the above run in R 2.0.0)
-- Tony Plate
(BTW, in R this operation is generally called indexing or subscripting 
or extraction, but not hashing.  Hashing is a specific technique for 
managing and looking up indices, which is why some other programming 
languages refer to list-like objects that are indexed by character strings 
as hashes.  I don't think hashing is used for list names in R, but 
someone please correct me if I'm wrong! )

At Thursday 09:29 AM 11/18/2004, ulas karaoz wrote:
hi all,
I am trying to use named list to hash a bunch of vector by name, for instance:
test = list()
test$name = c(1,2,3)
the problem is that when i try to get the values back by using the name, 
the matching isn't done in an exact way, so
test$na is not NULL.

is there a way around this?
Why by default all.equal.list doesnt require an exact match?
How can I do hashing in R?
thanks.
ulas.
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] hashing using named lists

2004-11-18 Thread Huntsinger, Reid
It seems that that behavior is hard-coded in the subscript code, 
but I bet you could fix it easily by changing the call to get1index

 offset = get1index(CAR(subs), getAttrib(x, R_NamesSymbol),
   length(x), /*partial ok*/TRUE, i);

in src/main/subset.c (line 762 I think, R-2.0.0) to supply FALSE in place of
TRUE and recompiling... I haven't tried yet though so maybe I'm quite badly
wrong.

Reid Huntsinger 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ulas karaoz
Sent: Thursday, November 18, 2004 11:30 AM
To: [EMAIL PROTECTED]
Subject: [R] hashing using named lists


hi all,
I am trying to use named list to hash a bunch of vector by name, for 
instance:
test = list()
test$name = c(1,2,3)

the problem is that when i try to get the values back by using the 
name, the matching isn't done in an exact way, so
test$na is not NULL.

is there a way around this?
Why by default all.equal.list doesnt require an exact match?
How can I do hashing in R?

thanks.
ulas.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] The hidden costs of GPL software?

2004-11-18 Thread Frank E Harrell Jr
Mike Prager wrote:
At 11/18/2004 07:01 AM Thursday, Thomas Schönhoff wrote:
To sum up, what I am in need to is an extensive example based 
help-system, focused on how to do things in R. In parts this is 
already there, i.e. SimpleR from Verzani (contributed docs area) etc.

Hopefully I can  contribute to this in future, since it is seems to me 
invaluable to learn R by going through example-based lessons (some are 
found in vignette() ).
These are much more comprehensible to me than those short reference 
like entries in the current help-system, mostly due to their very 
technical approach (same is to be said about the official GNU R 
manuals, especially The R Language, which wasn't a great help for me 
when I took my first look at GNU R). In this context something like 
the GuideMaps of Vista come to my mind!

But to be as clear as possible, I think GNU R is great and I 
appreciate all the efforts done by the R core team and associates!

Nevertheless it seems to be valuable to re-think the help-system in R 
with respect to those who may have a good understanding in statistics, 
but lacking some basic experiences in how to introduce themselves to 
sophisticated world of R/S languages.

(I posted similar material before, but it was moved to R-devel, and I 
wanted to express a bit of it here.)

I have frequently felt, like Thomas, that what could make R easier to 
use is not a GUI, but a help system more focused on tasks and examples, 
rather than on functions and packages.  This has obvious and large costs 
of development, and I am unlikely to contribute much myself, for reasons 
of time and ability.  Yet, I mention it for the sake of this discussion.

Such a help system could be a tree (or key) structure in which through 
making choices, the user's description of the desired task is gradually 
narrowed.  At the end of each twig of the tree would be a list of 
suggested functions for solving the problem, hyperlinked into the 
existing help system (which in many ways is outstanding and has evolved 
just as fast as R itself).  This could be coupled with the continued 
expansion of the number of examples in the help system.

Now I must express appreciation for what exists already that helps in 
this regard:  MASS (in its many editions), Introductory Statistics with 
R, Simple R, and the other free documentation that so many authors have 
generously provided.  Not to mention the superlative contribution of R 
itself, and the work of the R development team.  It is beyond my 
understanding how something so valuable and well thought out has been 
created by people with so many other responsibilities.

Mike
...
I second all of that.  What you are describing Mike could be done with 
a community-maintained wiki, with easy to add hyperlinks to other sites. 
 Just think what a great value it would be to the statistical community 
to have an ever-growing set of examples with all code and output, taking 
a cue from the BUGS examples guides.  The content could be broken down 
by major areas (data import examples, data manipulation examples, many 
analysis topics, many graphics topics, etc.).  Ultimately the more 
elaborate case studies could be peer-reviewied (a la the Journal of 
Statistical Software) and updated.

Frank
--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Re: The hidden costs of R?

2004-11-18 Thread Michael A. Miller
 Thomas == Thomas Schönhoff [EMAIL PROTECTED] writes:

 To sum up, what I am in need to is an extensive example
 based help-system, focused on how to do things in R. In
 parts this is already there, i.e. SimpleR from Verzani
 (contributed docs area) etc.

I have a nice set of extensive help with documentation sitting on
my shelf:

   - Peter Dalgaard. Introductory Statistics with R. Springer,
 2002. ISBN 0-387-9 

   - William N. Venables and Brian D. Ripley. Modern Applied
 Statistics with S. Fourth Edition. Springer, 2002. ISBN
 0-387-95457-0.  

   - Jose C. Pinheiro and Douglas M. Bates. Mixed-Effects Models
 in S and S-Plus. Springer, 2000. ISBN 0-387-98957-0.  

I suspect that I would have spent the money on these books even
if I'd started by spending money for S-plus, instead of R.  But
I've never seen the S-plus help system, so I may be wrong.

See http://www.r-project.org/doc/bib/R-publications.html and
http://www.r-project.org/doc/bib/R_bib.html for yet more.

Mike

-- 
Michael A. Miller   [EMAIL PROTECTED]
  Imaging Sciences, Department of Radiology, IU School of Medicine

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] gibbs sampling for mixture of normals

2004-11-18 Thread matteo ruggiero
hi

i'm looking for a gibbs sampling algorithm for R for the case of mixture of K
normals, and in particular for the case of bivariate normals.
i'd be grateful if anyone could send its own R-routine, at least for the
univariate case.

thank you in advance
matteo

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] SJava

2004-11-18 Thread Yasser El-Zein
I failed to build SJava dure to teh error below. Any ideas?

# R CMD INSTALL -c SJava_0.68-0.tar.gz 
* Installing *source* package 'SJava' ...
checking for java... /opt/j2sdk1.4.2_06//bin/java
Java VM /opt/j2sdk1.4.2_06//bin/java
checking for javah... /opt/j2sdk1.4.2_06//bin/javah
Looking in /opt/j2sdk1.4.2_06/include
Looking in /opt/j2sdk1.4.2_06/include/linux
checking for g++... no
checking for c++... no
checking for gpp... gpp
checking for C++ compiler default output... b.out
checking whether the C++ compiler works... configure: error: cannot
run C++ compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: configuration failed for package 'SJava'

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] The hidden costs of GPL software?

2004-11-18 Thread David Forrest
On Thu, 18 Nov 2004, Frank E Harrell Jr wrote:
...
 ...
 I second all of that.  What you are describing Mike could be done with
 a community-maintained wiki, with easy to add hyperlinks to other sites.

There is a wiki at http://fawn.unibw-hamburg.de/cgi-bin/Rwiki.pl but it
doesn't seem to get much use.

Last time I was hunting for help on R, I made the page
http://fawn.unibw-hamburg.de/cgi-bin/Rwiki.pl?SearchFunctions
 and in particular:

help.search.archive-function(string){
   RURL=http://www.google.com/u/newcastlemaths;
   RSearchURL=paste(RURL,?q=,string,sep='')
   browseURL(RSearchURL)
   return(invisible(0))
 }

help.search.archive('wiki') # example

Dave
-- 
 Dave Forrest
 [EMAIL PROTECTED](804)684-7900w
 [EMAIL PROTECTED] (804)642-0662h
   http://maplepark.com/~drf5n/

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] hashing using named lists

2004-11-18 Thread Prof Brian Ripley
On Thu, 18 Nov 2004, Huntsinger, Reid wrote:
It seems that that behavior is hard-coded in the subscript code,
the behaviour being partial matching?
but I bet you could fix it easily by changing the call to get1index
offset = get1index(CAR(subs), getAttrib(x, R_NamesSymbol),
  length(x), /*partial ok*/TRUE, i);
in src/main/subset.c (line 762 I think, R-2.0.0) to supply FALSE in place of
TRUE and recompiling... I haven't tried yet though so maybe I'm quite badly
wrong.
That is the [[ ]] code.  The $ code is at about line 968.
And if you did that a lot of R code may break, so please don't even think 
about it.  Partial matching is a long-standing feature.

There have been proposals from time to time for [ ] and [[ ]] to have an 
exact=TRUE argument for character indices.  That seems a good idea, except 
that they are generic and there are now many methods out there which would 
ignore the argument.


Reid Huntsinger
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ulas karaoz
Sent: Thursday, November 18, 2004 11:30 AM
To: [EMAIL PROTECTED]
Subject: [R] hashing using named lists
hi all,
I am trying to use named list to hash a bunch of vector by name, for
instance:
test = list()
test$name = c(1,2,3)
the problem is that when i try to get the values back by using the
name, the matching isn't done in an exact way, so
test$na is not NULL.
is there a way around this?
Why by default all.equal.list doesnt require an exact match?
How can I do hashing in R?
thanks.
ulas.
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] SJava

2004-11-18 Thread Prof Brian Ripley
Seem pretty straightforward to me: either gpp is not a C++ compiler or it 
does not work (possibly because LD_LIBRARY_PATH does not contain its 
run-time libraries).

On Thu, 18 Nov 2004, Yasser El-Zein wrote:
I failed to build SJava dure to teh error below. Any ideas?
# R CMD INSTALL -c SJava_0.68-0.tar.gz
* Installing *source* package 'SJava' ...
checking for java... /opt/j2sdk1.4.2_06//bin/java
Java VM /opt/j2sdk1.4.2_06//bin/java
checking for javah... /opt/j2sdk1.4.2_06//bin/javah
Looking in /opt/j2sdk1.4.2_06/include
Looking in /opt/j2sdk1.4.2_06/include/linux
checking for g++... no
checking for c++... no
checking for gpp... gpp
checking for C++ compiler default output... b.out
checking whether the C++ compiler works... configure: error: cannot
run C++ compiled programs.
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] SJava

2004-11-18 Thread Yasser El-Zein
Thank you Prof Ripley for your guidance. I re-installed gpp and SJava
installed correctly.
I am now running into this problem: When I load the SJava library I get:

 library(SJava)
Error in dyn.load(x, as.logical(local), as.logical(now)) : 
unable to load shared library
/usr/local/lib/R/site-library/SJava/libs/SJava.so:
  libRSNativeJava.so: cannot open shared object file: No such file or directory
Error in library(SJava) : .First.lib failed for 'SJava'

The file does exit:
$ ls -la /usr/local/lib/R/site-library/SJava/libs/SJava.so
-rwxr-xr-x  1 root staff 283388 Nov 18 13:27
/usr/local/lib/R/site-library/SJava/libs/SJava.so

I then ran:
$ R CMD ldd /usr/local/lib/R/site-library/SJava/libs/SJava.so
libRSNativeJava.so = not found
libjvm.so = not found
libR.so = /usr/lib/R/lib/libR.so (0x40014000)
libc.so.6 = /lib/tls/libc.so.6 (0x401df000)
libblas.so.3 = /usr/lib/atlas/libblas.so.3 (0x4031a000)
libg2c.so.0 = /usr/lib/libg2c.so.0 (0x40663000)
libm.so.6 = /lib/tls/libm.so.6 (0x40681000)
libgcc_s.so.1 = /lib/libgcc_s.so.1 (0x406a5000)
libpcre.so.3 = /usr/lib/libpcre.so.3 (0x406ae000)
libbz2.so.1.0 = /usr/lib/libbz2.so.1.0 (0x406be000)
libz.so.1 = /usr/lib/libz.so.1 (0x406ce000)
libreadline.so.4 = /lib/libreadline.so.4 (0x406df000)
libdl.so.2 = /lib/tls/libdl.so.2 (0x4070b000)
libncurses.so.5 = /lib/libncurses.so.5 (0x4070f000)
/lib/ld-linux.so.2 = /lib/ld-linux.so.2 (0x8000)

libjvm.so does exist in 4 locations in my intel box running debian:
/opt/splus/java/jre/lib/i386/client/libjvm.so
/opt/splus/java/jre/lib/i386/server/libjvm.so
/opt/j2sdk1.4.2_06/jre/lib/i386/server/libjvm.so
/opt/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so

I have JAVA_HOME defined as:
$ echo $JAVA_HOME
/opt/j2sdk1.4.2_06/

Your further help is greatly appreciated.

On Thu, 18 Nov 2004 19:27:53 + (GMT), Prof Brian Ripley
[EMAIL PROTECTED] wrote:
 Seem pretty straightforward to me: either gpp is not a C++ compiler or it
 does not work (possibly because LD_LIBRARY_PATH does not contain its
 run-time libraries).
 
 
 
 On Thu, 18 Nov 2004, Yasser El-Zein wrote:
 
  I failed to build SJava dure to teh error below. Any ideas?
 
  # R CMD INSTALL -c SJava_0.68-0.tar.gz
  * Installing *source* package 'SJava' ...
  checking for java... /opt/j2sdk1.4.2_06//bin/java
  Java VM /opt/j2sdk1.4.2_06//bin/java
  checking for javah... /opt/j2sdk1.4.2_06//bin/javah
  Looking in /opt/j2sdk1.4.2_06/include
  Looking in /opt/j2sdk1.4.2_06/include/linux
  checking for g++... no
  checking for c++... no
  checking for gpp... gpp
  checking for C++ compiler default output... b.out
  checking whether the C++ compiler works... configure: error: cannot
  run C++ compiled programs.
 
 --
 Brian D. Ripley,  [EMAIL PROTECTED]
 Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
 University of Oxford, Tel:  +44 1865 272861 (self)
 1 South Parks Road, +44 1865 272866 (PA)
 Oxford OX1 3TG, UKFax:  +44 1865 272595


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] The hidden costs of GPL software?

2004-11-18 Thread Liaw, Andy
 From: David Forrest
 
 On Wed, 17 Nov 2004, Mike Prager wrote:
 
 ...
  Using CLI software, an infrequent user has trouble 
 remembering the known
  functions needed and trouble finding new ones (especially 
 as that user gets
  older).  What might help is an added help facility more 
 oriented towards
  tasks, rather than structured around functions or packages.
 ...
 
 Another good (non-GUI) tool for the CLI is keyword 
 completion.  R in ESS
 does this, giving you lists of possible functions, variables 
 and objects,
 or feedback if there isn't any.  R's CLI completes, but only with
 filenames in the current directory.

That works only if R was compiled with readline.  Thus it doesn't work that
way on Windows, for example.  Completion still works on Windows under ESS
though.

Andy


 
 Dave
 -- 
  Dave Forrest
  [EMAIL PROTECTED](804)684-7900w
  [EMAIL PROTECTED] (804)642-0662h
http://maplepark.com/~drf5n/
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Advanced R programming course in North Carolina (RTP area) ?

2004-11-18 Thread paul king
Anyone knows of an upcomming Advanced R programming course in NC?
Would like to take this class before my project ends in December.
Thanks, Paul
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] SJava

2004-11-18 Thread Prof Brian Ripley
You need to ensure that libRSNativeJava.so is in your LD_LIBRARY_PATH: 
last time I looked SJava came with scripts to achieve this, and I suspect 
you need to read the documentation about them.

As a further note, these are programming questions about a non-R product, 
and  R-help is _really not_ the appropriate forum.  Do please consult the 
posting guide.

On Thu, 18 Nov 2004, Yasser El-Zein wrote:
Thank you Prof Ripley for your guidance. I re-installed gpp and SJava
installed correctly.
I am now running into this problem: When I load the SJava library I get:
library(SJava)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
   unable to load shared library
/usr/local/lib/R/site-library/SJava/libs/SJava.so:
 libRSNativeJava.so: cannot open shared object file: No such file or directory
Error in library(SJava) : .First.lib failed for 'SJava'
The file does exit:
$ ls -la /usr/local/lib/R/site-library/SJava/libs/SJava.so
-rwxr-xr-x  1 root staff 283388 Nov 18 13:27
/usr/local/lib/R/site-library/SJava/libs/SJava.so
I then ran:
$ R CMD ldd /usr/local/lib/R/site-library/SJava/libs/SJava.so
   libRSNativeJava.so = not found
   libjvm.so = not found
   libR.so = /usr/lib/R/lib/libR.so (0x40014000)
   libc.so.6 = /lib/tls/libc.so.6 (0x401df000)
   libblas.so.3 = /usr/lib/atlas/libblas.so.3 (0x4031a000)
   libg2c.so.0 = /usr/lib/libg2c.so.0 (0x40663000)
   libm.so.6 = /lib/tls/libm.so.6 (0x40681000)
   libgcc_s.so.1 = /lib/libgcc_s.so.1 (0x406a5000)
   libpcre.so.3 = /usr/lib/libpcre.so.3 (0x406ae000)
   libbz2.so.1.0 = /usr/lib/libbz2.so.1.0 (0x406be000)
   libz.so.1 = /usr/lib/libz.so.1 (0x406ce000)
   libreadline.so.4 = /lib/libreadline.so.4 (0x406df000)
   libdl.so.2 = /lib/tls/libdl.so.2 (0x4070b000)
   libncurses.so.5 = /lib/libncurses.so.5 (0x4070f000)
   /lib/ld-linux.so.2 = /lib/ld-linux.so.2 (0x8000)
libjvm.so does exist in 4 locations in my intel box running debian:
/opt/splus/java/jre/lib/i386/client/libjvm.so
/opt/splus/java/jre/lib/i386/server/libjvm.so
/opt/j2sdk1.4.2_06/jre/lib/i386/server/libjvm.so
/opt/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so
I have JAVA_HOME defined as:
$ echo $JAVA_HOME
/opt/j2sdk1.4.2_06/
Your further help is greatly appreciated.
On Thu, 18 Nov 2004 19:27:53 + (GMT), Prof Brian Ripley
[EMAIL PROTECTED] wrote:
Seem pretty straightforward to me: either gpp is not a C++ compiler or it
does not work (possibly because LD_LIBRARY_PATH does not contain its
run-time libraries).

On Thu, 18 Nov 2004, Yasser El-Zein wrote:
I failed to build SJava dure to teh error below. Any ideas?
# R CMD INSTALL -c SJava_0.68-0.tar.gz
* Installing *source* package 'SJava' ...
checking for java... /opt/j2sdk1.4.2_06//bin/java
Java VM /opt/j2sdk1.4.2_06//bin/java
checking for javah... /opt/j2sdk1.4.2_06//bin/javah
Looking in /opt/j2sdk1.4.2_06/include
Looking in /opt/j2sdk1.4.2_06/include/linux
checking for g++... no
checking for c++... no
checking for gpp... gpp
checking for C++ compiler default output... b.out
checking whether the C++ compiler works... configure: error: cannot
run C++ compiled programs.
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Off Topic: GSL installation for Windows

2004-11-18 Thread Laura Holt
Hi R People!
Has anyone installed the Gnu Scientific Library on a Windows system, please?
I'm having a dreadful time with that.
Any advance would be much appreciated.
Sincerely,
Laura Holt
mailto: [EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Enormous Datasets

2004-11-18 Thread Thomas W Volscho
Dear List,
I have some projects where I use enormous datasets.  For instance, the 5% PUMS 
microdata from the Census Bureau.  After deleting cases I may have a dataset 
with 7 million+ rows and 50+ columns.  Will R handle a datafile of this size?  
If so, how?

Thank you in advance,
Tom Volscho


Thomas W. Volscho
Graduate Student
Dept. of Sociology U-2068
University of Connecticut
Storrs, CT 06269
Phone: (860) 486-3882
http://vm.uconn.edu/~twv1

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re[2]: [R] Where has the Debian respository gone?

2004-11-18 Thread Chris Evans
Hello Dirk,

Thursday, November 18, 2004, 3:18:40 PM, you wrote:

DE On Thu, Nov 18, 2004 at 08:52:38AM +, stats wrote:
 I'm a bit puzzled.  I had
 deb http://cran.r-project.org/bin/linux/debian woody main
 in /etc/apt/sources.list and had hoped, perhaps rather unwisely, that
 this would look after the transition from 1.8.0 on my internet server (Debian
 stable) where it serves up some cgi-bin work.  (Most of my R work is
 on a Win2k machine, much though I'd like to go Debian all the way,
 that isn't possible for my main job in near future.)
 
 Is there an easy way of upgrading R on a Debian stable machine?  I
 don't want to move off stable as the security side of that server is
 too important.  I also don't really want to compile it myself if I can
 avoid that, the server is pretty old iron and that might back up all
 the Email stuff it does.
 
 Advice anyone?

DE More than advice, we need a volunteer to backport the current R package(s)
DE for Debian to the Debian stable distribution. As I said, testing and
DE unstable are taken care of (and yes, testing is still lagging because of the
DE now much more formal interdependence of packages; R 2.0.* will appears once
DE all dependent packages are available on all architectures)

I'm sure this is in itself proof that I'm not the person to do it but
can you say a bit more about what's involved Dirk?  I run a pretty low
powered Debian stable server on i386 hardware (an athlon if I remember
rightly) with pretty much the standard packages, GCC, perl etc. and I'm
not completely stupid.  However, debugging compiler and make complaints
is really not my area of competence and I do wonder about the likely load
on the machine and on my time.

In the not too distant future this machine should be replaced with a
much more powerful one and a somewhat more powerful backup machine so
hardware may not be a long term problem.

Any chance I can be useful?  Could I team up with someone who really
knows what s/he is doing but doesn't use Debian stable and work this
together?

Let me know, I'd love to put something very direct back into the R project.

Chris

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] How to calculate the stratified means in a data frame?

2004-11-18 Thread Frank Duan
Dear R people,

I have a simple question to ask. Suppose I have a data.frame with two
variables: one factor (x) and one numeric (y), I want to calculate the
mean of y for each value of x. Although it's easy to do it within a
for a loop, I believe there may be a concise way by using some kinds
of apply functions. Could anyone tell me how to do that? Thank you.

Frank

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Time series plot orientation

2004-11-18 Thread Costas Vorlow
Hello,
I am trying to rotate by 90 degrees a time series plot. So I need the 
time axis to be the vertical one. Is there an easy way?

I couldn't guess anything from the help pages.
Apologies for a silly question.
Regards,
Costas
--
=
This e-mail contains information intended for the addressee only.
It may be confidential and may be the subject of legal and/or 
professional Privilege. Any dissemination, distribution, copyright 
or use of this communication without prior permission of the 
addressee is strictly prohibited.
-
Dr. Costas Vorlow		| Tel: +44 (0)191 33 45727
Durham Business School	 	| Fax: +44 (0)191 33 45201
Room(324), University of Durham | email: K.E.Vorloou(at)durham.ac.uk
Mill Hill Lane, 		| or : costas(at)vorlow.org
Durham DH1 3LB, UK. 		| http://www.vorlow.org
-
Fingerprint: B010 577A 9EC3 9185 08AE 8F22 1A48 B4E7 9FA6 C31A

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Off Topic: GSL installation for Windows

2004-11-18 Thread Prof Brian Ripley
See the ReadMe (which should be the first place to look) at
http://cran.r-project.org/bin/windows/contrib/2.0/@ReadMe
It's easy once you have gsl-1.5 built (the gnuwin32 project's version 
is too old), but getting gsl-1.5 built is not straightforward.

On Thu, 18 Nov 2004, Laura Holt wrote:
Has anyone installed the Gnu Scientific Library on a Windows system, please?
I'm having a dreadful time with that.

--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] How to calculate the stratified means in a data frame?

2004-11-18 Thread Prof Brian Ripley
On Thu, 18 Nov 2004, Frank Duan wrote:
I have a simple question to ask. Suppose I have a data.frame with two
variables: one factor (x) and one numeric (y), I want to calculate the
mean of y for each value of x. Although it's easy to do it within a
for a loop, I believe there may be a concise way by using some kinds
of apply functions. Could anyone tell me how to do that? Thank you.
tapply(y, x, mean)  # which _is_ in `An Introduction to R', BTW
?by
?aggregate
for more sophisticated packaging of such ideas.
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Enormous Datasets

2004-11-18 Thread Peter Dalgaard
Thomas W Volscho [EMAIL PROTECTED] writes:

 Dear List, I have some projects where I use enormous datasets. For
 instance, the 5% PUMS microdata from the Census Bureau. After
 deleting cases I may have a dataset with 7 million+ rows and 50+
 columns. Will R handle a datafile of this size? If so, how?

With a big machine... If that is numeric, non-integer data, you are
looking at something like 

 7e6*50*8
[1] 2.8e+09

i.e. roughly 3 GB of data for one copy of the data set. You easily
find yourself with multiple copies, so I suppose a machine with 16GB
RAM would cut it. These days that basically suggests x86_64
architecture running Linux (e.g. multiprocessor Opterons), but there
are also 64 bit Unix big iron solutions (Sun, IBM, HP,...).

If you can avoid dealing with the whole dataset at once, smaller
machines might get you there. Notice that 1 column is only 56MB, and
you may be able to work with aggregated data from some step onwards. 


-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Enormous Datasets

2004-11-18 Thread Vadim Ogranovich
Very unlikely R will be able to handle this. The problems are:

* the data set may simply not fit into the memory
* it will take forever to read from the ASCII file
* any meaningful analysis of a dataset in R typically require 5 - 10
times more memory than the size of the dataset (unless you are a real
insider and know all the knobs)


Your best strategy is probably to partition the file in meaningful
sub-categories and work with them. To save time on conversion from ASCII
you can read the sub-files into a data frame and then save the data
frame in .rda file using save(). Subsequent loading .rda files is much
faster than reading ASCII

Another strategy which is often advocated on the list is to put the data
into a data base and draw random samples of manageable size from the
database. I have no experience with this approach

HTH,
Vadim

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Thomas 
 W Volscho
 Sent: Thursday, November 18, 2004 12:11 PM
 To: [EMAIL PROTECTED]
 Subject: [R] Enormous Datasets
 
 Dear List,
 I have some projects where I use enormous datasets.  For 
 instance, the 5% PUMS microdata from the Census Bureau.  
 After deleting cases I may have a dataset with 7 million+ 
 rows and 50+ columns.  Will R handle a datafile of this size? 
  If so, how?
 
 Thank you in advance,
 Tom Volscho
 
 
 Thomas W. Volscho
 Graduate Student
 Dept. of Sociology U-2068
 University of Connecticut
 Storrs, CT 06269
 Phone: (860) 486-3882
 http://vm.uconn.edu/~twv1
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] How to calculate the stratified means in a data frame?

2004-11-18 Thread Peter Dalgaard
Frank Duan [EMAIL PROTECTED] writes:

 Dear R people,
 
 I have a simple question to ask. Suppose I have a data.frame with two
 variables: one factor (x) and one numeric (y), I want to calculate the
 mean of y for each value of x. Although it's easy to do it within a
 for a loop, I believe there may be a concise way by using some kinds
 of apply functions. Could anyone tell me how to do that? Thank you.

tapply() will do that. (help(tapply), look at the presidents example).

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark  Ph: (+45) 35327918
~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] How to calculate the stratified means in a data frame?

2004-11-18 Thread Frank Duan
Got it. Many thanks.


On Thu, 18 Nov 2004 13:10:53 -0800, Jeff Laake [EMAIL PROTECTED] wrote:
 look at by
 
 
 
 Frank Duan wrote:
 
  Dear R people,
 
  I have a simple question to ask. Suppose I have a data.frame with two
  variables: one factor (x) and one numeric (y), I want to calculate the
  mean of y for each value of x. Although it's easy to do it within a
  for a loop, I believe there may be a concise way by using some kinds
  of apply functions. Could anyone tell me how to do that? Thank you.
 
  Frank
 
  __
  [EMAIL PROTECTED] mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
  http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] How to calculate the stratified means in a data frame?

2004-11-18 Thread Marc Schwartz
On Thu, 2004-11-18 at 15:34 -0500, Frank Duan wrote:
 Dear R people,
 
 I have a simple question to ask. Suppose I have a data.frame with two
 variables: one factor (x) and one numeric (y), I want to calculate the
 mean of y for each value of x. Although it's easy to do it within a
 for a loop, I believe there may be a concise way by using some kinds
 of apply functions. Could anyone tell me how to do that? Thank you.
 
 Frank


One way is to use by(). Using the 'iris' dataset to get the means for
Sepal.Length by Species:

 with(iris, by(Sepal.Length, Species, mean))
INDICES: setosa
[1] 5.006
-- 
INDICES: versicolor
[1] 5.936
-- 
INDICES: virginica
[1] 6.588

See ?by, also ?tapply and ?aggregate.

Note also the use of with() as a wrapper, in lieu of attach() here.

HTH,

Marc Schwartz

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] How to calculate the stratified means in a data frame?

2004-11-18 Thread Liaw, Andy
See ?tapply or ?by.

Andy

 From: Frank Duan
 
 Dear R people,
 
 I have a simple question to ask. Suppose I have a data.frame with two
 variables: one factor (x) and one numeric (y), I want to calculate the
 mean of y for each value of x. Although it's easy to do it within a
 for a loop, I believe there may be a concise way by using some kinds
 of apply functions. Could anyone tell me how to do that? Thank you.
 
 Frank
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] adjusting the map of France to 1830

2004-11-18 Thread Michael Friendly
I'm doing some analyses of historical data from France in 1830 on 'moral 
statistics' that I'd like to
show on a map.  I've done most of my analyses in SAS, but a few things 
would work better in R.
To do this, I have to adjust the modern map,

library(maps)
map('france')
to adjust for changes in departments (86 in 1830, to 97 now).  I've read 
the documentation
for the maps and maptools package, but there seems to be no functions to 
allow this, and
I can't find information on the exact structure of map datasets, but I 
understand them to
be delimited lists of polygon coordinates.

In SAS, all maps have (one or more) ID variables representing the 
geographical region,
and there is also a proc gremove that can remove internal boundaries 
inside the polygons
for regions with the same ID.  Is there some way I can do this in R?

Here's what I did in SAS:
*-- Fix the map of France to conform to Guerry:
   - adjust the 97 current departments to correspond to the 86 in 1830
   - delete those not part of France then
;
data gfrtemp;
   set maps.france;
   /* Corse was one dept - merge these to one area, new ID */
   if id in (201, 202)then dept=200;
   /* Seine et Oise (78) was cut into
   Essonne (91), Val d'Oise (95) and Yvelines (78) */
   else if id in (91, 95)then dept=78;
   /* Seine (75) now split into
   Hauts-de-Seine (92), Seine-Saint-Denis (93) et Val-de-Marne (94)*/
   else if id in (92, 93, 94)then dept=75;
  
/* departments not part of France in 1830 */
   else if id in (
   6, /* Alpes-Maritimes */
   73,74, /* Savoie, Haute-Savoie */
   90)/* Territore-de-Belfort */
   then delete;
   else   dept=id;
   run;
  
*-- remove internal boundaries based on merged DEPT;
proc sort data=gfrtemp;
   by dept;

proc gremove data=gfrtemp out=gfrance;
  by dept;
  id id;
  run;

--
Michael Friendly Email: [EMAIL PROTECTED] 
Professor, Psychology Dept.
York University  Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Streethttp://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Enormous Datasets

2004-11-18 Thread Liaw, Andy
It depends on what you want to do with that data in R.  If you want to play
with the whole data, just storing it in R will require more than 2.6GB of
memory (assuming all data are numeric and are stored as doubles):

 7e6 * 50 * 8 / 1024^2
[1] 2670.288

That's not impossible, but you'll need to be on a computer with quite a bit
more memory than that, and running on an OS that supports it.  If that's not
feasible, you need to re-think what you want to do with that data in R
(e.g., read in and process a small chunk at a time, or read in a random
sample, etc.).

Andy


 From: Thomas W Volscho
 
 Dear List,
 I have some projects where I use enormous datasets.  For 
 instance, the 5% PUMS microdata from the Census Bureau.  
 After deleting cases I may have a dataset with 7 million+ 
 rows and 50+ columns.  Will R handle a datafile of this size? 
  If so, how?
 
 Thank you in advance,
 Tom Volscho
 
 
 Thomas W. Volscho
 Graduate Student
 Dept. of Sociology U-2068
 University of Connecticut
 Storrs, CT 06269
 Phone: (860) 486-3882
 http://vm.uconn.edu/~twv1
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Re: R package installation

2004-11-18 Thread Marco Chiarandini
Dear Prof. Johnson,

sorry for posting the reply so late.

I am already using FINK. But you were right, R was looking for g77 and
the gcc libraries under the MacOs distributions.

Rather than creating symbolic links I updated FLIBS in
/Library/Frameworks/R.framework/Resources/etc/Makeconf
so that it searches in the right path
/sw/lib/gcc/powerpc-apple-darwin7.2.0/

For g77 I made instead the link you suggest under /usr/bin/.

I removed and reinstalled the package and everything run fine, in spite
of my versions of libraries and compilers (g77 was already up-date from
FINK).


Thank you all for the help,


Marco



 Dear Marco,

 I was given an excerpt with your problem about installing package on
 a MAC, such as Hmisc.

 I had the same problems and found a work around.

 I have not had any trouble loading in source packages since, include
 Hmisc and Design, acepack and vgam.

 First, I downloaded and installed the g77 compiler.

 I use a progam named FINK to find, download and intall g77 (so first I
 installed FINK
 then from within FINK I downloaded/installed the g77 compiler.) Do a
 Google search
 for FINK, it is easy to find and install.

 After g77 was installed I had to make a symbolic link so R could find
 it:

 ln -s \sw\bin\g77 \usr\bin\g77  (I think I had to make a link to my gcc
 compiler also)
 \n -s \sw\bin\gcc \usr\bin\g77

 It looks like you already have the g77 compiler from the message.  the
 next mesage you can also remedy by symbolic links.  Try

 ln -s /sw/lib/gcc   /usr/local/lib/gcc
 ln -s /sw/lib/gcc/powerpc-apple-darwin7.5.0
 \usr\local\lib\gcc\powerpc-apple-darwin6.8
 ln -s /sw/lib/gcc/powerpc-apple-darwin7.5.0/3.4.1
 \usr\local\lib\gcc\powerpc-apple-darwin6.8\3.4.2

 The first directory path in each of the above may be specific to your
 configuration for gcc.

 But this did work for me, and if you find the correct location for gcc/
 powerpc-apple-darwinX.Y.Z/U.V.W, you should have no trouble either.

 Good luck.

 Sincerely

 Tim Johnson
 Adjunct Asst. Professor
 University of Michigan



---
Marco Chiarandini, Fachgebiet Intellektik, Fachbereich Informatik,
Technische Universität Darmstadt, Hochschulstraße 10,
D-64289 Darmstadt - Germany, Office: S2/02 Raum E317
Tel: +49.(0)6151.166802 Fax: +49.(0)6151.165326
email: [EMAIL PROTECTED]
web page: http://www.intellektik.informatik.tu-darmstadt.de/~machud

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] The hidden costs of GPL software?

2004-11-18 Thread John Maindonald
The author of the article says nothing about the large
number of hours and weeks that he surely spent learning
S-plus!
There should be attention to the costs that arise from a wrong
or inappropriate analysis, perhaps because the software that
is in use makes it difficult to do anything better, perhaps
because of statistical skill limitations, often with these two
factors working together.  Analyses that misrepresent the
science, or designs and analyses that conspire together to
this end, have serious and costly implications for research.
I've refereed several papers recently, in broadly ecological
fields of endeavour, with seemingly quite reasonable data,
where the mix of author skill and abilities of the package was
clearly not up to the task in hand.  Relative to getting on top
of the statistical issues (for which they will probably end up
getting, as they need to, statistical help), the GUI/noGUI issue
will be a minor consideration, and hours or weeks spent
learning R will be at most a modest consideration.
John Maindonald email: [EMAIL PROTECTED]
phone : +61 2 (6125)3473fax  : +61 2(6125)5549
Centre for Bioinformation Science, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.
On 17 Nov 2004, at 10:27 PM, [EMAIL PROTECTED] wrote:
From: Philippe Grosjean [EMAIL PROTECTED]
Date: 17 November 2004 8:53:28 PM
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Cc: Subject:
Hello,
In the latest 'Scientific Computing World' magazine (issue 78, p. 22), 
there
is a review on free statistical software by Felix Grant (doesn't have 
to
pay good money to obtain good statistics software). As far as I know, 
this
is the first time that R is even mentioned in this magazine, given 
that it
usually discuss commercial products.

In this article, the analysis of R is interesting. It is admitted that 
R is
a great software with lots of potentials, but: All in all, R was a 
good
lesson in the price that may have to be paid for free software: I 
spent many
hours relearning some quite basic things taken for granted in the 
commercial
package. Those basic things are releated with data import, obtention 
of
basic plots, etc... with a claim for a missing more intuitive GUI in 
order
to smooth a little bit the learning curve.

There are several R GUI projects ongoing, but these are progressing 
very
slowly. The main reason is, I believe, that a relatively low number of
programmers working on R are interested by this field. Most people 
wanting
such a GUI are basic user that do not (cannot) contribute... And if 
they
eventually become more knowledgeable, they tend to have other 
interests.

So, is this analysis correct: are there hidden costs for free software 
like
R in the time required to learn it? At least currently, for the people 
I
know (biologists, ecologists, oceanographers, ...), this is perfectly 
true.
This is even an insurmountable barrier for many of them I know, and 
they
have given up (they come back to Statistica, Systat, or S-PLUS using
exclusively functions they can reach through menus/dialog boxes).

Of course, the solution is to have a decent GUI for R, but this is a 
lot of
work, and I wonder if the intrinsic mechanism of GPL is not working 
against
such a development (leading to a very low pool of programmers actively
involved in the elaboration of such a GUI, in comparison to the very 
large
pool of competent developers working on R itself).

Do not misunderstand me: I don't give up with my GUI project, I am just
wondering if there is a general, ineluctable mechanism that leads to 
the
current R / R GUI situation as it stands,... and consequently to a 
general
rule that there are indeed most of the time hidden costs in free
software, due to the larger time required to learn it. I am sure there 
are
counter-examples, however, my feeling is that, for Linux, Apache, 
etc... the
GUI (if there is one) is often a way back in comparison to the 
potentials in
the software, leading to a steep learning curve in order to use all 
these
features.

I would be interested by your impressions and ideas on this topic.
Best regards,
Philippe Grosjean
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: Re: [R] 3d scatter plot with drop line

2004-11-18 Thread davidr
Very nice!
I noticed that you wrote the function to drop points to any surface.
Is it possible to add the surface to the plot as a translucent surface,
so the points and drop lines still show?

David L. Reiner

-Original Message-
From: Robin Hankin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 18, 2004 3:39 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Fwd: Re: [R] 3d scatter plot with drop line



Hi

try this:




p3dpairs - function(x,x1, 
xlim=NULL,ylim=NULL,zlim=NULL,col=par(col), pch=par(pch), 
cex=par(cex), ...){
   if(is.matrix(x)){
 z - x[,3]
 y - x[,2]
 x - x[,1]
   }

 if(is.matrix(x1)){
 z1 - x1[,3]
 y1 - x1[,2]
 x1 - x1[,1]
   }

   if(missing(zlim)) {
 z.grid - matrix(range(z),2,2)
   } else {
 z.grid - matrix(zlim,2,2)
   }

   if(missing(xlim)){ xlim - range(x) }
   if(missing(ylim)){ ylim - range(y) }

   persp(xlim, ylim, z.grid, col = NA, border=NA, ...) - res

   trans3d - function(x,y,z, pmat) {
 tr - cbind(x,y,z,1) %*% pmat
 list(x = tr[,1]/tr[,4], y= tr[,2]/tr[,4])
   }

   out - trans3d(x,y,z,pm=res)
   out1 - trans3d(x1,y1,z1,pm=res)
   points(out, col=col, pch=pch, cex=cex, ...)

   for(i in 1:length(out$x)){
 lines(c(out$x[i],out1$x[i]),c(out$y[i],out1$y[i]), col=gray, ...)
   }
   return(invisible(out))
}




then


a - matrix(rnorm(60),20,3)
  b - a
b[,3] - 0
  p3dpairs(a,b)


gives you a good approximation to what you want

HTH

rksh


This is a follow up to my question from yesterday. I want to do in R
what is called a 3d scatter plot with drop lines in S-PLUS.

Basically, it's a 3dscatterplot with lines connecting the x-y grid to
the z points.
The lines give a better perspective on the shape of the data surface.

How to?

Joel Bremson
UC Davis Statistics

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html


--

Robin Hankin
Uncertainty Analyst
Southampton Oceanography Centre
SO14 3ZH
tel +44(0)23-8059-7743
[EMAIL PROTECTED] (edit in obvious way; spam
precaution)


-- 
Robin Hankin
Uncertainty Analyst
Southampton Oceanography Centre
SO14 3ZH
tel +44(0)23-8059-7743
[EMAIL PROTECTED] (edit in obvious way; spam precaution)
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Memory problems...leaky?

2004-11-18 Thread Sam Yeaman
Hi list folks,
I have been trying to figure out how I can run the script that I have 
included below. I have 1.2 gigs of memory on the computer, but this is 
not enough, given the size of the input datasets. The input matrix 
('input') is a little under 2400 x 2900 cells, and is about 60 megs when 
stored on hard drive...what is R doing, that this (small) size of file 
takes up so much memory? The script uses three variables of this size, 
but  I don't see why that would add up to over 1.2 gigs...Is the way 
that I call variables in the for-loops causing this problem, with some 
sort of leakiness? I had heard of leaky memory problems with version 
1.5.1, but I am using 1.9.1. Alternatively, I had wondered if it was 
just the way memory works in R, as I had read a post earlier today that 
suggested that R requires 5-10 times more memory than the input to 
meaninfully calculate anything...

Thanks...Sam

bflow - 2
pie - 3.141592654
input -  read.table (xxx.txt, sep=, header=FALSE, na.strings = -)
rowsize - dim(input)[1]
colsize - dim(input)[2]
result - matrix (NA, rowsize, colsize)
for (i in 1:rowsize)
for (j in 1:colsize)
   if (is.na (input [i,j]) == FALSE) {
   probability - matrix (NA, rowsize, colsize)
   for (p in 1:rowsize) {
   or (q in 1:colsize){
   distance - sqrt ((p - i)^2 + (q - j)^2)
   probability [p,q] - (2 / (bflow * pie * (1 + (distance / 
bflow)^2)))   
   }   
   }

   kernsum - sum ((probability * input / input), na = 
TRUE)   
   intmean - sum (input * probability, na = TRUE) / 
kernsum   
   result [i,j] - sum (((input - intmean)^2 * probability), na = 
TRUE) / kernsum
   }

}
}
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Where has the Debian respository gone?

2004-11-18 Thread Dirk Eddelbuettel
Chris,

On Thu, Nov 18, 2004 at 08:21:04PM +, Chris Evans wrote:
 DE More than advice, we need a volunteer to backport the current R 
 package(s)
 DE for Debian to the Debian stable distribution. As I said, testing and
 DE unstable are taken care of (and yes, testing is still lagging because of 
 the
 DE now much more formal interdependence of packages; R 2.0.* will appears 
 once
 DE all dependent packages are available on all architectures)
 
 I'm sure this is in itself proof that I'm not the person to do it but
 can you say a bit more about what's involved Dirk?  I run a pretty low
[..]
 Any chance I can be useful?  Could I team up with someone who really
 knows what s/he is doing but doesn't use Debian stable and work this
 together?
 
 Let me know, I'd love to put something very direct back into the R project.

Thanks a bunch -- I'll follow up off-list!

Dirk

-- 
If your hair is standing up, then you are in extreme danger.
  -- http://www.usafa.af.mil/dfp/cockpit-phys/fp1ex3.htm

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] implementing a loop using by(x,x$factor,FUN)

2004-11-18 Thread Mohamed Abdolell
Hi,

I'm writing some R code that requires a massive amount of looping and would
ideally like to write it so that it avoid the use of for loop ... however I'm
having some trouble.

Very briefly, the basic idea is to implement a binary partitioning algorithm to
determine the optimal cutpoint based on deviance measures obtained from
likelihood estiamtes.  This is in the geo-spatial context so I'm actually using
the geoRglm package to obtain this likelihood fit.  I initially use the variog
function to help specify the initial parameter values passed to likfit to
ensure convergence.

Although not the most elegant solution, the code works ... I just want to
re-code it to avoid using the for loop.

Any help would be greatly appreciated.

This is what I've got 


RootDev - 600
splits - NULL

for (cutpoint in cutpoints) {
   LRGdata - split(gdata, gdata[,4] = cutpoint)
   vgrmL - variog(as.geodata(LRGdata$TRUE), covar.col=covcol)) 
   vgrmR - variog(as.geodata(LRGdata$FALSE), covar.col=covcol)) 
   mlL- likfit(as.geodata(LRGdata$TRUE),
ini=expand.grid(seq(0, max(vgrmL$v), l=10), seq(0,max(vgrmL$u), l=10)))
   mlR- likfit(as.geodata(LRGdata$FALSE),
ini=expand.grid(seq(0, max(vgrmR$v), l=10), seq(0,max(vgrmR$u), l=10)))
   LeftDev - summary(mlL)[[8]]$log.L
   RightDev - summary(mlR)[[8]]$log.L
   LeftN - dim(LRGdata$TRUE)[1] 
   RightN - dim(LRGdata$FALSE)[1] 
   splits - rbind(splits, c(paste(=,cutpoint),paste(,cutpoint),
LeftN, RightN, RootDev, LeftDev, RightDev,
-2*(RootDev-(LeftDev+RightDev
}


- Mohamed

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] adjusting the map of France to 1830

2004-11-18 Thread Stephane DRAY
Hello. I do not know if you can merge polygons, but you can select easily:
 departements=map('france',namesonly=T) # returns a vector of names of 
regions
 map('france',regions=departements[1:20],namesonly=T) # use what you need 
with regions argument

Hope this helps,
At 16:29 18/11/2004, Michael Friendly wrote:
I'm doing some analyses of historical data from France in 1830 on 'moral 
statistics' that I'd like to
show on a map.  I've done most of my analyses in SAS, but a few things 
would work better in R.
To do this, I have to adjust the modern map,

library(maps)
map('france')
to adjust for changes in departments (86 in 1830, to 97 now).  I've read 
the documentation
for the maps and maptools package, but there seems to be no functions to 
allow this, and
I can't find information on the exact structure of map datasets, but I 
understand them to
be delimited lists of polygon coordinates.

In SAS, all maps have (one or more) ID variables representing the 
geographical region,
and there is also a proc gremove that can remove internal boundaries 
inside the polygons
for regions with the same ID.  Is there some way I can do this in R?

Here's what I did in SAS:
*-- Fix the map of France to conform to Guerry:
   - adjust the 97 current departments to correspond to the 86 in 1830
   - delete those not part of France then
;
data gfrtemp;
   set maps.france;
   /* Corse was one dept - merge these to one area, new ID */
   if id in (201, 202)then dept=200;
   /* Seine et Oise (78) was cut into
   Essonne (91), Val d'Oise (95) and Yvelines (78) */
   else if id in (91, 95)then dept=78;
   /* Seine (75) now split into
   Hauts-de-Seine (92), Seine-Saint-Denis (93) et Val-de-Marne (94)*/
   else if id in (92, 93, 94)then dept=75;
/* departments not part of France in 1830 */
   else if id in (
   6, /* Alpes-Maritimes */
   73,74, /* Savoie, Haute-Savoie */
   90)/* Territore-de-Belfort */
   then delete;
   else   dept=id;
   run;
*-- remove internal boundaries based on merged DEPT;
proc sort data=gfrtemp;
   by dept;
proc gremove data=gfrtemp out=gfrance;
  by dept;
  id id;
  run;

--
Michael Friendly Email: [EMAIL PROTECTED] Professor, Psychology Dept.
York University  Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Streethttp://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Stéphane DRAY
-- 

Département des Sciences Biologiques
Université de Montréal, C.P. 6128, succursale centre-ville
Montréal, Québec H3C 3J7, Canada
Tel : (514) 343-6111 poste 1233 Fax : (514) 343-2293
E-mail : [EMAIL PROTECTED]
-- 

Web  http://www.steph280.freesurf.fr/
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] adjusting the map of France to 1830

2004-11-18 Thread Ray Brownrigg
At 16:29 18/11/2004, Michael Friendly wrote:
 I'm doing some analyses of historical data from France in 1830 on 'moral 
 statistics' that I'd like to
 show on a map.  I've done most of my analyses in SAS, but a few things 
 would work better in R.
 To do this, I have to adjust the modern map,
 
 library(maps)
 map('france')
 
 to adjust for changes in departments (86 in 1830, to 97 now).  I've read 
 the documentation
 for the maps and maptools package, but there seems to be no functions to 
 allow this, and
 I can't find information on the exact structure of map datasets, but I 
 understand them to
 be delimited lists of polygon coordinates.
 
 In SAS, all maps have (one or more) ID variables representing the 
 geographical region,
 and there is also a proc gremove that can remove internal boundaries 
 inside the polygons
 for regions with the same ID.  Is there some way I can do this in R?

Unfortunately not with the current implementation of several of the
'extra' databases in the mapdata package.  The map() function does have
the interior=FALSE option, which would normally do what you want, but
only when the data has been manipulated to allow it.  Currently this
option is only useful with the world and usa maps (and their
derivatives, such as world2 and state).

Currently every department is a complete polygon, and so every interior
line segment occurs twice in the data.  What has to happen to the data
is for it to be split up into non-overlapping line segments, and each
polygon reconstructed from a list of these line segments (with
direction being important).

If you are prepared to perform this somewhat tedious process, I am
happy to assist you with further details.

However even with the interior= option functioning, it would still not
be easy to produce the map you would require, since you would have to
build it up from many components (namely each of the 'combined'
departments, plus 'all the rest').

HTH,
Ray Brownrigg

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Date time Differences

2004-11-18 Thread Mark R Laflamme, MD
Greetings from an R newbie
Table imported with 4 columns containing Dates and Times, I desire to 
determine the differences between said columns
Have loaded the base and chron packages for R commander.  Have tried to 
use format but without success.  Have tried the Postix commands but 
error states unused argument (s) (...), even though some of the 
examples do not use (...) at the end of the command

Example:
Table is named GvY1
 Operation.Time.End  Operation.Time.Dictated   
Operation.Time.Verfiy
  7/10/2004 10:10:12 7/12/2004 9:18:03  
7/28/2004 05:00:02

Information is mm/dd/year hh:mm:ss (time of day, e.g. the first column 
is July 10th 2004 10:10 AM at 12 seconds)
What is the best way to get the difference between any of the 2 columns? 
And eventually test statistics on the columns (eg. P values, if needed, 
but not a priority at this time)
Thanks in advance

Platform WinXP
IBM T40p
R v 1.8.1
R commander
--
Mark R Laflamme,MD
Regenstrief Institute   
1050 Wishard Blvd RG5
Indianapolis, IN 46202
317 630-7833
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Date Time differences

2004-11-18 Thread Mark R Laflamme, MD
Greetings from an R newbie
Table imported with 4 columns containing Dates and Times, I desire to 
determine the differences between said columns
Have loaded the base and chron packages for R commander.  Have tried to 
use format but without success.  Have tried the Postix commands but 
error states unused argument (s) (...), even though some of the 
examples do not use (...) at the end of the command

Example:
Table is named GvY1
Operation.Time.End  Operation.Time.Dictated   
Operation.Time.Verfiy
 7/10/2004 10:10:12 7/12/2004 9:18:03  
7/28/2004 05:00:02

Information is mm/dd/year hh:mm:ss (time of day, e.g. the first column 
is July 10th 2004 10:10 AM at 12 seconds)
What is the best way to get the difference between any of the 2 columns? 
And eventually test statistics on the columns (eg. P values, if needed, 
but not a priority at this time)
Thanks in advance

Platform WinXP
IBM T40p
R v 1.8.1
R commander
--
Mark R Laflamme,MD
Regenstrief Institute   
1050 Wishard Blvd RG5
Indianapolis, IN 46202
317 630-7833
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] adjusting the map of France to 1830

2004-11-18 Thread Stephane DRAY
At 19:07 18/11/2004, Ray Brownrigg wrote:
At 16:29 18/11/2004, Michael Friendly wrote:
 I'm doing some analyses of historical data from France in 1830 on 'moral
 statistics' that I'd like to
 show on a map.  I've done most of my analyses in SAS, but a few things
 would work better in R.
 To do this, I have to adjust the modern map,

 library(maps)
 map('france')

 to adjust for changes in departments (86 in 1830, to 97 now).  I've read
 the documentation
 for the maps and maptools package, but there seems to be no functions to
 allow this, and
 I can't find information on the exact structure of map datasets, but I
 understand them to
 be delimited lists of polygon coordinates.

 In SAS, all maps have (one or more) ID variables representing the
 geographical region,
 and there is also a proc gremove that can remove internal boundaries
 inside the polygons
 for regions with the same ID.  Is there some way I can do this in R?

Unfortunately not with the current implementation of several of the
'extra' databases in the mapdata package.  The map() function does have
the interior=FALSE option, which would normally do what you want, but
only when the data has been manipulated to allow it.  Currently this
option is only useful with the world and usa maps (and their
derivatives, such as world2 and state).
Currently every department is a complete polygon, and so every interior
line segment occurs twice in the data.  What has to happen to the data
is for it to be split up into non-overlapping line segments, and each
polygon reconstructed from a list of these line segments (with
direction being important).
There is the gpclib package which computes intersection, union... of 
polygons. I have try to play with its union function and the france data, 
but the results are good but a little bit complicate:
# i merge the two firts polygons:

 departements=map('france')
 which(is.na(departements$x))[1:2]
  [1]   66  122
 gpcA - as(cbind(departements$x[1:65],departements$y[1:65]),gpc.poly)
 gpcB - as(cbind(departements$x[67:121],departements$y[67:121]),gpc.poly)
 union(gpcA,gpcB)
GPC Polygon
   Num. Contours:  1
   Num. Vertices:  74
   BBox (X):  1.563161 -- 4.225965
   BBox (Y):  49.97212 -- 51.09752
 gpcAB-union(gpcA,gpcB)
 
departements$x=c(attr(gpcAB,pts)[[1]]$x,attr(gpcAB,pts)[[1]]$x[1],departements$x[-(1:121)])
 
departements$y=c(attr(gpcAB,pts)[[1]]$y,,attr(gpcAB,pts)[[1]]$y[1],departements$y[-(1:121)])
 map(departements)

Another solution is to do the job in a GIS and to import the new map with 
maptools.

The package gpclib is very intersting and I think that it can be used to 
develop some basic GIS tools. I have write a functions to compute 
intersections for objects of class polys easily.

The only thing is to know for which class of spatial objects these 
functions must be developed !


Stéphane DRAY
-- 

Département des Sciences Biologiques
Université de Montréal, C.P. 6128, succursale centre-ville
Montréal, Québec H3C 3J7, Canada
Tel : (514) 343-6111 poste 1233 Fax : (514) 343-2293
E-mail : [EMAIL PROTECTED]
-- 

Web  http://www.steph280.freesurf.fr/
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Creating logical value from the difference of two absolute values

2004-11-18 Thread Nathan Leon Pace, MD, MStat
Hi,
Using R 2.0.1 on Mac g5 running Mac OS X 10.3.6.
I would expect that
abs(.7 - .5) = abs(.3 - .5) should be returned TRUE.
Instead
 www - abs(.7 - .5) = abs(.3 - .5)
 www
[1] FALSE
Is this a result of floating point or the implementation of abs or 
something else?

In a function I need to compare two absolute values - each being of the 
form |variable - constant|.

Any suggestions for implementing this correctly?
Nathan
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Creating logical value from the difference of two absolut e values

2004-11-18 Thread Liaw, Andy
It's imprecision of floating point representation of real numbers:

 print(abs(.7 - .5) - abs(.3 - .5), digit=20)
[1] -5.551115123125783e-17

one of the first things to learn about programming: be extremely careful
testing for equality of floating point numbers.

Andy


 From: Nathan Leon Pace, MD, MStat
 
 Hi,
 
 Using R 2.0.1 on Mac g5 running Mac OS X 10.3.6.
 
 I would expect that
 
 abs(.7 - .5) = abs(.3 - .5) should be returned TRUE.
 
 Instead
 
   www - abs(.7 - .5) = abs(.3 - .5)
   www
 [1] FALSE
 
 Is this a result of floating point or the implementation of abs or 
 something else?
 
 In a function I need to compare two absolute values - each 
 being of the 
 form |variable - constant|.
 
 Any suggestions for implementing this correctly?
 
 Nathan
 
 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html
 


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] how to get to interesting part of pattern match

2004-11-18 Thread Vadim Ogranovich
Hi,

I am looking for a way to extract an interesting part of the match to
a regular expression. For example the pattern [./](*.) matches a
substring that begins with either . or / followed by anything. I am
interested in this anything w/o the . or / prefix. If say I match
the pattern against abc/foo I want to get foo, not /foo. In Perl
one can simply wrap the interesting part in () and get it out of the
match. Is it possible to do a similar thing in R?

There seems to be a way to refer to the match, see below, but I couldn't
figure out how to make gsub return it.
 gsub([./](*.), \\1, abc/foo)
[1] abcfoo


Thanks,
Vadim

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] NLME plottting and Confidence Intervals

2004-11-18 Thread Greg Tarpinian
All,

I have been learning about mixed models and have been
able to successfully use lme( ) and nlme( ) to fit
some simple linear and 4PL logistic models.  As a 
relative newbie I am at a loss as to how I can do
the following:

(1) Import a SAS dataset with DATE9. formatted time
values and get them converted into a convenient
time variable for use with the nlme package.  In
particular, I would like to use the lattice 
package to produce panel plots for diagnostic and
exploratory purposes.

(2) Plot the fitted model(s) along with appropriate
95% confidence bounds for the model

(3) Obtain prediction intervals for given individuals
in the datasets.

Sorry for what must be trivial questions!  I very
much appreciate any insight.

Thanks,
Greg

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] how to get to interesting part of pattern match

2004-11-18 Thread Jean Eid


sub(.*/, , abc/foo)
[1] foo


Jean

On Thu, 18 Nov 2004, Vadim Ogranovich wrote:

 Hi,

 I am looking for a way to extract an interesting part of the match to
 a regular expression. For example the pattern [./](*.) matches a
 substring that begins with either . or / followed by anything. I am
 interested in this anything w/o the . or / prefix. If say I match
 the pattern against abc/foo I want to get foo, not /foo. In Perl
 one can simply wrap the interesting part in () and get it out of the
 match. Is it possible to do a similar thing in R?

 There seems to be a way to refer to the match, see below, but I couldn't
 figure out how to make gsub return it.
  gsub([./](*.), \\1, abc/foo)
 [1] abcfoo


 Thanks,
 Vadim

 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] The hidden costs of GPL software?

2004-11-18 Thread John Fox
Dear list members,

This has been a stimulating discussion, now spread over three lists.
Although I'd like to address issues that have been raised on all three
lists, I expect that more or less everyone reads r-help, so I'm just posting
these comments there.

(1) As everyone else, I've had experience with a number of other statistical
packages and programming environments in addition to R (including, more
years ago than I care to say, the mainframe predecessor of the MicrOsiris
package mentioned positively in the SCW article cited by Philippe in his
original message). I don't believe that extensive point-and-click GUIs for
broad statistical packages/programming environments such as Stata, R,
S-PLUS, or SAS are very helpful: They tend to be labyrinths that are
difficult to navigate. Some of the suggestions for other kinds of GUIs
(e.g., aids to command specification) seem to me more promising. Moreover, I
don't think that one should expect to learn an extensive system such as R or
SAS without doing some reading. My own experience is that S (i.e.,
encompassing R and S-PLUS) is easier, not harder, to learn than its true
competitors. 

(2) On the other hand, one can build quite nice graphical interfaces to more
limited packages. A couple of examples that I particularly like are SAS JMP
and Cook's and Weisberg's Arc (built on Lisp-Stat).

(3) Similarly, my Rcmdr package was meant to be a limited-purpose GUI,
useful for basic-statistics classes. Its range has grown somewhat to cover
linear and generalized-linear models, and I plan a few more modest
extensions (including the ability to incorporate other classes of
statistical models more easily). As a technical matter, I don't think that
it would be hard (although it would be time-consuming) to produce a much
broader extension, but the result (in my opinion) would be as dubiously
useful as the GUIs for SAS or S-PLUS. By the way, if there were something I
could wish for here it would be a slightly broader set of Tk widgets to be
included with the Tcl/Tk that installs with R for Windows, since using
widgets outside of this set creates installation obstacles for lower-level
users.

(4) Several people have pointed once more to the difficulty that novice
users experience in locating functions to perform particular tasks or in
figuring out how to use them once found. I suspect that even people who have
been using R for a while occasionally have a brain-cramp that leads to a
search through documentation. I know that I do. In my experience, the
various facilities for searching documentation in R work pretty well. 

(5) I think that examples in help files and vignettes can be useful, but are
not substitutes for text-books, manuals, and journal articles. It certainly
should not be the job of statistical software to teach the statistics,
although of course it can be used to help do that. I doubt that many list
members would look favourably on the statistical-methods decision tree in
MicrOsiris, for example. One solution is to include PDF manuals with
packages. I've done this, for example, with my effects and Rcmdr packages.
The introductory manual supplied with Thomas Lumley's survey package is
another, similar example. Maybe there's a better way of integrating such
non-vignette manuals with the help system -- something like
help(manual=package).

(6) As has been pointed out, e.g., by Duncan Murdoch, solving the
function-locating problem is best done by a method or methods that
automatically accommodate the growing and changing set of contributed
packages on CRAN.  Why not, as previously has been proposed, replace the
current static (and, in my view, not very useful) set of keywords in R
documentation with the requirement that package authors supply their own
keywords for each documented object? I believe that this is the intent of
the concept entries in Rd files, but their use certainly is not required or
even actively encouraged. (They're just mentioned in passing in the Writing
R Extensions manual.)


John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] how to get to interesting part of pattern match

2004-11-18 Thread Gabor Grothendieck
Vadim Ogranovich vograno at evafunds.com writes:


: I am looking for a way to extract an interesting part of the match to
: a regular expression. For example the pattern [./](*.) matches a
: substring that begins with either . or / followed by anything. I am
: interested in this anything w/o the . or / prefix. If say I match
: the pattern against abc/foo I want to get foo, not /foo. In Perl
: one can simply wrap the interesting part in () and get it out of the
: match. Is it possible to do a similar thing in R?
: 
: There seems to be a way to refer to the match, see below, but I couldn't
: figure out how to make gsub return it.
:  gsub([./](*.), \\1, abc/foo)
: [1] abcfoo

Assuming what was meant is the following (dot and star are 
transposed and gsub is sub):

sub([./](.*), \\1, abc/foo)

then the regular expression matches /foo and the backreference
contains foo so it replaces /foo with foo which is why it returns
abcfoo .

To get just foo ensure that your regular expression matches 
the entire string so that the entire string is replaced with
the backreference:

sub([^./]*[./](.*), \\1, abc/foo)

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Date time Differences

2004-11-18 Thread Gabor Grothendieck
Mark R Laflamme, MD mlaflamme at regenstrief.org writes:

: 
: Greetings from an R newbie
: 
: Table imported with 4 columns containing Dates and Times, I desire to 
: determine the differences between said columns
: Have loaded the base and chron packages for R commander.  Have tried to 
: use format but without success.  Have tried the Postix commands but 
: error states unused argument (s) (...), even though some of the 
: examples do not use (...) at the end of the command
: 
: Example:
: Table is named GvY1
:   Operation.Time.End  Operation.Time.Dictated   
: Operation.Time.Verfiy
:7/10/2004 10:10:12 7/12/2004 9:18:03  
: 7/28/2004 05:00:02
: 
: Information is mm/dd/year hh:mm:ss (time of day, e.g. the first column 
: is July 10th 2004 10:10 AM at 12 seconds)
: What is the best way to get the difference between any of the 2 columns? 
: And eventually test statistics on the columns (eg. P values, if needed, 
: but not a priority at this time)
: Thanks in advance
: 
: Platform WinXP
: IBM T40p
: R v 1.8.1
: R commander
: 


Often problems with data frames are due to storing the data
as factors rather than in a datetime class but without a 
reproduceable example its impossible to know for sure.  You might 
be able to solve this yourself by reading the article on dates and 
times in R News 4/1.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


  1   2   >