[R] mozilla/firefox search engine AMD64 jre1.5 plugin linux

2005-08-22 Thread laurent buffat
Hi,
I have a problem with the help.start() and the search engine on a AMD64 :
The search engine use the java plugin but the java plugin is not 
available for the jre.1.5 ...

I have a linux box : fedora 4 on 64bit and R2.1.1
When I start the search engine, I had the message that the java plugin 
was missing.
So I try to install manual the java run time jre-1.5 for the AMD64, but 
the plugin was missing
( http://forum.java.sun.com/thread.jspa?threadID=568127tstart=75 )
So I instaled the J2RE blackdown 1.4.2
I obtain the plugin for the 64bit and make the link.

When I restart R and the search engine, the plugin 1.4.2 correctly 
reconnize by mozilla
( about:plugins in the URL windows), and I don't have any more the 
message for the missing
plugin, but, then I try a search, mozilla freeze and I have to kill it :


  help.start()
Making links in per-session dir ...
If '/usr/bin/firefox' is already running, it is *not* restarted, and
you must switch to its window.
Otherwise, be patient ...

UA: Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.7.10) Gecko/20050720 
Fedora/1.0.6-1.1.fc4 Firefox/1.0.6:, extra:  Firefox/1.0.6

[EMAIL PROTECTED] ~]# ps -eaf | grep mozilla

root 13916 13899  0 09:40 pts/1 00:00:00 /bin/sh 
/usr/lib64/firefox-1.0.6 /run-mozilla.sh 
/usr/lib64/firefox-1.0.6/firefox-bin -UILocale fr-FR 
file:///tmp/Rtmpo13829/.R/doc/html/index.html

[EMAIL PROTECTED] ~]# kill 13916

[EMAIL PROTECTED] ~]# /usr/lib64/firefox-1.0.6/firefox: line 227: 13916 
Complété $dist_bin/run-mozilla.sh $script_args 
$dist_bin/$MOZILLA_BIN $@  

#

I am not a system administrator and It's my home computer (so no help ...)
So I need your help ;-)

- For the AMD64 R users : have you the same problem ?
- If yes : How you solve it ?
- If it's not possible to solve, is it possible to  find an alternative 
solution (like to acces of the search engine from an
other computer (windows, linux 32). I don't care about java plugin on 
the mozilla 64 bit, I just want the R help !!!

Thanks.
L. Buffat

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


Re: [R] mozilla/firefox search engine AMD64 jre1.5 plugin linux

2005-08-22 Thread Prof Brian Ripley
This is a 64-bit FC* issue.  I believe we did a year or so ago run i686 
firefox (from mozilla.org) and the Sun Java + plugin on AMD64 FC2.


Note that help.search() will do all that the HTML search engine does, and 
more.


On Windows, you would get help for a different version of R, but i686 
Linux would be fine.  The latter is our solution: we only use AMD64 
machines as servers.


On Mon, 22 Aug 2005, laurent buffat wrote:


Hi,
I have a problem with the help.start() and the search engine on a AMD64 :
The search engine use the java plugin but the java plugin is not
available for the jre.1.5 ...

I have a linux box : fedora 4 on 64bit and R2.1.1
When I start the search engine, I had the message that the java plugin
was missing.
So I try to install manual the java run time jre-1.5 for the AMD64, but
the plugin was missing
( http://forum.java.sun.com/thread.jspa?threadID=568127tstart=75 )
So I instaled the J2RE blackdown 1.4.2
I obtain the plugin for the 64bit and make the link.

When I restart R and the search engine, the plugin 1.4.2 correctly
reconnize by mozilla
( about:plugins in the URL windows), and I don't have any more the
message for the missing
plugin, but, then I try a search, mozilla freeze and I have to kill it :


 help.start()
Making links in per-session dir ...
If '/usr/bin/firefox' is already running, it is *not* restarted, and
   you must switch to its window.
Otherwise, be patient ...

UA: Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.7.10) Gecko/20050720
Fedora/1.0.6-1.1.fc4 Firefox/1.0.6:, extra:  Firefox/1.0.6

[EMAIL PROTECTED] ~]# ps -eaf | grep mozilla

root 13916 13899  0 09:40 pts/1 00:00:00 /bin/sh
/usr/lib64/firefox-1.0.6 /run-mozilla.sh
/usr/lib64/firefox-1.0.6/firefox-bin -UILocale fr-FR
file:///tmp/Rtmpo13829/.R/doc/html/index.html

[EMAIL PROTECTED] ~]# kill 13916

[EMAIL PROTECTED] ~]# /usr/lib64/firefox-1.0.6/firefox: line 227: 13916
Complété $dist_bin/run-mozilla.sh $script_args
$dist_bin/$MOZILLA_BIN $@

#

I am not a system administrator and It's my home computer (so no help ...)
So I need your help ;-)

- For the AMD64 R users : have you the same problem ?
- If yes : How you solve it ?
- If it's not possible to solve, is it possible to  find an alternative
solution (like to acces of the search engine from an
other computer (windows, linux 32). I don't care about java plugin on
the mozilla 64 bit, I just want the R help !!!

Thanks.
L. Buffat


--
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__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] integration

2005-08-22 Thread Fred J.
Hello

after reading few nodes from the info docs. I am not
sure  if this task can be done using R:
the density function f(x,y) = 12xy(1-y) for  
0x1, 0y1
the condition of inequality (x-y) (1/2)
what if the limits of integration are functions of the
variable I am integrating over.
is this somthing which can be done in a simple way,
with R?
examples:
Mathimatic 5.1:
In[2]:=Integrate[12*x*y*(1-y)*Boole[x-y1/2],{y,0,1},{x,0,1}]
Maple:
Doubleint(12*x*y*(1-y)*Heaviside(x-y-1/2),x=0..1,y=0..1);

many thanks

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


Re: [R] integration

2005-08-22 Thread Prof Brian Ripley
Numerical integration: yes.
Symbolic integration: no.

On Mon, 22 Aug 2005, Fred J. wrote:

 after reading few nodes from the info docs. I am not
 sure  if this task can be done using R:
 the density function f(x,y) = 12xy(1-y) for
 0x1, 0y1
 the condition of inequality (x-y) (1/2)
 what if the limits of integration are functions of the
 variable I am integrating over.
 is this somthing which can be done in a simple way,
 with R?
 examples:
 Mathimatic 5.1:
 In[2]:=Integrate[12*x*y*(1-y)*Boole[x-y1/2],{y,0,1},{x,0,1}]
 Maple:
 Doubleint(12*x*y*(1-y)*Heaviside(x-y-1/2),x=0..1,y=0..1);

Symbolic integration: no.
Numerical integration: yes, e.g.

