Re: [R] Creating Surface Plots in R

2003-06-24 Thread Petr Pikal
Hallo

On 24 Jun 2003 at 6:20, Neil Osborne wrote:

> Hi,
> 
> I have three columns of data in afile that I would like to analyse by
> means of a surface plot. I would be very grateful if anyone could show
> me how to create a surface plot from this data (once it has been
> imported into a dataframe).

I usually use interp() from akima library as a prerequisite to image, 
contour or persp plots.

> 
> Thanks
> 
> _
> Tired of 56k? Get a FREE BT Broadband connection
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Cheers
Petr Pikal
[EMAIL PROTECTED]
[EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] GeoR: Nested Models for Spatial Data

2003-06-24 Thread Rudi Dutter
Dear Colleagues,

Does anyone know how to specify nested models for kriging (krige.conv) in the
function
cov.spatial
?

I have understood that I can specify a matrix of parameters using 'cov.pars = '.
However, then I should specify the kind of model for each row of the matrix. The
parameter 'cov.model' only accepts one keyword. Is this a bug?

Many thanks,
Rudi Dutter

-- 
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
From: Prof. Dr. Rudolf Dutter
  Dept. of Statistics and Probability Theory
  Vienna University of Technology,
  Wiedner Hauptstr. 8-10
  A-1040 Vienna, Austria
  Tel. +43 1 58801/10730
  FAX  +43 1 58801/10799
  E-Mail: [EMAIL PROTECTED]
  Internet: http://www.statistik.tuwien.ac.at/public/dutt/
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] ?plot problem

2003-06-24 Thread Hotz, T.


