Re: [R] Proposal for New R List: Criticism? Comments?

2004-09-10 Thread Jonathan Baron
On 09/10/04 03:54, Adaikalavan Ramasamy wrote:
There is another issue to be considered. Currently you need to have the
relevant packages installed before help.search() bring it up. My work
around this is to install all available packages just in case the
function I need is nestled in some non-standard packages. I also update
them rather frequently.

I do this too, at my search site (where frequently=monthly) and
you can search functions only, and use Boolean search expressions
and phrases.

But right now the entire set of packages takes about 885 meg (if
I'm reading du correctly), which is less than my very modest
collection of digital photos, and a tiny fraction of a 3-year-old
standard hard disk.  In other words, it is no big deal to install
all the packages if you have your own computer.

Jon
-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron
R search page: http://finzi.psych.upenn.edu/

__
[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] Proposal for New R List: Criticism? Comments?

2004-09-10 Thread Prof Brian Ripley
On Fri, 10 Sep 2004, Jonathan Baron wrote:

 On 09/10/04 03:54, Adaikalavan Ramasamy wrote:
 There is another issue to be considered. Currently you need to have the
 relevant packages installed before help.search() bring it up. My work
 around this is to install all available packages just in case the
 function I need is nestled in some non-standard packages. I also update
 them rather frequently.
 
 I do this too, at my search site (where frequently=monthly) and
 you can search functions only, and use Boolean search expressions
 and phrases.
 
 But right now the entire set of packages takes about 885 meg (if
 I'm reading du correctly), which is less than my very modest
 collection of digital photos, and a tiny fraction of a 3-year-old
 standard hard disk.  In other words, it is no big deal to install
 all the packages if you have your own computer.

I am seeing about 520Mb for all base + CRAN packages under 1.9.1, and it 
will be rather less under 2.0.0 as more parts are stored compressed.
BioC is a lot larger.

It is however, a BIG deal to install *all* the packages and am I currently 
10 short since they depend on other software that I do not have a licence 
for or will not compile (and there are three others I cannot reinstall 
using current gcc).  On AMD64 and Solaris there are several others, and
something like 20 do not install on Windows.  (I could use --install-fake 
as the CRAN checks do, but I have the almost complete set installed to 
test R changes, not test packages.)

So I do see some merit in having a full-text search for R help available
at some URL, as Jonathan has kindly provided.

-- 
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] ccf question

2004-09-10 Thread Kjetil Brinchmann Halvorsen
John Sibert wrote:
Can someone please verify the interpretation of lag in the ccf 
function in the ts package.
Suppose ccf(x,y).
Do negative lags indicate that the events in x precede the events in y 
and positive lags indicate that events in y precede events in x?
Thanks,
John


This you ncan answer for yourself by doing
x - rnorm(200)
ccf(x, lag(x), na.action=na.omit)
and seing the value 1 at lag 1.
Kjetil halvorsen


John Sibert, Manager
Pelagic Fisheries Research Program
University of Hawaii at Manoa
1000 Pope Road, MSB 313
Honolulu, HI 96822
United States
Phone: (808) 956-4109
Fax: (808) 956-4104

Washington DC
Phone: (202) 861 2363
Fax: (202) 861 4767

PFRP Web Site:   http://www.soest.hawaii.edu/PFRP/
email:  [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



--
Kjetil Halvorsen.
Peace is the most effective weapon of mass construction.
  --  Mahdi Elmandjra
__
[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] loading Sjava

2004-09-10 Thread Day, Roger
Apparently further explanation is in order,
to correct some misimpressions.

I was not aware that I was intruding on a private space.
I was directed to the quoted URL for Sjava by the omegahat website,
www.omegahat.org/RSJava,
which states Currently, it is advisable to get the binary from Brian
Ripley's Web site  where the link is provided.  
After a refresh, I see that the page still says that.

I had indeed read three readmes in the SJava distribution, as well as
two
different FAQs (one on the web and one in the distribution,
and some of the documentation for usage.  
I did not read the readme in examples, putting that off, I think
reasonably.  
I have not found the readme which you mention.  
The page www.omegathat.org/RSJava/FAQ.html states you will need version
1.2.0.

My message mentioned R.dll because the FAQ discusses a problem if the
installed
version of R was not compiled as a shareable library.  When I found 
R.dll I concluded that that problem is probably not applicable here.
It's not 
true that I concluded that R.dll was the module referred to.
If 1.6.2 is needed, as you suggest, I do not know yet if I will need 
to compile it with the flag --enable-R-shlib mentioned in the FAQ in
reference
to R.dll.  If anyone already has a 1.6.2 build in binary, I would
appreciate it.

I do appreciate your help, Professor, and will pursue your suggestion
vis a vis 1.6.2.  Moderation of the pejoratives would be nice. 

-Original Message-
From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 10, 2004 9:04 AM
To: Day, Roger
Cc: [EMAIL PROTECTED]
Subject: Re: [R] loading Sjava


On Fri, 10 Sep 2004, Day, Roger wrote:

 I'm excited about SJava, and I'ld love to get it working, but can't 
 get past loading the package.
  
 .First.lib fails on this statement:
  
  library.dynam(SJava, SJava, C:/PROGRA~1/R/rw1091/library)
 Error in dyn.load(x, as.logical(local), as.logical(now)) : 
 unable to load shared library
 C:/PROGRA~1/R/rw1091/library/SJava/libs/SJava.dll:
   LoadLibrary failure:  The specified module could not be found.
 
  
 Actually, SJava.dll is present there.

But who said `SJava.dll' was the `specified module'?  Hint: it is most
likely not, but also you are trying to load a DLL built under R 1.6.2
into R 1.9.1 and that is likely to result in such a message.

 Advice

Read the documentation, especially before posting as the posting guide 
asks.

 I'm using XP.
 Obtained the package from http://www.stats.ox.ac.uk/pub/bdr/SJava/ .

Do learn to read ReadMe's!  That one says

SJava_0.65a.tar.gz  modified sources
SJava.zip   build under R1.6.2

The sources here will build under R 1.6.x and R-devel (1.7.0-to-be).

To install:

Sjava.zip -- unzip in ...\rw1062\library.

and note, not rw1091.

That was a private area, and I have deleted it.  There is a version of 
SJava in the public area http://www.stats.ox.ac.uk/pub/RWin, but do 
practice assiduously your new-found skills at reading ReadMe files.

-- 
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] random seed

2004-09-10 Thread Kosuke Imai
Hi,
  I have a R wrapper function that calls my C code via .C(). In my C code,
I have been calling GetRNGstate() (and PutRNGstate()) once at the
beginning (and the end) of the code. However, if I generate a random
number within the R wrapper function (say via runif()), then my C code
produces the exactly same numbers. If I don't generate a random number 
within the wrapper, it works fine. I wonder if there is something I need 
to do in order to prevent this problem. Any help would be appreciated.
Best,
Kosuke

-
Kosuke Imai   Office: Corwin Hall 041
Assistant Professor   Phone: 609-258-6601 
Department of PoliticseFax:  973-556-1929
Princeton University  Email: [EMAIL PROTECTED]
Princeton, NJ 08544-1012  http://www.princeton.edu/~kimai

__
[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] Proposal for New R List: Criticism? Comments?

2004-09-10 Thread John Fox
Dear Brian et al.,

Jonathan's search site is excellent -- I use it frequently -- and for some
reason new users seem unaware of help.search(), which, despite the fact that
it searches only in installed packages, I also find very useful.

A couple of comments, however: First, if help pages from all packages were
available at a central location -- e.g., at CRAN -- help.search() could have
an option to search that location. Second, I still feel that it would be
useful to provide some other way of searching the space of all available
functions. One idea, which I mentioned in an earlier message on this thread,
would be a keyword system (again, different from the current set of standard
keywords). The keywords could be accessed by help.search() and also compiled
into an index.

Regards,
 John

 -Original Message-
 From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] 
 Sent: Friday, September 10, 2004 5:26 AM
 To: Jonathan Baron
 Cc: Adaikalavan Ramasamy; John Fox; R-help; 'Berton Gunter'
 Subject: Re: [R] Proposal for New R List: Criticism? Comments?
 
 On Fri, 10 Sep 2004, Jonathan Baron wrote:
 
  On 09/10/04 03:54, Adaikalavan Ramasamy wrote:
  There is another issue to be considered. Currently you 
 need to have 
  the relevant packages installed before help.search() bring 
 it up. My 
  work around this is to install all available packages just in case 
  the function I need is nestled in some non-standard 
 packages. I also 
  update them rather frequently.
  
  I do this too, at my search site (where 
 frequently=monthly) and you 
  can search functions only, and use Boolean search expressions and 
  phrases.
  
  But right now the entire set of packages takes about 885 
 meg (if I'm 
  reading du correctly), which is less than my very modest 
 collection of 
  digital photos, and a tiny fraction of a 3-year-old standard hard 
  disk.  In other words, it is no big deal to install all the 
 packages 
  if you have your own computer.
 
 I am seeing about 520Mb for all base + CRAN packages under 
 1.9.1, and it will be rather less under 2.0.0 as more parts 
 are stored compressed.
 BioC is a lot larger.
 
 It is however, a BIG deal to install *all* the packages and 
 am I currently 10 short since they depend on other software 
 that I do not have a licence for or will not compile (and 
 there are three others I cannot reinstall using current gcc). 
  On AMD64 and Solaris there are several others, and something 
 like 20 do not install on Windows.  (I could use 
 --install-fake as the CRAN checks do, but I have the almost 
 complete set installed to test R changes, not test packages.)
 
 So I do see some merit in having a full-text search for R 
 help available at some URL, as Jonathan has kindly provided.
 
 -- 
 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] Re: Bangdiwala