library(adapt)
adapt(2, c(0,0), c(1,1),
   functn=function(x) {y=x[2]; x=x[1]; 12*x*y*(1-y)*(x-y1/2)})

-- 
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

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


[R] reShape question

2005-08-22 Thread Jean-Louis Abitbol
Dear R helpers,

The following output, from Hmisc reShape examples, illustrates how to
reshape from a data frame with repeated measures. 

I would need to do exactly the opposite ie get sbp1 to 3 and dbp1 to 3
from sbp and and dbp.

Is there a way to do that without subsetting,  renaming and binding ?

Many thanks for any help,

Regards, JL

 set.seed(33)
  n - 4
  w - data.frame(age=rnorm(n, 40, 10),
+  sex=sample(c('female','male'), n,TRUE),
+  sbp1=rnorm(n, 120, 15),
+  sbp2=rnorm(n, 120, 15),
+  sbp3=rnorm(n, 120, 15),
+  dbp1=rnorm(n,  80, 15),
+  dbp2=rnorm(n,  80, 15),
+  dbp3=rnorm(n,  80, 15), row.names=letters[1:n])
  options(digits=3)
  w
   agesex sbp1 sbp2 sbp3 dbp1 dbp2  dbp3
a 38.6 female  109  123  131 81.8 90.9  88.9
b 39.6 female  132  120  120 71.1 86.9 110.0
c 50.1   male  131  148  118 73.4 82.8  52.4
d 38.4 female  104  124  125 84.4 83.5  67.1
 reShape(w, base=c('sbp','dbp'), reps=3, timevar='week', times=c(0,3,12))
week  agesex sbp   dbp
a 10 38.6 female 109  81.8
a 23 38.6 female 123  90.9
a 3   12 38.6 female 131  88.9
b 10 39.6 female 132  71.1
b 23 39.6 female 120  86.9
b 3   12 39.6 female 120 110.0
c 10 50.1   male 131  73.4
c 23 50.1   male 148  82.8
c 3   12 50.1   male 118  52.4
d 10 38.4 female 104  84.4
d 23 38.4 female 124  83.5
d 3   12 38.4 female 125  67.1

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


Re: [R] time series plots: labels language tickmarks

2005-08-22 Thread Prof Brian Ripley
On Mon, 22 Aug 2005, javier garcia - CEBAS wrote:

 My native language is spanish and I would need to do two changes in the
 default xlabels in timeseries plots:

What sort of plots are you talking about here?  (Not tsplot or plot.ts, 
for example.)  I think you are perhaps talking about plots of Dates.

 a) For timeseries that span more than one year, there are just xlabs and
 tickmarks for the beginning of each year. Could I add extra tick marks for
 each month easily?

See ?axis.Date, if this is about Dates.

 b) The xlabs appear in my language for months and days (spanish) but I need
 them in English, how can I change this setting?

Use R in an English locale.  (If as the posting guide asked you have told 
us your platform we could have told you how.  If you had shown us some 
reproducible code we would not have had to guess as to what you want to 
do.)

-- 
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

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


Re: [R] time series plots: labels language tickmarks

2005-08-22 Thread Gavin Simpson
On Mon, 2005-08-22 at 13:04 +0100, Prof Brian Ripley wrote:
 On Mon, 22 Aug 2005, javier garcia - CEBAS wrote:
 
  My native language is spanish and I would need to do two changes in the
  default xlabels in timeseries plots:
 
 What sort of plots are you talking about here?  (Not tsplot or plot.ts, 
 for example.)  I think you are perhaps talking about plots of Dates.
 
  a) For timeseries that span more than one year, there are just xlabs and
  tickmarks for the beginning of each year. Could I add extra tick marks for
  each month easily?
 
 See ?axis.Date, if this is about Dates.

If you want the ticks for months unlabelled, then axis.Date() in R v.
2.1.1 and 2.1.1-patched won't allow this. axis.Date() from R-devel
allows you to suppress the labelling of ticks - the change is trivial so
you could get the src of axis.Date for R-devel (e.g. it is here in the
subversion tree:

https://svn.r-project.org/R/trunk/src/library/graphics/R/datetime.R

and use that to create a my.axis.Date() and use this function explicitly
to add axes to your plot for the monthly ticks - until R 2.2.0 is
released anyway - using argument labels = FALSE to suppress the labels
for the monthly ticks.

HTH

G

 
  b) The xlabs appear in my language for months and days (spanish) but I need
  them in English, how can I change this setting?
 
 Use R in an English locale.  (If as the posting guide asked you have told 
 us your platform we could have told you how.  If you had shown us some 
 reproducible code we would not have had to guess as to what you want to 
 do.)
 
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson [T] +44 (0)20 7679 5522
ENSIS Research Fellow [F] +44 (0)20 7679 7565
ENSIS Ltd.  ECRC [E] gavin.simpsonATNOSPAMucl.ac.uk
UCL Department of Geography   [W] http://www.ucl.ac.uk/~ucfagls/cv/
26 Bedford Way[W] http://www.ucl.ac.uk/~ucfagls/
London.  WC1H 0AP.
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

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


[R] vectors of different length in a matrix

2005-08-22 Thread Marten Winter
HI!

I?ve 3 vectors of different length (a,b,c) and want to arrange them in a 
matrix a,b,c as rows and the figures of these vectors in the columns 
(with that matrix i want to calculate a distance between thes vectors - 
vegan - vegdist - horn). Is there a possibilty to create such a matrix 
and to fill up the missing fields with NA?s automatically

Thanx
marten winter
-- 

*Marten Winter*

___

 

UFZ - Umweltforschungszentrum Leipzig-Halle GmbH

Sektion Biozoenoseforschung 

Theodor-Lieser-Straße 4

D-06120 Halle (Saale) 

 

Centre for Environmental Research (UFZ) Leipzig-Halle
Department of Community Ecology
Theodor-Lieser-Str. 4
D-06120 Halle (Saale)
Germany

 

phone: ++49 (0) 345 558-5316

fax:++49 (0) 345 558-5329

E-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]

http://www.halle.ufz.de/bzf/

 

___

 


[[alternative HTML version deleted]]

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

Re: [R] vectors of different length in a matrix

2005-08-22 Thread Jari Oksanen
On Mon, 2005-08-22 at 08:56 -0400, Duncan Murdoch wrote:
 On 8/22/2005 8:45 AM, Marten Winter wrote:
  HI!
  
  I?ve 3 vectors of different length (a,b,c) and want to arrange them in a 
  matrix a,b,c as rows and the figures of these vectors in the columns 
  (with that matrix i want to calculate a distance between thes vectors - 
  vegan - vegdist - horn). Is there a possibilty to create such a matrix 
  and to fill up the missing fields with NA?s automatically
 
 Filling with NA's is the hard part; R normally likes to recycle vectors 
 that are too short.
 
 Here's one way, probably not the best:
 
 x - matrix(NA, 3, max(length(a), length(b), length(c)))
 x[1,seq(along=a)] - a
 x[2,seq(along=b)] - b
 x[3,seq(along=c)] - c
 
 Another way to do it would be to extend all the vectors to the same 
 length by appending NAs, then using rbind.
 