> -Original Message-
> From: Prof Brian Ripley [mailto:[EMAIL PROTECTED]
> Sent: 23 June 2003 22:35
> To: Paul, David A
> Cc: [EMAIL PROTECTED]
> Subject: Re: [R] ?plot problem
> 
> 
> On Mon, 23 Jun 2003, Paul, David  A wrote:
> 
> > R1.7.0, Win2k:
> > 
> > When I use plot( ) on a groupedData object,
> > if I have 165 subjects I'm supposed to be able
> > to use plot(..., layout = c(5,3,11)) to get
> > all 165 on 11 separate sheets.  The graphics
> > window is only displaying the first 10.  If I
> > use plot(..., layout = c(5,3,12)) I get the 
> > appropriate 11 sheets.
> > 
> > Furthermore, yesterday I noticed that when using
> > plot(  ) along with the
> > "record" feature, after using "Page Up" to scroll
> > up through the graphs, I was unable to scroll
> > back down to the last (fourth) graph to see
> > the Cook's Distance plot, though the first three
> > plots remained "scollable".
> > 
> > What is going on?  Does R for Windows have issues
> > with the last plot in a series of plots?
> 
> Perhaps recording does, as people have reported similar things, but
> neither Duncan nor I could reproduce them.  I've just tried several
> plot.lm examples, and it worked flawlessly.  We can't help you further
> unless you can produce reproducible examples.

I can reproduce this behaviour which has been discussed several
times on this list as far as I remember.

After turning plot history on, execute

> plot(lm(I(sin(1:10)~I(1:10

and have a look at all plots.

If you then step back using PgUp, and step forward again with PgDn,
the last plot can't be reached. This is because it was never finished;
R plots don't know whether you still want to add something, so this plot
hasn't been "saved" yet. The solution is to "add" the plot first,
using INS (or History_Add), or create another plot, or,... That finishes
the plot, and makes it available in the history.

Hope that helps.

Thomas

> version
 _  
platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status  
major1  
minor7.0
year 2003   
month04 
day  16 
language R  

---

Thomas Hotz
Research Associate in Medical Statistics
University of Leicester
United Kingdom

Department of Epidemiology and Public Health
22-28 Princess Road West
Leicester
LE1 6TP
Tel +44 116 252-5410
Fax +44 116 252-5423

Division of Medicine for the Elderly
Department of Medicine
The Glenfield Hospital
Leicester
LE3 9QP
Tel +44 116 256-3643
Fax +44 116 232-2976

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Smooth of a temporal serie

2003-06-24 Thread Hotz, T.
If you are talking about a running median smooth à la Tukey,

smooth() in library(eda) might be of help.

Best wishes

Thomas


> -Original Message-
> From: Henrique Patrício Sant'Anna Branco
> [mailto:[EMAIL PROTECTED]
> Sent: 23 June 2003 23:53
> To: [EMAIL PROTECTED]
> Subject: [R] Smooth of a temporal serie
> 
> 
> Hello all,
> 
> I'm a new member in this list and, also, a new R user and need some
> information about Resistant Smooth (using medians).
> The method I need of Resistant Smooth is the 4253H one and I 
> didn't found
> how to perform that in R.
> Does anybody have an idea?
> 
> Thanks,
> Henrique.
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

---

Thomas Hotz
Research Associate in Medical Statistics
University of Leicester
United Kingdom

Department of Epidemiology and Public Health
22-28 Princess Road West
Leicester
LE1 6TP
Tel +44 116 252-5410
Fax +44 116 252-5423

Division of Medicine for the Elderly
Department of Medicine
The Glenfield Hospital
Leicester
LE3 9QP
Tel +44 116 256-3643
Fax +44 116 232-2976

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] R and Latex's tables

2003-06-24 Thread vincent . stoliaroff
Hi R lovers!

I have discovered recently that graph can be exported from R in a Latex
compatible file
thanks to the pictex command

I would like to know if there is the equivalent while exporting datas.
Let's say I have a matrix, a data.frame or a list that I would like to
export as a flat text file that is immediatly transcripted into a table
into latex
Is there a macro or package that could transcript it with the tabular or
array environment command, ...

\begin{tabular/array}
..&.&. \\

etc

It would be easier than to use the write.table() function and then
transform my txt file into a latex table manually

thanks a lot





*
Ce message et toutes les pieces jointes (ci-apres le "message") sont
confidentiels et etablis a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite. 
Tout message electronique est susceptible d'alteration. 
La SOCIETE GENERALE et ses filiales declinent toute responsabilite au 
titre de ce message s'il a ete altere, deforme ou falsifie.

This message and any attachments (the "message") are confidentia... {{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] R and Latex's tables

2003-06-24 Thread Hotz, T.
Package Hmisc by Prof. Frank E Harrell (new windows versions just 
announced!) has a lot of functions to do that.

Also, have a look at package Sweave by Friedrich Leisch, which allows
to combine Latex and R commands.

Hope that helps.

Best wishes

Thomas


> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: 24 June 2003 10:30
> To: [EMAIL PROTECTED]
> Subject: [R] R and Latex's tables
> 
> 
> Hi R lovers!
> 
> I have discovered recently that graph can be exported from R 
> in a Latex
> compatible file
> thanks to the pictex command
> 
> I would like to know if there is the equivalent while exporting datas.
> Let's say I have a matrix, a data.frame or a list that I would like to
> export as a flat text file that is immediatly transcripted 
> into a table
> into latex
> Is there a macro or package that could transcript it with the 
> tabular or
> array environment command, ...
> 
> \begin{tabular/array}
> ..&.&. \\
> 
> etc
> 
> It would be easier than to use the write.table() function and then
> transform my txt file into a latex table manually
> 
> thanks a lot
> 
> 
> 
> 
> 
> **
> ***
> Ce message et toutes les pieces jointes (ci-apres le "message") sont
> confidentiels et etablis a l'intention exclusive de ses destinataires.
> Toute utilisation ou diffusion non autorisee est interdite. 
> Tout message electronique est susceptible d'alteration. 
> La SOCIETE GENERALE et ses filiales declinent toute responsabilite au 
> titre de ce message s'il a ete altere, deforme ou falsifie.
>   
> This message and any attachments (the "message") are 
> confidentia... {{dropped}}
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

---

Thomas Hotz
Research Associate in Medical Statistics
University of Leicester
United Kingdom

Department of Epidemiology and Public Health
22-28 Princess Road West
Leicester
LE1 6TP
Tel +44 116 252-5410
Fax +44 116 252-5423

Division of Medicine for the Elderly
Department of Medicine
The Glenfield Hospital
Leicester
LE3 9QP
Tel +44 116 256-3643
Fax +44 116 232-2976

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] R and Latex's tables

2003-06-24 Thread Jonathan Baron
On 06/24/03 11:29, [EMAIL PROTECTED] wrote:
>Hi R lovers!
>
>I have discovered recently that graph can be exported from R in a Latex
>compatible file
>thanks to the pictex command
>
>I would like to know if there is the equivalent while exporting datas.
>Let's say I have a matrix, a data.frame or a list that I would like to
>export as a flat text file that is immediatly transcripted into a table
>into latex
>Is there a macro or package that could transcript it with the tabular or
>array environment command, ...

The xtable package does a lot of this.

-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
R page:   http://finzi.psych.upenn.edu/

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Locating an executable from R

2003-06-24 Thread Søren Højsgaard
Hi !
>From within R (on windows) I would like to locate and invoke an executable program 
>(whose location is unknown to me).
Can I do that?
Thanks in advance
Søren Højsgaard
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Locating an executable from R

2003-06-24 Thread Henrik Bengtsson
Something like

findFile <- function(pattern, path=Sys.getenv("PATH"), split=";", ...) {
  path <- unlist(strsplit(path, split=split));
  list.files(path=path, pattern=pattern, full.names=TRUE, ...);
}

findFile("^expl.*[.]exe$")
findFile("^notepad[.]exe$")

Cheers

Henrik Bengtsson
Lund University, Sweden

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Søren Højsgaard
> Sent: den 24 juni 2003 11:49
> To: [EMAIL PROTECTED]
> Subject: [R] Locating an executable from R
> 
> 
> Hi !
> >From within R (on windows) I would like to locate and invoke an 
> >executable program (whose location is unknown to me).
> Can I do that?
> Thanks in advance
> Søren Højsgaard
>   [[alternative HTML version deleted]]
> 
> __
> [EMAIL PROTECTED] mailing list 
> https://www.stat.math.ethz.ch/mailman/listinfo> /r-help
> 
> 
>

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Lwd ignored when printing on Windows

2003-06-24 Thread Liaw, Andy
Thanks to Sundar and Prof. Ripley.  It was a false alarm.  It's
just hard to tell that lwd and lty are being respected in the
printed output.  We have a HP4050 Laserjet.  I used "print to
File" in the print dialog to write to a ps file and look at it
in Gsview.  I had to magnify it quite a bit to be able to tell
That lty=2 and 3 are dashes and dots.  Also, as Sundar said,
lwd is only apparent when several values are used on the same
plot.

Cheers,
Andy

> From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] 
> 
> What printer driver are you using?
> 
> I've just tried this and it works exactly as one would expect 
> on my HP 
> 970CXi, as well as cut-and-paste into other applications.  It 
> also worked 
> printing to Acrobat Distiller (although all the lines were 
> thinner there 
> than on-screen and on the 970CXi, the ratio was still 1:5).
> 
> We've been here before, and had to abandon some optimizations 
> because of a bug in interpreting Windows metafiles in Word.
> 
> On Mon, 23 Jun 2003, Sundar Dorai-Raj wrote:
> 
> > Andy,
> >I've experienced the same thing. What's interesting is that 
> > printing
> > a plot (CTRL-P) with lwd = 25 makes lines on the hardcopy 
> look like lwd 
> > = 5. I'm using R1.7.1 on Win2000Pro.
> > 
> > Regards,
> > Sundar
> > 
> > Liaw, Andy wrote:
> > > Dear R-help,
> > > 
> > > Has anyone notice the problem that, on Windows (NT and XP), when 
> > > printing a graph using the "File -> Print..." menu in the 
> graphics 
> > > window to print the graph, that line width seemed to be 
> ignored in 
> > > the printed output?  For example, if I make a plot with 
> plot(1:10, 
> > > type="l", lwd=5), it looks right on screen, but when printed out 
> > > using the menu, it looks like the plot was made with lwd=1.  I've 
> > > had this problem for quite a while (at least since
> > > 1.3.x) and still present in 1.7.1.  Has anyone else seen 
> this, or just me?
> > > 
> > > Best,
> > > Andy
> > > 
> > > Andy Liaw, PhD
> > > Biometrics Research  PO Box 2000, RY33-300 
> > > Merck Research Labs   Rahway, NJ 07065
> > > mailto:[EMAIL PROTECTED]    
>   732-594-0820
> > > 
> > > 
> > > 
> > > 
> 
> > > --
> > > Notice: This e-mail message, together with any 
> attachments, cont... {{dropped}}
> > > 
> > > __
> > > [EMAIL PROTECTED] mailing list 
> > > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > >
> > 
> > __
> > [EMAIL PROTECTED] mailing list 
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > 
> 
> -- 
> 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
> 
> 

--
Notice: This e-mail message, together with any attachments, cont... {{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] [OFF] stepwise using REML???

2003-06-24 Thread Ronaldo Reis Jr.
Em Dom 22 Jun 2003 11:18, Douglas Bates escreveu:
> > For nested design it may be very dangerous due the difference in
> > variance structure, mainly in a splitplot design. ML make
> > significative variables that REML dont make.
>
> It would be good to quote an example that shows this.  I'm not sure
> that this occurs in general.

Look this example:

Using stepwise with a ML estimation:
--
m0.ml <- lme(response~1,random=~1|plot1/plot2,method="ML")
mfull.ml <- update(m0.ml,.~.+v1*v2+v1*v3)
> stepAIC(mfull.ml)
Start:  AIC= 250.23 
 response ~ v1 + v2 + v3 + v1:v2 + v1:v3 

   DfAIC
- v1:v311 249.82
250.23
- v1:v2 2 253.65

...

Linear mixed-effects model fit by maximum likelihood
  Data: NULL 
  Log-likelihood: -112.9370
  Fixed: response ~ v1 + v2 + v1:v2 
(Intercept)   v1   v2l2 
 12.5936495  -0.3327049 -15.9920774 
   v2l3 v1:v2l2 v1:v2l3 
-12.5285727   0.3750894   0.3014936 

Random effects:
 Formula: ~1 | plot1
(Intercept)
StdDev: 0.004214203

 Formula: ~1 | plot2 %in% plot1
(Intercept)  Residual
StdDev:   0.3051747 0.5556307

Number of Observations: 124
Number of Groups: 
plot1  plot2 %in% plot1 
617 
--
in this case the selected model is v1*v2, but in this case it use the same 
denominator DF for all variables, and it is not true.

In anova made by REML:
--
m0 <- lme(response~1,random=~1|plot1/plot2)
mfull <- update(m0,.~.+v1*v2+v1*v3)
anova(mfull)
 numDF denDF   F-value p-value
(Intercept)  185 126.08414  <.0001
v1   1 8   1.86229  0.2095
v2   2 3   1.90189  0.2928
v3  1185   1.58872  0.1167
v1:v22 8   3.53897  0.0792
v1:v3   1185   1.71976  0.0825
---

In this case all variables are not significative.

>
> > I read an article that is made a stepwise procedure using GENSTAT.
> >
> > from article:
> > "Terms were dropped from a model in a stepwise procedure by assessing the
> > change in deviance between the full model and the submodel."
> >
> > All are made using REML.
> >
> > It is possible?! I dont know GENSTAT.
>
> You would need to be more specific about how the comparisons are made.
> I assume that you plan to keep the random effects structure constant
> and compare two nested models that differ only in the fixed effects
> terms.  I can think of four ways of doing this:
>
> 1) Use the F-test obtained by fitting the full model and conditioning
> on the estimates of the random effects parameters.  This is what the
> anova function applied to an model fit by lme gives.
>
> 2) Fit both models and compare the values of the REML criterion in a
> likelihood ratio test.
>
> 3) Fit both models by REML and compare the values of the
> log-likelihood (i.e. the ML criterion) in a likelihood ratio test.
> You can obtain that value with logLik(fm, REML=FALSE) if fm is your
> fitted model.
>
> 4)Fit both models and evaluate the REML criterion for the full model
> at the two sets of estimates.  Compare these values in a likelihood
> ratio test.
>
> I feel that 1) is appropriate, 2) is inappropriate, 3) may be
> appropriate and 4) looks interesting.  4) is based on recent work by
> Greg Reinsel.
>
> In some simulations reported in chapter 3 of Pinheiro and Bates (2000)
> 3) fared badly compared to 1).
>
>

Thanks for all
 __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help