2004-09-10 Thread Martyn Sherriff
I am new to R and would be grateful if somebody could tell me how to access
the Bangdiwala statistic after an agreement plot.
Thanks,
Martyn

Dr. Martyn Sherriff
Senior Lecturer, Dental Biomaterials Science,
GKT Dental Institute,
Floor 17, Guy's Tower,
London Bridge, London SE1 9RT
e-mail: [EMAIL PROTECTED]
Tel. +44(0)-2071-881822
Fax. +44(0)-2071-881823 
Departmental Home Page: http://tinyurl.com/2eotw
Personal Home Page: http://tinyurl.com/kgkd
Youth Rugby: www.fullerians.demon.co.uk
The difference between winners and losers is that winners tell the jokes
and the losers talk about the run of the ball. 
It's not over until the fat man whistles.

__
[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: Bangdiwala

2004-09-10 Thread Sundar Dorai-Raj

Martyn Sherriff wrote:
I am new to R and would be grateful if somebody could tell me how to access
the Bangdiwala statistic after an agreement plot.
Thanks,
Martyn
Martyn,
  Since you didn't say so, I have to guess you are using package:vcd? 
If so, then ?agreementplot says:

quote
Value
Invisibly returned, a list with components
Bangdiwala  the unweighted agreement strength statistic
Bangdiwala.Weighted the weighted statistic
weights the weigtht vector used.
/quote
So you should be able to do the following:
library(vcd)
data(SexualFun)
ap - agreementplot(t(SexualFun))
ap$Bangdiwala
(Please read the posting guide.)
--sundar
__
[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] Proposal for New R List: Criticism? Comments?

2004-09-10 Thread Adaikalavan Ramasamy
Just finished updating and installing new packages from CRAN and
BioConductor (including annotation data) and am happy to say that my R
has just exceeded the 1 GB mark.



On Fri, 2004-09-10 at 10:11, Jonathan Baron wrote:
 On 09/10/04 03:54, Adaikalavan Ramasamy wrote:
 There is another issue to be considered. Currently you need to have the
 relevant packages installed before help.search() bring it up. My work
 around this is to install all available packages just in case the
 function I need is nestled in some non-standard packages. I also update
 them rather frequently.
 
 I do this too, at my search site (where frequently=monthly) and
 you can search functions only, and use Boolean search expressions
 and phrases.
 
 But right now the entire set of packages takes about 885 meg (if
 I'm reading du correctly), which is less than my very modest
 collection of digital photos, and a tiny fraction of a 3-year-old
 standard hard disk.  In other words, it is no big deal to install
 all the packages if you have your own computer.
 
 Jon

__
[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 obtain a 95% envelope for the estimated cumulative risk function from bootstrap samples

2004-09-10 Thread wanr
Hi all,

The hypothetical data is displayed as follows.

ID   time   status 
1 81   0 
2 42   1
3 37   1
4 54   0
5 35   0
6 38   1
7 29   0
8 40   0

Question 1: How to obtain a 95% envelope for the estimated cumulative risk 
function from bootstrap samples? I guess the output of this step consists of 
the envelope and the estimated cumulative risk function.

Question2: bootstrap process will be repeated for n times; then the average 
cumulative risk function was estimated  as the median of the n empirical 
cumulative risk functions. My question is how to plot this so called Average 
Risk Function vs. time easily instead of using lines() and points() to draw 
the above step function?

Thanks in advance.


Rui

__
[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 obtain a 95% envelope for the estimated cumulative risk function from bootstrap samples

2004-09-10 Thread wanr
Hi all,

I am trying to replicate the results from a paper. The problems are in the 
setting of survival analysis.

The hypothetical data is displayed as follows.

ID   time   status 
1 81   0 
2 42   1
3 37   1
4 54   0
5 35   0
6 38   1
7 29   0
8 40   0

Question 1: How to obtain a 95% envelope for the estimated cumulative risk 
function from bootstrap samples? I guess the output of this step consists of 
the envelope and the estimated cumulative risk function.

Question2: bootstrap process will be repeated for n times; then the average 
cumulative risk function was estimated  as the median of the n empirical 
cumulative risk functions. My question is how to plot this so called Average 
Risk Function vs. time easily instead of using lines() and points() to draw 
the above step function?

Thanks in advance.


Rui

__
[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] hclust, centroid

2004-09-10 Thread Tao Shi
Does anyone know how hclust (stats) calculates centroid linkage if only a 
distance matrix can be used as the input?

...Tao
__
[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] Plotting irregular grid as image or persp

2004-09-10 Thread David Forrest
Thanks Deepanyan,


On Sat, 28 Aug 2004, Deepayan Sarkar wrote:
...
 Yes, I think rgl would be the right tool for this. Even apart from the 3d
 acceleration issues, one of the problems with getting this in R would be that R
 doesn't do raster graphics, and I don't think hidden surface algorithms are
 very easy to implement in the R model.
...
 
library(ncdf)
  #  library(rgl)
teapot-open.ncdf(teapot.nc)
 # wget http://www.maplepark.com/~drf5n/extras/teapot.nc
edges-get.var.ncdf(teapot,tris)
vertices-get.var.ncdf(teapot,locations)
 
xy-vertices[c(1,2),] # this would be cooler with ?persp's trans3d
 
plot(1:2,xlim=range(unlist(xy[1,])), ylim=range(xy[2,]),type='n')
apply(edges,2,function(x){polygon(t(xy[,x]))})

 I was playing around with this yesterday and got something similar (but more
 general). I didn't send it to you because I wasn't sure if that's what you
 wanted. Of course, I'm more familiar with the lattice version of trans3d, so it
 uses that. There are 2 versions, one using grid, one with base graphics.

 As I said, there are glitches due to faulty drawing order of the triangles.
 Shading is also possible (as implemented in wireframe), but those calculations
 are done in C code, so it would take a bit longer to carry over.


 library(grid)
 library(lattice)


 plotMesh.grid -
 function(l, z, rot.mat, dist = 0.1)
 ## rot.mat: 4x4 transformation matrix
 ## dist: controls perspective, 0 = none
 {
 x - ltransform3dto3d(l[,z], rot.mat, dist = dist)
 id - seq(length = ncol(x) / 3)
 ord - order(x[3, id * 3] + x[3, id * 3 - 1] +
  x[3, id * 3 - 2])
 grid.newpage()
 xscale - range(x[1,])
 yscale - range(x[2,])
 md - max(diff(xscale), diff(yscale))
 pushViewport(viewport(w = 0.9 * diff(xscale) / md,
   h = 0.9 * diff(yscale) / md,
   xscale = xscale,
   yscale = yscale))
 id -
 as.vector(outer(1:3, (id[ord]-1) * 3, +))
 grid.polygon(x = x[1,id],
  y = x[2,id],
  default.units = native,
  gp = gpar(fill = gray),
  id = rep(id[ord], each = 3))
 }



 plotMesh.base -
 function(l, z, rot.mat, dist = 0.1, subset = TRUE)
 ## rot.mat: 4x4 transformation matrix
 ## dist: controls perspective, 0 = none
 {
 x - ltransform3dto3d(l[,z], rot.mat, dist = dist)
 id - seq(length = ncol(x) / 3)
 ord - order(x[3, id * 3] + x[3, id * 3 - 1] +
  x[3, id * 3 - 2])
 xscale - range(x[1,])
 yscale - range(x[2,])
 plot(xscale, yscale, type = n)
 x - cbind(x, NA)
 id -
 as.vector(rbind(outer(1:3, (id[ord]-1) * 3, +),
 ncol(x)))
 polygon(x = x[1,id],
 y = x[2,id],
 col = gray)
 }


 rot.mat - ltransform3dMatrix(list(y = -30, x = 40))
 plotMesh.grid(l, z, rot.mat, dist = 0)
 plotMesh.base(l, z, rot.mat, dist = 0)

Those are nice -- I did want a varying color however, and needed to
separate the calls to polygon:

 plotMesh.base-function(vertices,edges,col,rot.mat=diag(4),dist=0.1,...){
  ## rot.mat a 4x4 homogeneous transformation matrix
  ## dist: controls perpective per lattice::ltransform3dto3d

  # rotate
  vertices-ltransform3dto3d(vertices,rot.mat,dist)
xscale - range(vertices[1,])
yscale - range(vertices[2,])
plot(xscale, yscale, type = n)

  # find rough plot order

  ord-order(apply(edges,2,function(x){sum(vertices[3,x])}))

  if (length(col) == 1){
sapply(ord,function(x){
  polygon(vertices[1,edges[,x]],vertices[2,edges[,x]],col=col,...)})
  } else {
sapply(ord,function(x){
  polygon(vertices[1,edges[,x]],vertices[2,edges[,x]],col=col[x],...)})
  }
  invisible(ord)
 }

rot.mat - ltransform3dMatrix(list(z=45,y=30)) #;rot.mat

plotMesh.base(l,z,rot.mat=rot.mat,col=rainbow(dim(z)[2]),lty=0)


and the resultant image is:

   http://www.maplepark.com/~drf5n/images/teapot2.png


I posted some really rough notes at
http://www.maplepark.com/~drf5n/cgi-bin/wiki.cgi?RMeshVisualization

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