Another issue is that this would fail at the next step outlined in the
original message (vegan - vegdist - horn), since that step won't
accept NAs. So the original schedule was bad. If you fill with zeros,
then the 'vegdist' step would work in the sense that it produces
numbers. I don't know if these numbers would make any sense if the
vectors had nothing to do with each other originally, and columns would
be of mixed meaning after stacking into a matrix. If your vector
elements had identities (names) originally, then you should stack your
data so that entries with the same identity go to the same column. It is
difficult to imagine Horn index used in cases where you don't have these
identities -- specifically species names.  

cheers, jari oksanen
-- 
Jari Oksanen -- Dept Biology, Univ Oulu, 90014 Oulu, Finland
email [EMAIL PROTECTED], homepage http://cc.oulu.fi/~jarioksa/

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


Re: [R] vectors of different length in a matrix

2005-08-22 Thread Jari Oksanen
On Mon, 2005-08-22 at 16:13 +0300, Jari Oksanen wrote:
 On Mon, 2005-08-22 at 08:56 -0400, Duncan Murdoch wrote:
  On 8/22/2005 8:45 AM, Marten Winter wrote:
   HI!
   
   I?ve 3 vectors of different length (a,b,c) and want to arrange them in a 
   matrix a,b,c as rows and the figures of these vectors in the columns 
   (with that matrix i want to calculate a distance between thes vectors - 
   vegan - vegdist - horn). Is there a possibilty to create such a matrix 
   and to fill up the missing fields with NA?s automatically
  
  Filling with NA's is the hard part; R normally likes to recycle vectors 
  that are too short.
  
  Here's one way, probably not the best:
  
  x - matrix(NA, 3, max(length(a), length(b), length(c)))
  x[1,seq(along=a)] - a
  x[2,seq(along=b)] - b
  x[3,seq(along=c)] - c
  
  Another way to do it would be to extend all the vectors to the same 
  length by appending NAs, then using rbind.
  
 Another issue is that this would fail at the next step outlined in the
 original message (vegan - vegdist - horn), since that step won't
 accept NAs. 

Uh. It seems that I should read the package documentation (and posting
guide which tells me to do so): it seems that vegdist() *can* handle
NAs. I do still think that data with NA probably makes no sense with
alternative horn.

cheers, jari oksanen

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


[R] How to add values on the axes of the 3D bi-variable lrm fit?

2005-08-22 Thread Jan Verbesselt
 

Dear r-list,

 

When I try to plot the following 3D lrm fit I obtain only arrows with labels
on the three axes of the figure (without values).

 

fit - lrm(y ~ rcs(x1,knots)+rcs(x2,knots), tol=1e-14,X=T,Y=T)

dd - datadist(x1,x2);options(datadist='dd');

par(mfrow=c(1,1))

plot(fit,x1=NA, x2=NA, theta=50,phi=25)

 

How can I add values to the axes of this plot?  (axes with the range of
values of each of the explanatory variables x1x2)

 

Thanks,

Jan

 

 

___
Ir. Jan Verbesselt
Research Associate
Group of Geomatics Engineering
Department Biosystems ~ M³-BIORES
Vital Decosterstraat 102, 3000 Leuven, Belgium
Tel: +32-16-329750   Fax: +32-16-329760
http://gloveg.kuleuven.ac.be/
___

 


[[alternative HTML version deleted]]

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

[R] How to add legend of plot.Design function ( method=image)?

2005-08-22 Thread Jan Verbesselt
 

Dear Rlist,

 

How can the Legend of the plot.Design() function can be visualized?

 

Following the documentation in R, I did the following (see below), only the
'Legend' function doesn't visualize the legend of the 

plot (method='image') of the lrmfit. I tried to change par( margin setting)
but this didn’t solve it.

 

How can this be solved?

 

Thanks a lot,

Jan

 

 

library(Design)

 n - 1000# define sample size

 set.seed(17) # so can reproduce the results

 age- rnorm(n, 50, 10)

 blood.pressure - rnorm(n, 120, 15)

 cholesterol- rnorm(n, 200, 25)

 sex- factor(sample(c('female','male'), n,TRUE))

 label(age)- 'Age'  # label is in Hmisc

 label(cholesterol)- 'Total Cholesterol'

 label(blood.pressure) - 'Systolic Blood Pressure'

 label(sex)- 'Sex'

 units(cholesterol)- 'mg/dl'   # uses units.default in Hmisc

 units(blood.pressure) - 'mmHg'

 

 # Specify population model for log odds that Y=1

 L - .4*(sex=='male') + .045*(age-50) +

   (log(cholesterol - 10)-5.2)*(-2*(sex=='female') + 2*(sex=='male'))

 # Simulate bin

 ary y to have Prob(y=1) = 1/[1+exp(-L)]

 y - ifelse(runif(n)  plogis(L), 1, 0)

 

 ddist - datadist(age, blood.pressure, cholesterol, sex)

 options(datadist='ddist')

 

 fit - lrm(y ~ blood.pressure + sex * (age + rcs(cholesterol,4)),

x=TRUE, y=TRUE)

 

boundaries - perimeter(age, cholesterol, lowess=TRUE)

plot(age, cholesterol)   # show bivariate data density

lines(boundaries)# and perimeter that will be used for 3-D plot

z - plot(fit, age=NA, cholesterol=NA, perim=boundaries, method='image')

  # draws image() plot

  # don't show estimates where data are sparse

  # doesn't make sense here since vars don't
interact

if(!.R.)Legend(z, fun=plogis, at=qlogis(c(.01,.05,.1,.2,.3,.4,.5)),
zlab='Probability')   # gray scale or color legend for prob.

 

___
Ir. Jan Verbesselt
Research Associate
Group of Geomatics Engineering
Department Biosystems ~ M³-BIORES
Vital Decosterstraat 102, 3000 Leuven, Belgium
Tel: +32-16-329750   Fax: +32-16-329760
http://gloveg.kuleuven.ac.be/
___

 


[[alternative HTML version deleted]]

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

Re: [R] pdf font embedding --- again

2005-08-22 Thread Prof Brian Ripley
On Mon, 22 Aug 2005 [EMAIL PROTECTED] wrote:


 dear R wizards---  I would like to do some book-on-demand printing at a
 popular printer named lulu, but lulu requires inclusion even of the
 basic postscript fonts.  Interestingly, my book itself does not need
 the 14 base acrobat fonts, only the embedded R figures do.  Of course,
 I really would like to get pdftex to embed the fonts, but how to do
 this is not obvious either.  [This method seems to be what the R help
 page is indicating...  The software including the PostScript plot file
 should either embed the font outlines (usually from '.pfb' or '.pfa'
 files) or use DSC comments to instruct the print spooler to do so.)