-- 
Nothing is but what is not.
--
|   // | \\   [***]
|> ( õ   õ )  [Ronaldo Reis Júnior]
|  V  [UFV/DBA-Entomologia]
|>  / \   [36571-000 Viçosa - MG  ]
|  /(.''`.)\  [Fone: 31-3899-2532 ]
|>/(: :'  :)\ [EMAIL PROTECTED]]
|/ (`. `'` ) \[ICQ#: 5692561 | LinuxUser#: 205366 ]
|>  ( `-  )   [***]
|>> _/   \_Powered by GNU/Debian Woody/Sarge

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] ?plot problem

2003-06-24 Thread Paul, David A
Thanks to Dr. Thomas Hotz, Prof. Brian Ripley, Dr. Dennis
Murphy, and Dr. David Scott for their replies.

Trying an idea:

> x <- c(1,2,3,4)
> y<-c(2,4.2,5.9,9)
> temp<-data.frame(cbind(x,y))
> attach(temp)
> temp.lm <- lm(y~x)
> windows()
> plot(temp.lm)
Hit  to see next plot: 
Hit  to see next plot: 
Hit  to see next plot: 
Hit  to see next plot: 
> dev.off()
> windows()

I was unable to see the Cook's distance plot as before (using
the Page Up and Page Down keys).  So I implemented another
suggestion:

> windows()
> plot(temp.lm)
Hit  to see next plot: 
Hit  to see next plot: 
Hit  to see next plot: 
Hit  to see next plot: 
[Use Menu: History|Add]

After doing this, the Cook's distance plot was "saved" so that
Page Up and Page Down worked properly.  Question:  Is there
a way to use a line command to "add" the last graph to the
history?


Much thanks again,
  david paul

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] help on R programming.

2003-06-24 Thread Murad Nayal


thanks you all for the replies, it's been very helpful.

regards

Prof Brian Ripley wrote:
> 
> On Mon, 23 Jun 2003, Murad Nayal wrote:
> 
> > - what is the correct way to -remove- a component from a list. this
> > seems to do the trick: list[[1]] = NULL, however, you'd think this
> > should simply attach a NULL object at the first component position?
> 
> This is in the FAQ, section 3.3.3, and is an S/R difference that catches
> people quite often.  It's related to the difference between [] and [[]].
> 
> Generally you will find that it is better to program by generating whole
> lists with lapply() or to copy lists retaining what you want (which does
> not copy the components, in general, and so is cheap).
> 
> As for your comments on books: `S Programming' does discuss the design of
> classes (both informal and formal), the main data sructures in R. As
> others have said, the Green Book (Chambers, 1998) is by not means out of
> date, except in the sense that the precise langage it describes has never
> been available: it is not a description of any version of S-PLUS nor R.
> 
> Generally, though, you need to make sure you have at your fingertips the
> resources which come with R: the various manuals (including R-lang) and
> the on-line help.  For example, I have just spend several days documenting
> in the help pages exactly how subscripting of data frames works (and
> correcting dozens of anomalies and bugs).
> 
> --
> 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://www.stat.math.ethz.ch/mailman/listinfo/r-help

-- 
Murad Nayal M.D. Ph.D.
Department of Biochemistry and Molecular Biophysics
College of Physicians and Surgeons of Columbia University
630 West 168th Street. New York, NY 10032
Tel: 212-305-6884   Fax: 212-305-6926

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Haw I get best lambda in box-cox

2003-06-24 Thread crirocha

Hi all,

Does anyone know of a function that return the best lambda in box-cox
transformation?

many thanks for any help.


-- 
Cristiane S. Rocha
Laboratorio Genoma Funcional - Bioinformática
Centro de Biologia Molecular e Engenharia Genetica
Universidade Estadual de Campinas
Campinas - SP - Brasil
Tel:(19)3788-1119

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Haw I get best lambda in box-cox

2003-06-24 Thread Liaw, Andy
1.  Look up boxcox() in the package "MASS".

2.  Assume "bc" is an object returned by boxcox(...), you can do

  with(bc, x[which.max(y)])

to find the best lambda.

HTH,
Andy

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, June 24, 2003 10:22 AM
> To: [EMAIL PROTECTED]
> Subject: [R] Haw I get best lambda in box-cox
> 
> 
> 
> Hi all,
> 
> Does anyone know of a function that return the best lambda in 
> box-cox transformation?
> 
> many thanks for any help.
> 
> 
> -- 
> Cristiane S. Rocha
> Laboratorio Genoma Funcional - Bioinformática
> Centro de Biologia Molecular e Engenharia Genetica
> Universidade Estadual de Campinas
> Campinas - SP - Brasil
> Tel:(19)3788-1119
> 
> __
> [EMAIL PROTECTED] mailing list 
> https://www.stat.math.ethz.ch/mailman/listinfo> /r-help
> 

--
Notice: This e-mail message, together with any attachments, cont... {{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] R and Latex's tables

2003-06-24 Thread Wolfgang Viechtbauer
> Package Hmisc by Prof. Frank E Harrell (new windows versions just
> announced!) has a lot of functions to do that.
>
> Also, have a look at package Sweave by Friedrich Leisch, which allows
> to combine Latex and R commands.

And package xtable.

--
Wolfgang Viechtbauer

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Haw I get best lambda in box-cox

2003-06-24 Thread Spencer Graves
"boxcox" in library(MASS).  I found it just now via "www.r-project.org" 
-> search -> "R Site Search" and via the index in Venables and Riply 
(2002) Modern Applied Statistics with S, 4th ed. (Springer).  The latter 
(p. 171-172) described how to make the corresponding profile likelihood 
plot using their function "logtrans".

hth.  spencer graves

[EMAIL PROTECTED] wrote:
Hi all,

Does anyone know of a function that return the best lambda in box-cox
transformation?
many thanks for any help.


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] excel files and R

2003-06-24 Thread Victor H. Marím
Greetings everyone,
 
I am new at R.  My questions is rather basic.  Looking R manuals looks
like there should be a way to read MS excel files into R.  Could
somebody tell me which library should I use for that?
 
Thanks in advance
 
Victor H. Marín
Laboratorio de Modelación Ecológica
Depto. de Ciencias Ecológicas, Fac. de Ciencias, 
Universidad de Chile
Casilla 653 Santiago, Chile
http://antar.uchile.cl
 

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] R-1.7.1 regression test failure on alphaev68-dec-osf5.1

2003-06-24 Thread Jeff Lewis
I'm attempting to compile and install R version 1.7.1 for my statistical
geneticists.  It seems to compile correctly -- that is, it compiles
without errors -- but the regression test is failing in the following
manner:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> ## log
> stopifnot(all.equal(log(1:10), log(1:10, exp(1
> stopifnot(all.equal(log10(30), log(30, 10)))
> stopifnot(all.equal(log2(2^pi), 2^log2(pi)))
> stopifnot(Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps)
Error: Mod(pi - log(exp(pi * (0+1i)))/(0+1i)) < .Machine$double.eps is
not TRUE
Execution halted
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

I'm compiling on Tru64UNIX 5.1A using DECs C and Fortran compilers and
perl 5.6.0.  I found the above error in a file named
'reg-tests-1.Rout.fail'.  Any help you can give me would be most
appreciated.

Thanks,
Jeff

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] errorest: Error in cv.numeric()

2003-06-24 Thread Steffen Neumann

Hi,

I am trying to get an error estimation 
for a classification done using lda.

The examples work fine, however I don't get 
my own code to work.

The data is in object d

> d
class hydrophobicitycharge geometry
1   2  6490.0400 1434.9700610.99902
2   2  1602.0601  400.6030  -5824.0
3   2   969.0060  260.1360   -415.0
4   1   527.2310  158.7020-22.00010
...
180 1   299.5190   85.9201   -680.0
181 2  1385.6801  298.8360   -353.0
182 1   428.8740  130.8020   -328.0
183 1   287.5540   98.0767 34.0

Since predict.lda does not return simply the classification 
it is wrapped, as in the docs:

mypredict.lda <- function(object, newdata) predict(object, newdata = 
newdata)$class

In trying errorest() I get the message

> errorest(class ~ hydrophobicity + charge, data=d, model=lda, 
predict=mypredict.lda)
Error in cv.numeric(y, formula, data, model = model, predict = predict,  : 
predict does not return numerical values

even though a "manual" lda seems to provide the correct types:

> l <- lda(class ~ hydrophobicity + charge, data=d)
> mypredict.lda(l,d)
  [1] 2 2 1 1 2 2 1 2 1 2 2 1 2 1 1 2 1 1 2 1 1 2 2 1 2 1 1 2 1 1 1 1 1 2 1 1 1
...
[149] 1 2 1 1 1 1 1 1 2 1 2 1 2 1 1 1 1 2 1 2 2 2 1 2 1 1 1 1 1 1 1 1 1 1 1
Levels: 1 2

> typeof(mypredict.lda(l,d))
[1] "integer"

So what did I miss, I am fairly new to programming in R/S,
so I might have missed some conventions and/or conversions.

Software used is

R Version 1.6.2  (2003-01-10) / Linux
ipred_0.6-14.tar.gz

Yours,
Steffen

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] errorest: Error in cv.numeric()

2003-06-24 Thread Torsten Hothorn
>
> Hi,
>
> I am trying to get an error estimation
> for a classification done using lda.
>
> The examples work fine, however I don't get
> my own code to work.
>
> The data is in object d
>
>   > d
>   class hydrophobicitycharge geometry
>   1   2  6490.0400 1434.9700610.99902
>   2   2  1602.0601  400.6030  -5824.0
>   3   2   969.0060  260.1360   -415.0
>   4   1   527.2310  158.7020-22.00010
>   ...
>   180 1   299.5190   85.9201   -680.0
>   181 2  1385.6801  298.8360   -353.0
>   182 1   428.8740  130.8020   -328.0
>   183 1   287.5540   98.0767 34.0
>

the class of `d' is "numeric" and should be "factor", which is implicitly
assumed for classification problems (lda kindly operates on it but, for
example rpart, won't).

Best,

Torsten

> Since predict.lda does not return simply the classification
> it is wrapped, as in the docs:
>
>   mypredict.lda <- function(object, newdata) predict(object, newdata = 
> newdata)$class
>
> In trying errorest() I get the message
>
>   > errorest(class ~ hydrophobicity + charge, data=d, model=lda, 
> predict=mypredict.lda)
>   Error in cv.numeric(y, formula, data, model = model, predict = predict,  :
>   predict does not return numerical values
>
> even though a "manual" lda seems to provide the correct types:
>
>   > l <- lda(class ~ hydrophobicity + charge, data=d)
>   > mypredict.lda(l,d)
> [1] 2 2 1 1 2 2 1 2 1 2 2 1 2 1 1 2 1 1 2 1 1 2 2 1 2 1 1 2 1 1 1 1 1 2 1 1 1
>   ...
>   [149] 1 2 1 1 1 1 1 1 2 1 2 1 2 1 1 1 1 2 1 2 2 2 1 2 1 1 1 1 1 1 1 1 1 1 1
>   Levels: 1 2
>
>   > typeof(mypredict.lda(l,d))
>   [1] "integer"
>
> So what did I miss, I am fairly new to programming in R/S,
> so I might have missed some conventions and/or conversions.
>
> Software used is
>
>   R Version 1.6.2  (2003-01-10) / Linux
>   ipred_0.6-14.tar.gz
>
> Yours,
> Steffen
>
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
>

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] excel files and R

2003-06-24 Thread Prof Brian Ripley
On Tue, 24 Jun 2003, Victor H. Marím wrote:

> I am new at R.  My questions is rather basic.  Looking R manuals looks
> like there should be a way to read MS excel files into R.  Could
> somebody tell me which library should I use for that?

Several ways are in the R Data Import/Export Manual (the obvious manual, I
would have thought).  If you are working on Windows, using RODBC is
perhaps the simplest.

-- 
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://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Adding a calculated variable to a data frame

2003-06-24 Thread Andrew Perrin
Is there a shortcut way to add a calculated variable to a data frame? For
example, I have a data frame with variables first.conv, first.sub, and
first.agg. Each cell is -1, 0, or 1. I'd like to generate variables:

rwa.sum  : sum(first.agg,first.sub,first.conv)
rwa.psum : total number (0-3) of vars == 1
rwa.asum : total number (0-3) of vars == -1
rwa.val  : sum(abs(first.agg,first.sub,first.conv))

The only way I can think of to do this is to create a separate data.frame
to hold the calculated values, then use cbind() to paste the two together.
Am I missing an easier option?

Thanks.

--
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
[EMAIL PROTECTED] * andrew_perrin (at) unc.edu

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] R-1.7.1 regression test failure on alphaev68-dec-osf5.1

2003-06-24 Thread Peter Dalgaard BSA
"Jeff Lewis" <[EMAIL PROTECTED]> writes:

> I'm attempting to compile and install R version 1.7.1 for my statistical
> geneticists.  It seems to compile correctly -- that is, it compiles
> without errors -- but the regression test is failing in the following
> manner:
> 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > ## log
> > stopifnot(all.equal(log(1:10), log(1:10, exp(1
> > stopifnot(all.equal(log10(30), log(30, 10)))
> > stopifnot(all.equal(log2(2^pi), 2^log2(pi)))
> > stopifnot(Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps)
> Error: Mod(pi - log(exp(pi * (0+1i)))/(0+1i)) < .Machine$double.eps is
> not TRUE
> Execution halted
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> I'm compiling on Tru64UNIX 5.1A using DECs C and Fortran compilers and
> perl 5.6.0.  I found the above error in a file named
> 'reg-tests-1.Rout.fail'.  Any help you can give me would be most
> appreciated.

Well, it seems to be an accuracy issue, so the first question would be
what the values on both sides of the equality are (just start up R and
enter the expressions on te command line). You might have

1) Completely wrong results in complex arithmetic 
2) Slightly less than optimal accuracy
3) An underestimated .Machine$double.eps

Case 2) seems most likely, but case 3) has been observed with buggy
compilers that optimize calculations where they shouldn't.

-- 
   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://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Adding a calculated variable to a data frame (fwd)

2003-06-24 Thread Andrew Perrin
Thanks to all who answered... this is what I was looking for:

  df$rwa.sum <- df$first.agg+df$first.sub+df$first.agg

thanks to the several people who responded.

ap

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] R-1.7.1 regression test failure on alphaev68-dec-osf5.1

2003-06-24 Thread Jeff Lewis
> -Original Message-
> From: Peter Dalgaard BSA [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, June 24, 2003 1:20 PM
> To: Jeff Lewis
> Cc: [EMAIL PROTECTED]
> Subject: Re: [R] R-1.7.1 regression test failure on 
> alphaev68-dec-osf5.1
> 
> 
> "Jeff Lewis" <[EMAIL PROTECTED]> writes:
> 
> > I'm attempting to compile and install R version 1.7.1 for 
> my statistical
> > geneticists.  It seems to compile correctly -- that is, it compiles
> > without errors -- but the regression test is failing in the 
> following
> > manner:
> > 
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > > ## log
> > > stopifnot(all.equal(log(1:10), log(1:10, exp(1
> > > stopifnot(all.equal(log10(30), log(30, 10)))
> > > stopifnot(all.equal(log2(2^pi), 2^log2(pi)))
> > > stopifnot(Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps)
> > Error: Mod(pi - log(exp(pi * (0+1i)))/(0+1i)) < 
> .Machine$double.eps is
> > not TRUE
> > Execution halted
> > =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > 
> > I'm compiling on Tru64UNIX 5.1A using DECs C and Fortran 
> compilers and
> > perl 5.6.0.  I found the above error in a file named
> > 'reg-tests-1.Rout.fail'.  Any help you can give me would be most
> > appreciated.
> 
> Well, it seems to be an accuracy issue, so the first question would be
> what the values on both sides of the equality are (just start up R and
> enter the expressions on te command line). You might have
> 
> 1) Completely wrong results in complex arithmetic 
> 2) Slightly less than optimal accuracy
> 3) An underestimated .Machine$double.eps
> 
> Case 2) seems most likely, but case 3) has been observed with buggy
> compilers that optimize calculations where they shouldn't.



Thanks for the quick response.  The two sides of the equality are
definately different.  Here's what I'm seeing

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> pi
[1] 3.141593

> 1i
[1] 0+1i

> pi*1i
[1] 0+3.141593i

> exp(pi*1i)
[1] -1+1.224647e-16i

> log(exp(pi*1i))
[1] 0+3.141593i

> log(exp(pi*1i)) / 1i

[1] 3.141593+0i

> pi - log(exp(pi*1i)) / 1i
[1] 4.440892e-16+0i

> Mod(pi - log(exp(pi*1i)) / 1i)
[1] 4.440892e-16

> .Machine$double.eps
[1] 2.220446e-16

> Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps
[1] FALSE

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

I get the same thing from R 1.6.2, which I compiled about six months
ago.  Is there anything I can/should do to fix this?

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] R-1.7.1 regression test failure on alphaev68-dec-osf5.1

2003-06-24 Thread Peter Dalgaard BSA
"Jeff Lewis" <[EMAIL PROTECTED]> writes:

> > Well, it seems to be an accuracy issue, so the first question would be
> > what the values on both sides of the equality are (just start up R and
> > enter the expressions on te command line). You might have
> > 
> > 1) Completely wrong results in complex arithmetic 
> > 2) Slightly less than optimal accuracy
> > 3) An underestimated .Machine$double.eps
> > 
> > Case 2) seems most likely, but case 3) has been observed with buggy
> > compilers that optimize calculations where they shouldn't.
> 
> 
> 
> Thanks for the quick response.  The two sides of the equality are
> definately different.  Here's what I'm seeing
> 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > pi
> [1] 3.141593
> 
> > 1i
> [1] 0+1i
> 
> > pi*1i
> [1] 0+3.141593i
> 
> > exp(pi*1i)
> [1] -1+1.224647e-16i
> 
> > log(exp(pi*1i))
> [1] 0+3.141593i
> 
> > log(exp(pi*1i)) / 1i
> 
> [1] 3.141593+0i
> 
> > pi - log(exp(pi*1i)) / 1i
> [1] 4.440892e-16+0i
> 
> > Mod(pi - log(exp(pi*1i)) / 1i)
> [1] 4.440892e-16
> 
> > .Machine$double.eps
> [1] 2.220446e-16
> 
> > Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps
> [1] FALSE
> 
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> I get the same thing from R 1.6.2, which I compiled about six months
> ago.  Is there anything I can/should do to fix this?

Not really. It seems that your platform just has slightly less
accurate complex log/exp routines than the most common ones (Linux and
Sparc/Solaris both give exact zero). Probably the check is simply
overly stringent.

You might want to change the check to say  ... < 3*.Machine$double.eps
or so and rerun, to check whether the rest of the checks pass.

-- 
   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://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] R-1.7.1 regression test failure on alphaev68-dec-osf5.1

2003-06-24 Thread Spencer Graves
I just tried this with both R 1.6.2 and S-Plus 6.1 under Windows 2000: 
I got the same .Machine$double.eps as reported below, but I did NOT get 
the problem:

pi - log(exp(pi*1i)) / 1i

# reported below:  [1] 4.440892e-16+0i
# R1.6.2 and S-Plus 6.1 both gave 0+oi
Mod(pi - log(exp(pi*1i)) / 1i)

# reported below: 4.440892e-16
# R1.6.2 and S-Plus 6.1 both gave 0
.Machine$double.eps

# Same as reported: 2.220446e-16

Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps

# reported below:  [1] FALSE
# R1.6.2 and S-Plus 6.1 both gave T
hth.  spencer graves

Jeff Lewis wrote:
-Original Message-
From: Peter Dalgaard BSA [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 24, 2003 1:20 PM
To: Jeff Lewis
Cc: [EMAIL PROTECTED]
Subject: Re: [R] R-1.7.1 regression test failure on 
alphaev68-dec-osf5.1

"Jeff Lewis" <[EMAIL PROTECTED]> writes:


I'm attempting to compile and install R version 1.7.1 for 
my statistical

geneticists.  It seems to compile correctly -- that is, it compiles
without errors -- but the regression test is failing in the 
following

manner:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

## log
stopifnot(all.equal(log(1:10), log(1:10, exp(1
stopifnot(all.equal(log10(30), log(30, 10)))
stopifnot(all.equal(log2(2^pi), 2^log2(pi)))
stopifnot(Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps)
Error: Mod(pi - log(exp(pi * (0+1i)))/(0+1i)) < 
.Machine$double.eps is

not TRUE
Execution halted
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
I'm compiling on Tru64UNIX 5.1A using DECs C and Fortran 
compilers and

perl 5.6.0.  I found the above error in a file named
'reg-tests-1.Rout.fail'.  Any help you can give me would be most
appreciated.
Well, it seems to be an accuracy issue, so the first question would be
what the values on both sides of the equality are (just start up R and
enter the expressions on te command line). You might have
1) Completely wrong results in complex arithmetic 
2) Slightly less than optimal accuracy
3) An underestimated .Machine$double.eps

Case 2) seems most likely, but case 3) has been observed with buggy
compilers that optimize calculations where they shouldn't.




Thanks for the quick response.  The two sides of the equality are
definately different.  Here's what I'm seeing
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

pi
[1] 3.141593


1i
[1] 0+1i


pi*1i
[1] 0+3.141593i


exp(pi*1i)
[1] -1+1.224647e-16i


log(exp(pi*1i))
[1] 0+3.141593i


log(exp(pi*1i)) / 1i


[1] 3.141593+0i


pi - log(exp(pi*1i)) / 1i
[1] 4.440892e-16+0i


Mod(pi - log(exp(pi*1i)) / 1i)
[1] 4.440892e-16


.Machine$double.eps
[1] 2.220446e-16


Mod(pi - log(exp(pi*1i)) / 1i) < .Machine$double.eps
[1] FALSE

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

I get the same thing from R 1.6.2, which I compiled about six months
ago.  Is there anything I can/should do to fix this?
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] cumulative frequency distribution plot

2003-06-24 Thread Tommy E. Cathey
Does R do cumulative frequency distribution plots?

--
Tommy E. Cathey, Senior Scientific Application Consultant
High Performance Computing & Scientific Visualization
SAIC, Supporting the EPA
Research Triangle Park, NC
919-541-1500 EMail: [EMAIL PROTECTED]
My e-mail does not reflect the opinion of SAIC or the EPA.

Federal Contact - John B. Smith
919-541-1087- [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Reading graphics files

2003-06-24 Thread drf5n
Is there a tool for reading a graphics file into an object?  I might not
be looking with the correct vocabulary, but I'm finding lots of references
to producing graphics from R, but not any for inputting graphics into R.

I'd like to use a jpeg image and have the data available in R for
analysis.  I could convert the image to another format, PPM perhaps, and
parse that in, GRASS seems like overkill for a small project, and reading
an image seems like something that someone else has probably already done.

Any pointers?

?png  # output only
?bitmap   # output only
help.search("ppm") |image|graphics|read|png|bitmap all seem like outputs
R-data.pdf points the way -- Has anyone imported a graphic file?

Thanks for your time,
Dave
-- 
 Dave Forrest(434)924-3954w(111B) (804)642-0662h (804)695-2026p
 [EMAIL PROTECTED]http://mug.sys.virginia.edu/~drf5n/

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] cumulative frequency distribution plot

2003-06-24 Thread Spencer Graves
	  It depends on what you mean by that.  Consider the following:

> x <- rnorm(100)
> plot(x, pnorm(x))
	  This plot is a cdf of pseudo-normal data.

	  I've seen many people make these things, and I've never understoon 
what they see in these plots that they can't see better in a normal 
probability plot:

> qqnorm(x, datax=T)

	  What can you see in the first type plot that is not so easily seen in 
the second?

Spencer Graves

Tommy E. Cathey wrote:
Does R do cumulative frequency distribution plots?

--
Tommy E. Cathey, Senior Scientific Application Consultant
High Performance Computing & Scientific Visualization
SAIC, Supporting the EPA
Research Triangle Park, NC
919-541-1500 EMail: [EMAIL PROTECTED]
My e-mail does not reflect the opinion of SAIC or the EPA.
Federal Contact - John B. Smith
919-541-1087- [EMAIL PROTECTED]
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Reading graphics files

2003-06-24 Thread Roger Bivand
On Tue, 24 Jun 2003 [EMAIL PROTECTED] wrote:

> Is there a tool for reading a graphics file into an object?  I might not
> be looking with the correct vocabulary, but I'm finding lots of references
> to producing graphics from R, but not any for inputting graphics into R.
> 
> I'd like to use a jpeg image and have the data available in R for
> analysis.  I could convert the image to another format, PPM perhaps, and
> parse that in, GRASS seems like overkill for a small project, and reading
> an image seems like something that someone else has probably already done.
> 

library(pixmap), perhaps? Reads PNM (so PPM, PGM, PBM).

> Any pointers?
> 
> ?png  # output only
> ?bitmap   # output only
> help.search("ppm") |image|graphics|read|png|bitmap all seem like outputs
> R-data.pdf points the way -- Has anyone imported a graphic file?
> 
> Thanks for your time,
> Dave
> 

-- 
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://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] data.entry function

2003-06-24 Thread Erin Hodgess
Dear R People:

Does anyone use the data.entry  function, please?

I would like to create a data frame with a character column1, 
a numeric colum2, and a numeric col3.

I would think that

data.entry(x,y,z)

would work.

However, I get a syntax error for function de.

Does anyone have any hints please?

I would like to show this in one of my classes.  They are
have a terrible time with the command line.

thanks so much!!!

Sincerely,
Erin 

mailto: [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] cumulative frequency distribution plot

2003-06-24 Thread Wiener, Matthew
You can also take a look at "ecdf" in the "stepfun" package.

Hope this helps,
Matt

-Original Message-
From: Spencer Graves [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 24, 2003 2:39 PM
To: Tommy E. Cathey
Cc: [EMAIL PROTECTED]
Subject: Re: [R] cumulative frequency distribution plot


  It depends on what you mean by that.  Consider the following:

 > x <- rnorm(100)
 > plot(x, pnorm(x))

  This plot is a cdf of pseudo-normal data.

  I've seen many people make these things, and I've never understoon

what they see in these plots that they can't see better in a normal 
probability plot:

 > qqnorm(x, datax=T)

  What can you see in the first type plot that is not so easily seen
in 
the second?

Spencer Graves

Tommy E. Cathey wrote:
> Does R do cumulative frequency distribution plots?
> 
> --
> Tommy E. Cathey, Senior Scientific Application Consultant
> High Performance Computing & Scientific Visualization
> SAIC, Supporting the EPA
> Research Triangle Park, NC
> 919-541-1500 EMail: [EMAIL PROTECTED]
> My e-mail does not reflect the opinion of SAIC or the EPA.
> 
> Federal Contact - John B. Smith
> 919-541-1087- [EMAIL PROTECTED]
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

--
Notice: This e-mail message, together with any attachments, cont... {{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Can't load e1071

2003-06-24 Thread Andrew Perrin
After upgrading to 1.7.0 under debian linux, I can't get e1071 working
properly.

The first problem I had was that g++-3.0 was the standard compiler but
wasn't installed, so I installed it. e1071 then installed correctly, but I
get the following:

[EMAIL PROTECTED]:~/afshome/papers/authoritarian/R$ R

R : Copyright 2003, The R Development Core Team
Version 1.7.0  (2003-04-16)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type `license()' or `licence()' for distribution details.

R is a collaborative project with many contributors.
Type `contributors()' for more information.

Type `demo()' for some demos, `help()' for on-line help, or
`help.start()' for a HTML browser interface to help.
Type `q()' to quit R.

[Previously saved workspace restored]

> library(e1071)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library
"/usr/local/lib/R/site-library/e1071/libs/e1071.so":
  /usr/local/lib/R/site-library/e1071/libs/e1071.so: cannot dynamically
load executable
Error in library(e1071) : .First.lib failed


any suggestions? Thanks.

--
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
[EMAIL PROTECTED] * andrew_perrin (at) unc.edu

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Can't load e1071

2003-06-24 Thread David Meyer
Andrew,

1) The current R version is 1.7.1
2) Which version of `e1071' are you using?
3) Does the `e1071.so' file exist (in e1071/libs)?
best,
David.
On 2003.06.24 21:43, Andrew Perrin wrote:
After upgrading to 1.7.0 under debian linux, I can't get e1071 working
properly.
The first problem I had was that g++-3.0 was the standard compiler but
wasn't installed, so I installed it. e1071 then installed correctly,
but I
get the following:
[EMAIL PROTECTED]:~/afshome/papers/authoritarian/R$ R

R : Copyright 2003, The R Development Core Team
Version 1.7.0  (2003-04-16)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type `license()' or `licence()' for distribution details.
R is a collaborative project with many contributors.
Type `contributors()' for more information.
Type `demo()' for some demos, `help()' for on-line help, or
`help.start()' for a HTML browser interface to help.
Type `q()' to quit R.
[Previously saved workspace restored]

> library(e1071)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library
"/usr/local/lib/R/site-library/e1071/libs/e1071.so":
  /usr/local/lib/R/site-library/e1071/libs/e1071.so: cannot
dynamically
load executable
Error in library(e1071) : .First.lib failed
any suggestions? Thanks.

--
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
[EMAIL PROTECTED] * andrew_perrin (at) unc.edu
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Can't load e1071

2003-06-24 Thread Andrew Perrin
On Tue, 24 Jun 2003, David Meyer wrote:

> Andrew,
>
> 1) The current R version is 1.7.1

hmmm...:
perrin:/usr/local/lib/R/site-library# apt-get upgrade
Reading Package Lists... Done
Building Dependency Tree... Done
0 packages upgraded, 0 newly installed, 0 to remove and 0  not upgraded.
perrin:/usr/local/lib/R/site-library# dpkg -l r-base
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err:
uppercase=bad)
||/ Name   VersionDescription
+++-==-==-
ii  r-base 1.7.0-0.cran.1 GNU R statistical computing language and
env
perrin:/usr/local/lib/R/site-library#



apparently there's not a debian package available?


> 2) Which version of `e1071' are you using?

This is based on doing an install.packages('e1071') from within R as root
(which is how I have generally installed packages in the past).

> 3) Does the `e1071.so' file exist (in e1071/libs)?
>

Yes:

[EMAIL PROTECTED]:~/afshome/papers/authoritarian/R$ ls -l
/usr/local/lib/R/site-library/e1071/libs/e1071.so
-rwxr-xr-x1 root staff  109247 Jun 24 15:41
/usr/local/lib/R/site-library/e1071/libs/e1071.so


> best,
> David.
>

Thanks,
Andy

>
> On 2003.06.24 21:43, Andrew Perrin wrote:
> > After upgrading to 1.7.0 under debian linux, I can't get e1071 working
> > properly.
> >
> > The first problem I had was that g++-3.0 was the standard compiler but
> > wasn't installed, so I installed it. e1071 then installed correctly,
> > but I
> > get the following:
> >
> > [EMAIL PROTECTED]:~/afshome/papers/authoritarian/R$ R
> >
> > R : Copyright 2003, The R Development Core Team
> > Version 1.7.0  (2003-04-16)
> >
> > R is free software and comes with ABSOLUTELY NO WARRANTY.
> > You are welcome to redistribute it under certain conditions.
> > Type `license()' or `licence()' for distribution details.
> >
> > R is a collaborative project with many contributors.
> > Type `contributors()' for more information.
> >
> > Type `demo()' for some demos, `help()' for on-line help, or
> > `help.start()' for a HTML browser interface to help.
> > Type `q()' to quit R.
> >
> > [Previously saved workspace restored]
> >
> > > library(e1071)
> > Error in dyn.load(x, as.logical(local), as.logical(now)) :
> > unable to load shared library
> > "/usr/local/lib/R/site-library/e1071/libs/e1071.so":
> >   /usr/local/lib/R/site-library/e1071/libs/e1071.so: cannot
> > dynamically
> > load executable
> > Error in library(e1071) : .First.lib failed
> >
> >
> > any suggestions? Thanks.
> >
> > --
> > Andrew J Perrin - http://www.unc.edu/~aperrin
> > Assistant Professor of Sociology, U of North Carolina, Chapel Hill
> > [EMAIL PROTECTED] * andrew_perrin (at) unc.edu
> >
> > __
> > [EMAIL PROTECTED] mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> >
> >
>