Why not use the fonts your book does use in the figures?  (That's how
my books are done.)

 So, I would really, really like to embed the necessary fonts with the R
 figures.  I first reread the discussion in this mailing list about
 (eps) font embedding earlier this year.  This was ultimately not very
 helpful.  First, I do not  know how to instruct my embedding program to
 include the fonts that R figures want.  Second, I already start with
 the pdf device, so distilling eps files is not a good option--and it
 would seem a bit crazy to first use the wrong output device
 (postscript), then ship my files over to a windows machine somewhere
 that has distiller installed, run distiller by hand, then ftp them back
 to my linux machine---just for getting the fonts embedded.

 Is it impossible to get R to embed the necessary fonts in its pdf
 output?

Yes, as it has no access to them.  They are not Open Source.  You may be 
able to use URW clones, depending on their licensing conditions.

-- 
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

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


[R] rgui on windows quiting automatically

2005-08-22 Thread Greg Snow
Rgui on my computer has started acting funny (though I expect the 
problem is with my system rather than R, but hopefully someone
here can still help).

I am working with R version 2.11 on windows 2000.

Rgui was working fine, then last week it started acting up.  Now
when I start Rgui (from shorcuts, or the commandline), the GUI
starts up, but before the copyright and version info is printed I
get the closing dialog asking me if I want to save the workspace
(the same one that I get from q()).  If I answer yes or no
then R exits nicely, if I click on cancel then I get the windows
dialog box saying that the program has performed an illeagle
action and will be closed (It says it is creating a log file, but
I have yet to find a log file with anything useful in it on why
the program was closed).

I have tried starting from the command line with the --vanilla
switch, but that does not work either.  

rgui --help and rgui --version do work (but don't run the main
program).

rgui --verbose causes the error and shutdown without the 
quit dialog.

I tried running the older versions of R that were still installed
on my computer, but they behaved the same way (had worked
fine before this).

I did a complete uninstall of all copies of R on the computer, 
downloaded a fresh version of R 2.11 and reinstalled that
(removing all .Rdata files that it may have accessed)
and it is still giving  me the same problem.

rterm still works, so it is something in the GUI portion.

Any help will be appreciated,

Greg Snow, Ph.D.
Statistical Data Center, LDS Hospital
Intermountain Health Care
[EMAIL PROTECTED]
(801) 408-8111

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


[R] pdf font embedding --- again

2005-08-22 Thread ivo_welch-rstat8303

dear R wizards---  I would like to do some book-on-demand printing at a 
popular printer named lulu, but lulu requires inclusion even of the 
basic postscript fonts.  Interestingly, my book itself does not need 
the 14 base acrobat fonts, only the embedded R figures do.  Of course, 
I really would like to get pdftex to embed the fonts, but how to do 
this is not obvious either.  [This method seems to be what the R help 
page is indicating...  The software including the PostScript plot file 
should either embed the font outlines (usually from '.pfb' or '.pfa' 
files) or use DSC comments to instruct the print spooler to do so.)

So, I would really, really like to embed the necessary fonts with the R 
figures.  I first reread the discussion in this mailing list about 
(eps) font embedding earlier this year.  This was ultimately not very 
helpful.  First, I do not  know how to instruct my embedding program to 
include the fonts that R figures want.  Second, I already start with 
the pdf device, so distilling eps files is not a good option--and it 
would seem a bit crazy to first use the wrong output device 
(postscript), then ship my files over to a windows machine somewhere 
that has distiller installed, run distiller by hand, then ftp them back 
to my linux machine---just for getting the fonts embedded.

Is it impossible to get R to embed the necessary fonts in its pdf 
output?

help appreciated.

regards, /iaw
---
ivo welch

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


[R] plotting with same axes

2005-08-22 Thread sms13+
I have used the 'par' command to 
overlay one plot on another.  But how 
do I overlay it with the x-values 
plotted at the same points on the 
x-axis?

Thank you,
Steven

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


[R] lm.ridge again

2005-08-22 Thread daniel
Hello, I have posted this mail a few days ago without any answer:

I have the following doubts related with lm.ridge, from MASS package. To
show the problem using the Longley example, I have the following doubts:

First: I think coefficients from lm(Employed~.,data=longley) should be
equal coefficients from lm.ridge(Employed~.,data=longley, lambda=0) why
it does not happen?
Second: if I have for example
Ridge-lm.ridge(Employed~., data=longley, lambda = seq(0,0.1,0.001)), I
suppose intercept coefficient is defined implicit, why it does not
appear in Ridge$coef?