--
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
[EMAIL PROTECTED] * andrew_perrin (at) unc.edu

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Rcmdr active data set

2003-06-24 Thread apjaworski
Hi,

This seems a very basic problem, but I cannot seem to find the solution to
it.

I am trying to use Rcmdr on a data frame I created in my current R session.
More specifically, I did

 x <- data.frame(matrix(0, ncol=3, nrow=5))
library(Rcmdr)

Now I would like to be able to edit, view and perhaps analyze x, but I
cannot seem to figure out how to make it active.  Any hint will be welcome.

Andy

__
Andy Jaworski
Engineering Systems Technology Center
3M Center, 518-1-01
St. Paul, MN 55144-1000
-
E-mail: [EMAIL PROTECTED]
Tel:  (651) 733-6092
Fax:  (651) 736-3122

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Re: data.entry function

2003-06-24 Thread Mahmood ARAI
data.entry("")
opens the data editor and the varaibles namn and type can be set using
the mouse (left b.) pointing at the top row. 

Erin Hodgess writes: 

Dear R People: 

Does anyone use the data.entry  function, please? 

I would like to create a data frame with a character column1, 
a numeric colum2, and a numeric col3. 

I would think that 

data.entry(x,y,z) 

would work. 

However, I get a syntax error for function de. 

Does anyone have any hints please? 

I would like to show this in one of my classes.  They are
have a terrible time with the command line. 

thanks so much!!! 

Sincerely,
Erin  

mailto: [EMAIL PROTECTED] 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


http://www.ne.su.se/~ma

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Can't load e1071

2003-06-24 Thread Andrew Perrin
OK, thanks. Is that the problem with e1071? Any advice on getting it
loaded?

Thanks.

--
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
[EMAIL PROTECTED] * andrew_perrin (at) unc.edu


On Tue, 24 Jun 2003, Dirk Eddelbuettel wrote:

> On Tue, Jun 24, 2003 at 04:04:40PM -0400, Andrew Perrin wrote:
> > ii  r-base 1.7.0-0.cran.1 GNU R statistical computing language and
> > apparently there's not a debian package available?
>
> It's in Debian unstable as my post to r-help said. Works on testing too, but
> have to install it.
>
> Dirk
>
> --
> Don't drink and derive. Alcohol and analysis don't mix.
>

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Can't load e1071

2003-06-24 Thread Dirk Eddelbuettel

On Tue, Jun 24, 2003 at 07:47:19PM -0400, Andrew Perrin wrote:
> OK, thanks. Is that the problem with e1071? Any advice on getting it
> loaded?

[ It is considered impolite to reply to private messages via the list. ]