Third: I suppose that if I define
1) y-longley$Employed
2) X-as.matrix(cbind(1,Longley[,1:6])
3) I as the identity
the following should be true:
 Coef=(X'X+kI)^(-1) X'y
and if a take k=Ridge$kHKV, the coefficients should be approx equal to
Ridge$Coef[near value of kHKV] and it does not seem to happen, why?

Values:
 Ridge$kHKB
[1] 0.004275357

Using the calculation above (third question, third point):
Coef=
  [,1]
  1-0.095492310
  GNP.deflator -0.052759002
  GNP   0.070993540
  Unemployed   -0.004244391
  Armed.Forces -0.005725582
  Population   -0.413341544
  Year  0.048420107

And if I take from Ridgecoef:

Ridge$coef[0.004]
GNP.deflator -0.03098507
GNP -1.32553151
Unemployed -1.53237769
Armed.Forces -0.63334911
Population -0.88690241
Year 6.82105049

Any help, suggestion or orientation?
Thanks in advance
Daniel Rozengardt

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


[R] read a table ignoring specific rows ?

2005-08-22 Thread vincent
Dear R users,
First of all sorry for this question, surely quite naive.
(I searched on the R site but was unable to find by myself).

I have a table, called infile :
1 2 3
4 5 6
7 8 9

I would like to read it and ignore the rows with 1st element  3
I do it now with a for loop, and it's ok,
but I was expecting something simpler, like :

intable  = read.table(infile);
newtable = intable[isgoodrow(intable)];

where :   isgoodrow = function(therow)
{if (therow$V1  3) return(F) else return(T);};

(... but this don't work).

So, could somebody please tell me if there is a way to read
a table ignoring specific rows, without using a for loop ?
... and if yes how ?

Thanks
Vincent

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


Re: [R] plotting with same axes

2005-08-22 Thread Marc Schwartz (via MN)
On Mon, 2005-08-22 at 12:58 -0400, [EMAIL PROTECTED] wrote:
 I have used the 'par' command to 
 overlay one plot on another.  But how 
 do I overlay it with the x-values 
 plotted at the same points on the 
 x-axis?
 
 Thank you,
 Steven

The specific answer depends to an extent on the graphics you are
plotting and whether there is a need to actually use par(new).

In some cases there is an 'add = TRUE' option to plotting functions that
allows for this. 

In others, you can create the initial plot and then use lines(),
points() or the like to simply add further plotting components to the
existing plot.

If all else fails and you need to use par(new), then you will want to
explicitly define the x and y axes to the same ranges by using the same
'xlim' and 'ylim' arguments in _both_ plotting functions. 

A reproducible example of what it is you are doing would enable us to
give you more specific guidance, if the above is not helpful.

HTH,

Marc Schwartz

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


Re: [R] read a table ignoring specific rows ?

2005-08-22 Thread Sean O'Riordain
Can you read in the entire file as a data.frame; and then construct a
new data.frame which excludes some rows?

perhaps something along the lines of...

 fred.file - data.frame()
 fred.file - edit(fred.file)
 fred.file
  colA colB colC
1142
2233
3354
4433
552   25
 fred.new - fred.file[fred.file$colC = 3,]
 fred.new
  colA colB colC
1142
2233
4433

s/


On 22/08/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Dear R users,
 First of all sorry for this question, surely quite naive.
 (I searched on the R site but was unable to find by myself).
 
 I have a table, called infile :
 1 2 3
 4 5 6
 7 8 9
 
 I would like to read it and ignore the rows with 1st element  3
 I do it now with a for loop, and it's ok,
 but I was expecting something simpler, like :
 
 intable  = read.table(infile);
 newtable = intable[isgoodrow(intable)];
 
 where :   isgoodrow = function(therow)
 {if (therow$V1  3) return(F) else return(T);};
 
 (... but this don't work).
 
 So, could somebody please tell me if there is a way to read
 a table ignoring specific rows, without using a for loop ?
 ... and if yes how ?
 
 Thanks
 Vincent
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


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


Re: [R] read a table ignoring specific rows ?

2005-08-22 Thread vincent
Thank you very much to all of you.
Sorry once more for this too simple question.
I have to improve my knowledge about the syntax !
Thanks
Vincent

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


Re: [R] R-help

2005-08-22 Thread Mike Waters
Diego,

Have you checked out the home site for nls2? Specifically the system
requirements page?

http://www.inra.fr/miaj/public/AB/nls2/available.html

That says that nls2 requires a Unix-like operating system. Basically, the
script for building the library is for such systems only, it also depends
upon a lex (flex) library being available.

Regards,

Mike

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of HM Diego Hernán
 Sent: 22 August 2005 18:47
 To: r-help@stat.math.ethz.ch
 Subject: [R] R-help
 
 Hello
 
 I need help with the way to install nls2 library for windows, 
 or the script that can be used for install the nls2 library.
 
 Do you know if this library works in windows?
 
 Best regards.
 
 Diego Rojas
 Cali-Colombia
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html


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


Re: [R] function for two-part or two-condition models

2005-08-22 Thread Richard Chandler
Hello list, Andrew, and Richard, 

I wanted to send you a late thanks your for your suggestions and
mention that I recently stumbled upon what I was looking for in the
VGAM package.  If you're interested, see the help file for zapoisson,
which is based on both a binomial and a poisson distribution. 

Richard

Quoting Remington, Richard [EMAIL PROTECTED]:

 
 Two alternatives to the zero inflated Poisson (ZIP) model are
 mentioned 
 in Jung, Jhun, and Lee (Biometrics, vol 61, no 2, June 2005,
 p626):
 
 Although the ZIP model is more general than the standard Poisson,
 count 
 data with many zeros are often more dispersed than the ZIP model. 
 In 
 this case, the use of a zero-inflated negative binomial (ZINB) 
 distribution or a zero-inflated generalized Poisson distribution is
 a 
 good alternative.
 
 best,
 Richard
 
 -- 
 Richard E. Remington
 Statistician
 KERN Statistical Services, Inc.
 PO Box 1046
 Boise, ID 83701
 Tel: 208.426.0113
 KernStat.com
 
 Andrew Robinson wrote:
  Hi Richard,
  
  I'm not sure that I can imagine how data can have too many zeros
 to be
  fit well with zero-inflated Poisson models. Won't the excess
 zeros be
  accommodated by increasing the the inflation?
  
  In any case, if you want a model that separates the zeros from
 the
  occurrences before fitting a Poisson model to account for
 variation in
  abundance then it might be safest to do that split manually.
  
  Another angle to try is to treat it as a special case of a
 finite
  mixture regression.  I think that some of Jim Lindsey's code will
 fit
  such models. Google can help you find his wbsite.
  
  An MS student of mine explored these models for regeneration
 modeling.
  I'd be happy to send you a pdf of his thesis if it would help.
  
  Cheers,
  
  Andrew
  
  On Mon, Jun 27, 2005 at 03:35:30PM -0400, Richard Chandler
 wrote:
  
 Hello,
 
 This is an (hopefully) improved question of one I posted several
 weeks
 ago. Does anyone know of a function for fitting two-part
 models?
 These models are designed to handle count data with so many
 zeroes
 that they can't be fit well with zero-inflated Poisson models or
 other
 'typical' GLMs. My understanding is that they work by first
 fitting a
 binomial model to separate the zeros from the occurrences
 (positive
 integers) before fitting a Poisson model to account for variation
 in
 abundance. 
 
 I have tried help.search(two-part) and many other similar
 guesses.
 
 Thanks,
 Richard
 
 -- 
 Richard Chandler, M.S. Candidate
 Department of Natural Resources Conservation
 UMass Amherst
 (413)545-1237
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html
  
  
 
 


-- 
Richard Chandler
Department of Natural Resources Conservation
UMass Amherst
(413)545-1237

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


Re: [R] pdf font embedding --- again

2005-08-22 Thread ivo_welch-rstat8303

Thank you---as always.

still, I remain font-desparate.

I would love to use the fonts from my book, but [a] I cannot figure out 
how to do this yet even in the R postscript device; and [b] I am using 
the R pdf device, not the postscript device.  I guess if I can solve 
[a], then I can rewrite all my graphics creations now into the 
postscript device, and replace the dev.off() with something that 
follows it with ps2pdf.  The following attempt, however, does not work:

   afmfiles - c(lbr.afm, lbd.afm, lbi.afm, lbdi.afm, 
lbms.afm);
  Lucida - postscriptFont(Lucida, metrics=afmfiles);
  postscript(file=test.ps, family=Lucida);
  l- 40:80;
  plot(l,l,pch=l);
  dev.off();

By the way, if I try   postscript(family=afmfiles); then I do not get 
an R error, but R 2.1.0 segfaults, which is probably not desirable.  
This occurs even if there is no .afm file in the current directory.


Can I make a suggestion to the R team?It would be nice if I could 
specify a pdf() device parameter that says choose font settings to 
embed all fonts (i.e., do not use fonts that cannot be embedded, 
either).  Something that guarantees me that I get a figure that I can 
give to someone that is fully specified.   Right now, accomplishing 
this is not easy to figure out, and perhaps not even possible.  Yes, in 
the list of font families that R recognizes are some fonts that do not 
seem among the 13 standard fonts (such as URWbookman).  moreover, if I 
choose it as my pdf font family, it is smart enough to use a different 
symbol file ('StandardSymL'), which I hope is also open and not adobe.  
If so, they could be used in principle.  How do I get R to embed 
URWbookman?  ZapfDingbats always seems to be included, so I hope this 
is open and embeddable.

more help would be highly appreciated.

Regards,

/iaw
---
ivo welch

-Original Message-
From: Prof Brian Ripley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Sent: Mon, 22 Aug 2005 17:07:14 +0100 (BST)
Subject: Re: [R] pdf font embedding --- again

On Mon, 22 Aug 2005 [EMAIL PROTECTED] wrote:

 
   dear R wizards--- I would like to do some book-on-demand printing at 
a
  popular printer named lulu, but lulu requires inclusion even of the
  basic postscript fonts. Interestingly, my book itself does not need
   the 14 base acrobat fonts, only the embedded R figures do. Of 
course,
  I really would like to get pdftex to embed the fonts, but how to do
  this is not obvious either. [This method seems to be what the R help
   page is indicating... The software including the PostScript plot 
file
  should either embed the font outlines (usually from '.pfb' or '.pfa'
  files) or use DSC comments to instruct the print spooler to do so.)

 Why not use the fonts your book does use in the figures? (That's how
 my books are done.)

   So, I would really, really like to embed the necessary fonts with 
the R
  figures. I first reread the discussion in this mailing list about
  (eps) font embedding earlier this year. This was ultimately not very
   helpful. First, I do not know how to instruct my embedding program 
to
  include the fonts that R figures want. Second, I already start with
  the pdf device, so distilling eps files is not a good option--and it
  would seem a bit crazy to first use the wrong output device
  (postscript), then ship my files over to a windows machine somewhere
   that has distiller installed, run distiller by hand, then ftp them 
back
  to my linux machine---just for getting the fonts embedded.
 
  Is it impossible to get R to embed the necessary fonts in its pdf
  output?

  Yes, as it has no access to them. They are not Open Source. You may be 
able to use URW clones, depending on their licensing conditions.

 -- 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, UK Fax: +44 1865 272595

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


Re: [R] How to add legend of plot.Design function (method=image)? (if (!.R.) )

2005-08-22 Thread Jan Verbesselt
Hi,

 

When running

 

z - plot(fit, age=NA, cholesterol=NA, perim=boundaries, method='image')

Legend(z, fun=plogis, at=qlogis(c(.01,.05,.1,.2,.3,.4,.5)),
zlab='Probability') 

 

 And after pointing the cursor to the plot() screen in R, I obtain the
following message:

 

Using function locator(2) to place opposite corners of image.legend

Error in Legend.plot.Design(z, fun = plogis, at = qlogis(c(0.01, 0.05,  : 

couldn't find function subplot

 

*How can I position the legend inside the range? (or solve the following
error message).

 

Regards,

Jan

 

 

 

-Original Message-
From: Jan Verbesselt [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 22, 2005 4:59 PM
To: 'r-help@stat.math.ethz.ch'
Subject: How to add legend of plot.Design function ( method=image)?

 

 

Dear Rlist,

 

How can the Legend of the plot.Design() function can be visualized?

 

Following the documentation in R, I did the following (see below), only the
'Legend' function doesn't visualize the legend of the 

plot (method='image') of the lrmfit. I tried to change par( margin setting)
but this didn’t solve it.

 

How can this be solved?

 

Thanks a lot,

Jan

 

 

library(Design)

 n - 1000# define sample size

 set.seed(17) # so can reproduce the results

 age- rnorm(n, 50, 10)

 blood.pressure - rnorm(n, 120, 15)

 cholesterol- rnorm(n, 200, 25)

 sex- factor(sample(c('female','male'), n,TRUE))

 label(age)- 'Age'  # label is in Hmisc

 label(cholesterol)- 'Total Cholesterol'

 label(blood.pressure) - 'Systolic Blood Pressure'

 label(sex)- 'Sex'

 units(cholesterol)- 'mg/dl'   # uses units.default in Hmisc

 units(blood.pressure) - 'mmHg'

 

 # Specify population model for log odds that Y=1

 L - .4*(sex=='male') + .045*(age-50) +

   (log(cholesterol - 10)-5.2)*(-2*(sex=='female') + 2*(sex=='male'))

 # Simulate bin

 ary y to have Prob(y=1) = 1/[1+exp(-L)]

 y - ifelse(runif(n)  plogis(L), 1, 0)

 

 ddist - datadist(age, blood.pressure, cholesterol, sex)

 options(datadist='ddist')

 

 fit - lrm(y ~ blood.pressure + sex * (age + rcs(cholesterol,4)),

x=TRUE, y=TRUE)

 

boundaries - perimeter(age, cholesterol, lowess=TRUE)

plot(age, cholesterol)   # show bivariate data density

lines(boundaries)# and perimeter that will be used for 3-D plot

z - plot(fit, age=NA, cholesterol=NA, perim=boundaries, method='image')

  # draws image() plot

  # don't show estimates where data are sparse

  # doesn't make sense here since vars don't
interact

if(!.R.)Legend(z, fun=plogis, at=qlogis(c(.01,.05,.1,.2,.3,.4,.5)),
zlab='Probability')   # gray scale or color legend for prob.

 

___
Ir. Jan Verbesselt
Research Associate
Group of Geomatics Engineering
Department Biosystems ~ M³-BIORES
Vital Decosterstraat 102, 3000 Leuven, Belgium
Tel: +32-16-329750   Fax: +32-16-329760
http://gloveg.kuleuven.ac.be/
___

 


[[alternative HTML version deleted]]

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

Re: [R] translating output ( latex()....)

2005-08-22 Thread Frank E Harrell Jr
Anne wrote:
 Dear R-helpers
 
 I need to produce statistical output where the annotations are in
 French (and from time to time in German). I produce plots/tables using
 extensively the latex() , summary.formula() ...functions of Hmisc
 which allows me for nice print-out. Up to now I corrected manually
 my latex code , replacing such headings as missing by valeur
 manquante etc. Is there a (simple) way of updating the R functions
 with the translated output? (I would of course gladly make it
 available to the list)
 
 I know my question will sound like an heresy to the vast majority of
 statisticians and I agree it is a waste of statistician time to do
 translations, but it is due to work related constraints (and I fear
 the anti-americanisme primaire encountered in some european
 countries)
 

Anne,

If you were to use a general way to detect the language (using the new 
facilities that Brian Ripley mentioned) and wanted to use that to 
enhance print. and latex. methods for the summary.formula family of 
functions, and know or can learn how to use CVS, we will consider giving 
you access to the Hmisc CVS repository to make the enhancements you want.

Frank

-- 
Frank E Harrell Jr   Professor and Chair   School of Medicine
  Department of Biostatistics   Vanderbilt University

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


Re: [R] How to add legend of plot.Design function (method=image)? (if (!.R.) )

2005-08-22 Thread Frank E Harrell Jr
Jan Verbesselt wrote:
 Hi,
 
  
 
 When running
 
  
 
 z - plot(fit, age=NA, cholesterol=NA, perim=boundaries, method='image')
 
 Legend(z, fun=plogis, at=qlogis(c(.01,.05,.1,.2,.3,.4,.5)),
 zlab='Probability') 
 
  
 
  And after pointing the cursor to the plot() screen in R, I obtain the
 following message:
 
  
 
 Using function locator(2) to place opposite corners of image.legend
 
 Error in Legend.plot.Design(z, fun = plogis, at = qlogis(c(0.01, 0.05,  : 
 
 couldn't find function subplot
 
  
 
 *How can I position the legend inside the range? (or solve the following
 error message).
 
  
 
 Regards,
 
 Jan

The if(!.R.) in the example code was for a reason: I couldn't find 
subplot in R.  If you want to provide code enhancements to do this I 
will incorporate your new code. -Frank

 
  
 
  
 
  
 
 -Original Message-
 From: Jan Verbesselt [mailto:[EMAIL PROTECTED] 
 Sent: Monday, August 22, 2005 4:59 PM
 To: 'r-help@stat.math.ethz.ch'
 Subject: How to add legend of plot.Design function ( method=image)?
 
  
 
  
 
 Dear Rlist,
 
  
 
 How can the Legend of the plot.Design() function can be visualized?
 
  
 
 Following the documentation in R, I did the following (see below), only the
 'Legend' function doesn't visualize the legend of the 
 
 plot (method='image') of the lrmfit. I tried to change par( margin setting)
 but this didn’t solve it.
 
  
 
 How can this be solved?
 
  
 
 Thanks a lot,
 
 Jan
 
  
 
  
 
 library(Design)
 
  n - 1000# define sample size
 
  set.seed(17) # so can reproduce the results
 
  age- rnorm(n, 50, 10)
 
  blood.pressure - rnorm(n, 120, 15)
 
  cholesterol- rnorm(n, 200, 25)
 
  sex- factor(sample(c('female','male'), n,TRUE))
 
  label(age)- 'Age'  # label is in Hmisc
 
  label(cholesterol)- 'Total Cholesterol'
 
  label(blood.pressure) - 'Systolic Blood Pressure'
 
  label(sex)- 'Sex'
 
  units(cholesterol)- 'mg/dl'   # uses units.default in Hmisc
 
  units(blood.pressure) - 'mmHg'
 
  
 
  # Specify population model for log odds that Y=1
 
  L - .4*(sex=='male') + .045*(age-50) +
 
(log(cholesterol - 10)-5.2)*(-2*(sex=='female') + 2*(sex=='male'))
 
  # Simulate bin
 
  ary y to have Prob(y=1) = 1/[1+exp(-L)]
 
  y - ifelse(runif(n)  plogis(L), 1, 0)
 
  
 
  ddist - datadist(age, blood.pressure, cholesterol, sex)
 
  options(datadist='ddist')
 
  
 
  fit - lrm(y ~ blood.pressure + sex * (age + rcs(cholesterol,4)),
 
 x=TRUE, y=TRUE)
 
  
 
 boundaries - perimeter(age, cholesterol, lowess=TRUE)
 
 plot(age, cholesterol)   # show bivariate data density
 
 lines(boundaries)# and perimeter that will be used for 3-D plot
 
 z - plot(fit, age=NA, cholesterol=NA, perim=boundaries, method='image')
 
   # draws image() plot
 
   # don't show estimates where data are sparse
 
   # doesn't make sense here since vars don't
 interact
 
 if(!.R.)Legend(z, fun=plogis, at=qlogis(c(.01,.05,.1,.2,.3,.4,.5)),
 zlab='Probability')   # gray scale or color legend for prob.
 
  
 
 ___
 Ir. Jan Verbesselt
 Research Associate
 Group of Geomatics Engineering
 Department Biosystems ~ M³-BIORES
 Vital Decosterstraat 102, 3000 Leuven, Belgium
 Tel: +32-16-329750   Fax: +32-16-329760
 http://gloveg.kuleuven.ac.be/
 ___
 
  
 
 
   [[alternative HTML version deleted]]
 
 
 
 
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


-- 
Frank E Harrell Jr   Professor and Chair   School of Medicine
  Department of Biostatistics   Vanderbilt University

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


[R] problem building dendrograms to use with heatmap()

2005-08-22 Thread Wittner, Ben
Hi,

I'm trying to build dendrograms to pass to heatmap().
The dendrograms I build plot properly, but when I pass them to heatmap() I get
the error message row dendrogram ordering gave index of wrong length (see
output log below).
I looked in the code of heatmap() and saw that the error was due to a NULL
return value from order.dendrogram(), which in turn got a NULL return value from
unlist(). But I have no idea why unlist() is returning NULL.

I've included code below which reproduces the problem and below that the output
from a run of that code on my computer.

Any help would be greatly appreciated. Thanks in advance.

-Ben

###  begin code  ###

version

dendro.leaf - function(label) {
  ans - list()
  attr(ans, 'members') - 1
  attr(ans, 'height') - 0
  attr(ans, 'leaf') - T
  attr(ans, 'midpoint') - 0
  attr(ans, 'label') - label
  attr(ans, 'class') - 'dendrogram'
  ans
}

dendro.merge - function(d1, d2, height) {
  ans - list(d1, d2)
  members - attr(d1, 'members') + attr(d2, 'members')
  attr(ans, 'members') - members
  attr(ans, 'height') - height
  attr(ans, 'leaf') - F
  attr(ans, 'midpoint') - (members - 1)/2
  attr(ans, 'class') - 'dendrogram'
  ans
}

lc1 - dendro.leaf('c1')
lc2 - dendro.leaf('c2')
lc3 - dendro.leaf('c3')
nc1 - dendro.merge(lc1, lc2, 0.1)
nc2 - dendro.merge(nc1, lc3, 0.2)
plot(nc2)

lr1 - dendro.leaf('r1')
lr2 - dendro.leaf('r2')
lr3 - dendro.leaf('r3')
nr1 - dendro.merge(lr2, lr3, 0.1)
nr2 - dendro.merge(lr1, nr1, 0.3)
plot(nr2)

x - matrix(seq(-1, 1, length.out=9), nrow=3)
rownames(x) - paste('r', 1:3, sep='')
colnames(x) - paste('c', 1:3, sep='')

heatmap(x, Rowv=nr2, Colv=nc2, scale='none')

order.dendrogram(nr2)

unlist(nr2)

###  begin output from run of code above  ##

 version
 _
platform i686-pc-linux-gnu
arch i686 
os   linux-gnu
system   i686, linux-gnu  
status
major2
minor1.1  
year 2005 
month06   
day  20   
language R
 
 dendro.leaf - function(label) {
+   ans - list()
+   attr(ans, 'members') - 1
+   attr(ans, 'height') - 0
+   attr(ans, 'leaf') - T
+   attr(ans, 'midpoint') - 0
+   attr(ans, 'label') - label
+   attr(ans, 'class') - 'dendrogram'
+   ans
+ }
 
 dendro.merge - function(d1, d2, height) {
+   ans - list(d1, d2)
+   members - attr(d1, 'members') + attr(d2, 'members')
+   attr(ans, 'members') - members
+   attr(ans, 'height') - height
+   attr(ans, 'leaf') - F
+   attr(ans, 'midpoint') - (members - 1)/2
+   attr(ans, 'class') - 'dendrogram'
+   ans
+ }
 
 lc1 - dendro.leaf('c1')
 lc2 - dendro.leaf('c2')
 lc3 - dendro.leaf('c3')
 nc1 - dendro.merge(lc1, lc2, 0.1)
 nc2 - dendro.merge(nc1, lc3, 0.2)
 plot(nc2)
 
 lr1 - dendro.leaf('r1')
 lr2 - dendro.leaf('r2')
 lr3 - dendro.leaf('r3')
 nr1 - dendro.merge(lr2, lr3, 0.1)
 nr2 - dendro.merge(lr1, nr1, 0.3)
 plot(nr2)
 
 x - matrix(seq(-1, 1, length.out=9), nrow=3)
 rownames(x) - paste('r', 1:3, sep='')
 colnames(x) - paste('c', 1:3, sep='')
 
 heatmap(x, Rowv=nr2, Colv=nc2, scale='none')
Error in heatmap(x, Rowv = nr2, Colv = nc2, scale = none) : 
row dendrogram ordering gave index of wrong length
 
 order.dendrogram(nr2)
NULL
 
 unlist(nr2)
NULL


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


[R] cbind and rbind

2005-08-22 Thread Tony Evans
Hi, I have been trying for a while to use cbind and rbind to add a row and 
column to the same table but seem to be able only to add one OR the other???

Any help would be most welcome,

Tony Evans
Australia

[[alternative HTML version deleted]]

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


Re: [R] cbind and rbind

2005-08-22 Thread Andy Bunn
Like this?

 x - cbind(rnorm(10), rnorm(10))
# add row total
 x - cbind(x, rowSums(x))
# add col sums
 x - rbind(x, colSums(x))

The KEY to posting to r-help is writing a small example that helpers can
reproduce. When I write one, I often find the answer myself. I often don't
and get eviscerated by some R-guru, but that's part of the fun of it all!

I hope that helps, Andy


 -Original Message-
 From: Tony Evans [mailto:[EMAIL PROTECTED]
 Sent: Monday, August 22, 2005 8:03 PM
 To: Andy Bunn
 Subject: Re: [R] cbind and rbind


 Sorry, I did read the guide but am very new to this.

 I have created a table and have made totals of rows and columns using
 apply() I now want to add these totals to the table.
 I have been able to add one OR the other using cbind and rbind
 but have not
 been able to find a code to add them both.

 I hope this is better information.

 Tony Evans
 Australia

 - Original Message -
 From: Andy Bunn [EMAIL PROTECTED]
 To:  Tony Evans [EMAIL PROTECTED]
 Sent: Tuesday, August 23, 2005 10:02 AM
 Subject: RE: [R] cbind and rbind


  Try reading the posting guide and give a small example of what
 you want to
  try and do...then we can help better.
 
  x - rnorm(10)
  y - rnorm(10)
  z - cbind(x,y)
  w - rbind(z,rnorm(2))
 
 
  -Andy
 
 



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


Re: [R] How to add legend of plot.Design function ( method=image)? (if (!.R.) )

2005-08-22 Thread Greg Snow


Greg Snow, Ph.D.
Statistical Data Center, LDS Hospital
Intermountain Health Care
[EMAIL PROTECTED]
(801) 408-8111

 Frank E Harrell Jr [EMAIL PROTECTED] 08/22/05 03:15PM 
Jan Verbesselt wrote:

[snip discussion of subplot not being in R]


While R does not have the subplot function there is an alternative.

The cnvrt.coords function in the TeachingDemos package has an example
(the bottom set) of doing a rough equivalent to subplot.  This idea
could
be used to implement what you want (margins and text sizes may need
adjustment).

Hope this helps,

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


Re: [R] how to reshape an array avoiding for loops

2005-08-22 Thread Spencer Graves
  Have you considered aperm?  I found this listed under See Also 
for ?t.

  spencer graves

Wladimir Eremeev wrote:

 Dear r-help,
 
   I have an array a1 with dimensions [1:660,1:65,1:25]
   I would like the first dimension to be the last one.
   That is I want and array [1:65,1:25,1:660]
 
   The only way to do this, I know, is
   
   tmp.a-array(dim=dim(a1)[c(2,3,1)])
   for(i in 1:dim(a1)[1]) tmp.a[,,i]-a1[i,,]
   a1-tmp.a
   rm(tmp.a)
 
   
   Is it possible to avoid 'for' loop here?
 
   Thank you!
 
 ---
 Best regards,
 Wladimirmailto:[EMAIL PROTECTED]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

[EMAIL PROTECTED]
www.pdf.com http://www.pdf.com
Tel:  408-938-4420
Fax: 408-280-7915

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


Re: [R] specify seed for Random Number Generator

2005-08-22 Thread Spencer Graves
  Have you considered set.seed?  This was listed with the first hit 
for 'RSiteSearch(random number seed)'.

  spencer graves

Dhiren DSouza wrote:

 I need to generate 100 I.I.D samples from an exponential distribution.  I 
 use rexp(100,parameter).  Is there anyway to specify a seed to determine the 
 first input for the uniform random number generator used to generate these 
 exponentials?
 
 -Dhiren
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

[EMAIL PROTECTED]
www.pdf.com http://www.pdf.com
Tel:  408-938-4420
Fax: 408-280-7915

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