You misunderstand:  R in Debian is in unstable. e1071 is an add-on package
that always loaded without any issues.

Hth, Dirk

> On Tue, 24 Jun 2003, Dirk Eddelbuettel wrote:
> 
> > On Tue, Jun 24, 2003 at 04:04:40PM -0400, Andrew Perrin wrote:
> > > ii  r-base 1.7.0-0.cran.1 GNU R statistical computing language and
> > > apparently there's not a debian package available?
> >
> > It's in Debian unstable as my post to r-help said. Works on testing too, but
> > have to install it.
> >
> > Dirk
> >
> > --
> > Don't drink and derive. Alcohol and analysis don't mix.
> >
> 

-- 
Don't drink and derive. Alcohol and analysis don't mix.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Pairs with different colours

2003-06-24 Thread Dowkiw, Arnaud

Does anybody know how to make pairs graphics with dots of different colours depending 
on the value of a categorical variable ?

Thanks,

Arnaud
*
Arnaud DOWKIW
Department of Primary Industries
J. Bjelke-Petersen Research Station
KINGAROY, QLD 4610
Australia
T : + 61 7 41 600 700
T : + 61 7 41 600 728 (direct)
F : + 61 7 41 600 760
**
 

DISCLAIMER**... {{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Pairs with different colours

2003-06-24 Thread Ko-Kang Kevin Wang
?pairs

It is clearly documented.  It's the first example:
 data(iris)
 pairs(iris[1:4], main = "Anderson's Iris Data -- 3 species", 
   pch = 21, bg = c("red", "green3", "blue")[codes(iris$Species)])

On Wed, 25 Jun 2003, Dowkiw, Arnaud wrote:

> Does anybody know how to make pairs graphics with dots of different colours 
> depending on the value of a categorical variable ?

-- 
Cheers,

Kevin

--
"On two occasions, I have been asked [by members of Parliament],
'Pray, Mr. Babbage, if you put into the machine wrong figures, will
the right answers come out?' I am not able to rightly apprehend the
kind of confusion of ideas that could provoke such a question."

-- Charles Babbage (1791-1871) 
 From Computer Stupidities: http://rinkworks.com/stupid/

--
Ko-Kang Kevin Wang
Master of Science (MSc) Student
SLC Tutor and Lab Demonstrator
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022
Ph: 373-7599
x88475 (City)
x88480 (Tamaki)

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Can't load e1071

2003-06-24 Thread Andrew Perrin
On Tue, 24 Jun 2003, Dirk Eddelbuettel wrote:

>
> On Tue, Jun 24, 2003 at 07:47:19PM -0400, Andrew Perrin wrote:
> > OK, thanks. Is that the problem with e1071? Any advice on getting it
> > loaded?
>
> [ It is considered impolite to reply to private messages via the list. ]

Sorry for any impoliteness. I was trying to ask the whole list, since I
suspect the two issues are different.

>
> You misunderstand:  R in Debian is in unstable. e1071 is an add-on package
> that always loaded without any issues.
>

No, I don't misunderstand. R 1.7.0 is in debian-stable, which is why it's
what I'm running. I appreciate that information. e1071 is an add-on
package that used to load without any issues, but it does not do so on
either of my debian-stable machines. They both fail with the same message:

> library(e1071)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
unable to load shared library
"/usr/local/lib/R/site-library/e1071/libs/e1071.so":
  /usr/local/lib/R/site-library/e1071/libs/e1071.so: cannot dynamically
load executable
Error in library(e1071) : .First.lib failed


...even though /usr/local/lib/R/site-library/e1071/libs/e1071.so exists
and is readable.


That was the reason for the original post; someone else noted that my
installation of R was old, which led to this thread.

The first problem I had is that R apparently assumes that g++-3.0 will be
the compiler, since:

[EMAIL PROTECTED]:/usr/local/lib/R/site-library/e1071/libs$ R CMD config CXX
g++-3.0


...even if g++-3.0 isn't installed on the machine:
joehill:/usr/src/e1071# dpkg -l | grep g++
ii  g++2.95.4-14  The GNU C++ compiler.
ii  g++-2.95   2.95.4-11woody The GNU C++ compiler.


If I install g++-3.0, then install e1071 from the net, the installation
works fine, but using the library gives the error above.

Thanks for your interest and help.



--
Andrew J Perrin - http://www.unc.edu/~aperrin
Assistant Professor of Sociology, U of North Carolina, Chapel Hill
[EMAIL PROTECTED] * andrew_perrin (at) unc.edu

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Pairs with different colours

2003-06-24 Thread Bob Murison
library(lattice)
?splom
Dowkiw, Arnaud wrote:

Does anybody know how to make pairs graphics with dots of different colours depending on the value of a categorical variable ?

Thanks,

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Rcmdr active data set

2003-06-24 Thread John Fox
Dear Andy,

The problem here is a name clash -- the data frame name (x) in the global
environment is being shadowed by a local variable of the same name.

Clearly this is
undesirable, and I'll try to figure out a way to avoid it for the next
version of the Rcmdr package, but an immediate solution is to use a
different name, such as mydata. (I assume that you tried the "Data ->
Active data set -> Select active data set" and found that the data frame x
wasn't listed as it should have been.)

Thanks for bringing the problem to my attention.

John

On Tue, 24 Jun 2003 [EMAIL PROTECTED] wrote:

> Hi,
>
> This seems a very basic problem, but I cannot seem to find the solution to
> it.
>
> I am trying to use Rcmdr on a data frame I created in my current R session.
> More specifically, I did
>
>  x <- data.frame(matrix(0, ncol=3, nrow=5))
> library(Rcmdr)
>
> Now I would like to be able to edit, view and perhaps analyze x, but I
> cannot seem to figure out how to make it active.  Any hint will be welcome.
>
> Andy
>
> __
> Andy Jaworski
> Engineering Systems Technology Center
> 3M Center, 518-1-01
> St. Paul, MN 55144-1000
> -
> E-mail: [EMAIL PROTECTED]
> Tel:  (651) 733-6092
> Fax:  (651) 736-3122
>
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
>

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Can't load e1071

2003-06-24 Thread Dirk Eddelbuettel
On Tue, Jun 24, 2003 at 08:44:57PM -0400, Andrew Perrin wrote:
> > [ It is considered impolite to reply to private messages via the list. ]
> 
> Sorry for any impoliteness. I was trying to ask the whole list, since I
> suspect the two issues are different.

That's fine, and your privilege. But as a general rule, do not relay private
messages.

> > You misunderstand:  R in Debian is in unstable. e1071 is an add-on package
> > that always loaded without any issues.
> >
> 
> No, I don't misunderstand. R 1.7.0 is in debian-stable, which is why it's

False. Debian 'stable' has 1.5.0 (in a bugfix release). Debian 'testing' has
1.6.0. CRAN has a testing release of 1.7.0 which is probably what you have.

> > library(e1071)
> Error in dyn.load(x, as.logical(local), as.logical(now)) :
> unable to load shared library
> "/usr/local/lib/R/site-library/e1071/libs/e1071.so":
>   /usr/local/lib/R/site-library/e1071/libs/e1071.so: cannot dynamically
> load executable
> Error in library(e1071) : .First.lib failed
> 
> ...even though /usr/local/lib/R/site-library/e1071/libs/e1071.so exists
> and is readable.

So remove e1071 and reinstall, but see further down.

> The first problem I had is that R apparently assumes that g++-3.0 will be
> the compiler, since:
> 
> [EMAIL PROTECTED]:/usr/local/lib/R/site-library/e1071/libs$ R CMD config CXX
> g++-3.0
> 
> 
> ...even if g++-3.0 isn't installed on the machine:
> joehill:/usr/src/e1071# dpkg -l | grep g++
> ii  g++2.95.4-14  The GNU C++ compiler.
> ii  g++-2.95   2.95.4-11woody The GNU C++ compiler.

That doesn't matter. What matters is what is hard-coded from _R built time_
in $RHOME/etc/Makeconf (which on Debian is also /etc/R/Makeconf).  Have a
look at that file, it will have hints as to under which version your
r-base-core package was built. I.e. mine shows in FLIBS that 3.3 was used.

But a much simpler way is to use the Debian package management system --
look at the Depends line of 'dpkg -s r-base-core'. Mine has e.g.  
 libg2c0 (>= 1:3.3-0pre9)
revealing that g77 from gcc version 3.3 was used, consistent with what FLIBS
had. 

> If I install g++-3.0, then install e1071 from the net, the installation
> works fine, but using the library gives the error above.

You were probably mis-matching gcc/g++ versions between the version of R you
got from CRAN and the compiler you have installed.

Hope this helps, feel free to ask me in private if you're still fuzzy.

Dirk

-- 
Don't drink and derive. Alcohol and analysis don't mix.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Can't save a graph to pdf in R for MacOS

2003-06-24 Thread Sébastien Plante
Hi,

I am using R 1.7.1 (carbon) for MacOS and I am running it on MacOS X 
10.2.6. When I send a graph to the pdf device (or any other devices), I 
get a zero KB file name "Rplots.pdf".

Before sending my graph to the output, I did:

> dev.off()
> pdf()
> boxplot(... my graph commands...)
> dev.off()
Is this the correct procedure?  I did the same procedure on another PC 
running Linux (R 1.6) and it work well.

Please help!

Thanks,

Sébastien Plante

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] frequency table

2003-06-24 Thread Robin Hankin
Professor Baron writes:

> 
> A neat trick with table() is that you can use it to tabulate
> columns of a matrix (for example) with:
> 
> apply(mymatrix,2,table)
> 

OK, I'll bite:

> x1 <- matrix(1:3,7,4,byrow=T)
Warning message: 
Replacement length not a multiple of the elements to replace in matrix(...) 
> dim(x1)
[1] 7 4
> apply(x1,2,table)
  [,1] [,2] [,3] [,4]
13223
22322
32232
> 

fine (this is what I would have expected).  But now...

> x2 <- matrix(c(1,2,1,2,1,3,1,3,1,1,1,2,2,2,2,3,2,3,3,2,3,1,1,3,3,1,3,3),7,4)
> dim(x2)
[1] 7 4
> apply(x2,2,table)
[[1]]

1 2 3 
4 2 1 

[[2]]

1 2 3 
3 3 1 

[[3]]

2 3 
3 4 

[[4]]

1 3 
3 4 


Why the difference in output format?

[presumably it's because table() cuts its cloth accordingly, unlike
tabulate()...but how can apply() know this?  My real question would be
how to turn an expression like the list given by apply(x2,2,table)
into a nice matrix].



-- 

Robin Hankin, Lecturer,
School of Geography and Environmental Science
Tamaki Campus
Private Bag 92019 Auckland
New Zealand

[EMAIL PROTECTED]
tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Rcmd SHLIB on Windows

2003-06-24 Thread Mark Piorecky
Hi all,

I would like to preform an autologistic regression analysis on my thesis data.  This 
is a form of logistic regression that accounts for spatial autocorrelation within and 
between predictor variables.  To this end I have received some script from Dr. Fred 
Huffer which will allow for the analysis in R.  It consists of an R script (autolog.R) 
that calls a compiled Fortran script (combo.o).  I am supposed to use "dyn.load' to 
load the fortran script.  To do this in R I realize that I need to create a dll for 
combo.o and that this is supposed to be done using "Rcmd SHLIB combo.f".  This is 
where I run into problems.

I have read the "readmepackages.txt", and done all that I believe applies to me: 
installed PERL, MingGW (fortran compiler), Prof. Ripley's Tools package and set PATH 
environment variable for all.  Then when I ran "Rcmd SHLIB combo.f" I got as far as:
Rcmd SHLIB combo.f 
ar cr combo.a *.o 
ranlib combo.a 
gcc --shared -s -o combo.dll combo.def omo.a -LC:/PROGRA~1/R/rw1070/src/gnuwin32 
-lg2c -lR 
Warning: .drectve '%.*s' unrecognized 

So I tried to reinstall R to C:\rw1070, instead of C:\program files, because I read 
that spaces in file names may cause errors.  Now I don't even get that far.  Now it 
reads:
g77 -02 -Wall -c combo.f  combo.o
application has requested runtime to terminate in unusual way
make: *** [combo.o] Error 3

Has anyone on a Windows box had any success with the "Rcmd SHLIB" command and a Fortrn 
script??  I have struggled with this problem for about three weeks and could really 
use some help.

Thanx

Mark Piorecky
[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] frequency table

2003-06-24 Thread Bill . Venables
Robin,

the initial output from apply() is always in the form you have below, but if
it can be 'simplified' into a structure like the matrix, it does so.  The
same thing happens with sapply().

If you want to produce a nice matrix as the out put you have to ensure that
the simplification is possible.  Here is one way.

> apply(x2, 2, function(x, v) table(factor(x, levels=v)), 
sort(unique(as.vector(x2
  [,1] [,2] [,3] [,4]
14303
22330
31144

Bill Venables.

-Original Message-
From: Robin Hankin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 2:13 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [R] frequency table


Professor Baron writes:

> 
> A neat trick with table() is that you can use it to tabulate
> columns of a matrix (for example) with:
> 
> apply(mymatrix,2,table)
> 

OK, I'll bite:

> x1 <- matrix(1:3,7,4,byrow=T)
Warning message: 
Replacement length not a multiple of the elements to replace in matrix(...) 
> dim(x1)
[1] 7 4
> apply(x1,2,table)
  [,1] [,2] [,3] [,4]
13223
22322
32232
> 

fine (this is what I would have expected).  But now...

> x2 <-
matrix(c(1,2,1,2,1,3,1,3,1,1,1,2,2,2,2,3,2,3,3,2,3,1,1,3,3,1,3,3),7,4)
> dim(x2)
[1] 7 4
> apply(x2,2,table)
[[1]]

1 2 3 
4 2 1 

[[2]]

1 2 3 
3 3 1 

[[3]]

2 3 
3 4 

[[4]]

1 3 
3 4 


Why the difference in output format?

[presumably it's because table() cuts its cloth accordingly, unlike
tabulate()...but how can apply() know this?  My real question would be
how to turn an expression like the list given by apply(x2,2,table)
into a nice matrix].



-- 

Robin Hankin, Lecturer,
School of Geography and Environmental Science
Tamaki Campus
Private Bag 92019 Auckland
New Zealand

[EMAIL PROTECTED]
tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help