Re: [R] Fwd: License Agreement

2003-11-18 Thread Friedrich . Leisch
> On Mon, 17 Nov 2003 14:01:17 -0500,
> Sigrid Volko (SV) wrote:


  > Dear Mr. Leisch,

[don't know why you assume that I'm behind r-help ... but anyway ...

  > I was asked by one of our faculty members at Johns Hopkins University to =
  > assist him in licensing a software application that he has developed. This =
  > package is based on R, the statistical software that is distributed as =
  > freeware. In the course of my due diligence analysis, I reviewed the =
  > official R web page which states that R is an official part of the Free =
  > Software Foundation's GNU project. However, it does not explicitly state =
  > under which License Agreement R is made available. Reviewing the GNU =
  > official web page, I assume that R is made available under the GNU General =
  > Public License. I would, however, appreciate if you could confirm that =
  > this information is correct.=20


I think the web page clearly states that R is indeed distributed under
the terms of the GPL ... and if you use R you get a pointer to the GPL
every time you start it.

-- 
---
Friedrich Leisch 
Institut für Statistik Tel: (+43 1) 58801 10715
Technische Universität WienFax: (+43 1) 58801 10798
Wiedner Hauptstraße 8-10/1071  [EMAIL PROTECTED]
A-1040 Wien, Austria http://www.ci.tuwien.ac.at/~leisch

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


Re: [R] rpart postscript graphics, Mac OS

2003-11-18 Thread Uwe Ligges


On Tue, 18 Nov 2003, Paul Murrell wrote:

> Hi
> 
> 
> Kaiser Fung wrote:
> > I am running R on Mac OS X 10.2x.  When I create
> > postscript graphics of rpart tree objects, a tiny part
> > of the tree gets trimmed off, even when it has only a
> > few terminal nodes.  This happens even without fancy
> > but worse if fancy=T.  (This doesn't happen with
> > boxplot, scatter plots, etc.)  How do I fix this?
> > 
> > postscript("tree.eps")
> > plot(davb.tree, u=T)
> > text(davb.tree, use.n=T, fancy=F)
> > dev.off()
> 
> 
> It's hard to see your problem without the actual data to reproduce it. 
> Does it help if you precede the plot command with par(xpd=NA)?


Well, the "problem" is known (calculating the required space for labeling 
etc. is hard), hence the argument "margin" in plot.rpart().
?plot.rpart tells you:

"margin: an extra percentage of white space to leave around the borders of
the tree. (Long labels sometimes get cut off by the default computation)."  

margin=0.1 is sufficient in most cases.

Uwe Ligges

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


Re: [R] sampling without repetition

2003-11-18 Thread Murray Jorgensen
Really you just want a random permutation of r:

> rperm <- sample(r)

Then you can obtain a random partition of r into cells of any desired size
simply by taking appropriately-sized consecutive blocks of rperm.

Murray

At 22:42 17/11/2003 -0500, Rajarshi Guha wrote:

>Sorry for not providing all the details.
>
>The 3 sets can be of any size (which will be specified by the user of
>the function) and cover all of r (ie, set1 + set2 + set3 == r)
>
>Thanks to everybody for all the solutions.
>
>---
>Rajarshi Guha <[EMAIL PROTECTED]> 
>GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
>---
>"I'd love to go out with you, but there are important world issues that
>need worrying about."
>
>__
>[EMAIL PROTECTED] mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 
Dr Murray Jorgensen  http://www.stats.waikato.ac.nz/Staff/maj.html
Department of Statistics, University of Waikato, Hamilton, New Zealand
Email: [EMAIL PROTECTED]Fax 7 838 4155
Phone  +64 7 838 4773 wk+64 7 849 6486 homeMobile 021 1395 862

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


[R] Compiling R

2003-11-18 Thread John Dougherty
I have a generally successful compiled R 1.8.0 version installed on a SuSE 9.0 
system.  One frustration however is that the basic keyboard functions of BASH 
have not completely carried through and the up, down, left and right arrow 
keys don't behave as they do on the regular shell command line.  That is no 
command history can be accessed and the cursor cannot be back-spaced over a 
recalled command to edit it.  I expect that I am missing a "--with-" statment 
but I am not certain what it should be. Is there any help file that details 
the fine points for compiling R?  INSTALL does not contain the information I 
am interested in.

Thank you,
jwdougherty

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


Re: [R] Compiling R

2003-11-18 Thread Prof Brian Ripley
>From INSTALL:

The main source of information on installation is the `R Installation
and Administration Manual', an HTML copy of which is available as file
`doc/html/R-admin.html'.  Please read that before installing R.  But
if you are impatient, read on but please refer to the manual to
resolve any problems.

Hint: you are missing the readline development RPMs, and that is covered 
in the manual you were asked to read.

On Tue, 18 Nov 2003, John Dougherty wrote:

> I have a generally successful compiled R 1.8.0 version installed on a SuSE 9.0 
> system.  One frustration however is that the basic keyboard functions of BASH 
> have not completely carried through and the up, down, left and right arrow 
> keys don't behave as they do on the regular shell command line.  That is no 
> command history can be accessed and the cursor cannot be back-spaced over a 
> recalled command to edit it.  I expect that I am missing a "--with-" statment 
> but I am not certain what it should be.   Is there any help file that details 
> the fine points for compiling R?  INSTALL does not contain the information I 
> am interested in.

but it does tell you *exactly* where to look.

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


Re: [R] Compiling R

2003-11-18 Thread Uwe Ligges


On Tue, 18 Nov 2003, John Dougherty wrote:

> I have a generally successful compiled R 1.8.0 version installed on a SuSE 9.0 
> system.  One frustration however is that the basic keyboard functions of BASH 
> have not completely carried through and the up, down, left and right arrow 
> keys don't behave as they do on the regular shell command line.  That is no 
> command history can be accessed and the cursor cannot be back-spaced over a 
> recalled command to edit it.  I expect that I am missing a "--with-" statment 
> but I am not certain what it should be.   Is there any help file that details 
> the fine points for compiling R?  INSTALL does not contain the information I 
> am interested in.
> 
> Thank you,
> jwdougherty
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

See the R Installation and Administration manual, available at CRAN and in
the sources.

Uwe Ligges

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


[R] mixed model for Splus and R

2003-11-18 Thread Lei Liu
Hi there,

I try to compare the mixed model package "lme" by Splus and R. I used the 
dataset "Ovary" and the following code assuming AR(1) model for the error term:

lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data=Ovary, random = 
pdDiag(~sin(2*pi*Time) ) , correlation=corAR1() )

But I got different results! And then I used a simpler model:

lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data=Ovary, random = 
pdDiag(~sin(2*pi*Time)) )

This time I got the same output. I wonder the reason for the inconsistence 
between R and Splus. I attached the results as follows. Can someone tell me 
how to do it correctly in R? Thanks!

Lei

Result from R:

**
Linear mixed-effects model fit by REML
   Data: Ovary
   Log-restricted-likelihood: -775.2224
   Fixed: follicles ~ sin(2 * pi * Time) + cos(2 * pi * Time)
(Intercept) sin(2 * pi * Time) cos(2 * pi * Time)
 12.1895808 -2.9473432 -0.8807113

Random effects:
  Formula: ~sin(2 * pi * Time) | Mare
  Structure: Diagonal
 (Intercept) sin(2 * pi * Time) Residual
StdDev:2.807293 0.03630784 3.665217

Correlation Structure: AR(1)
  Formula: ~1 | Mare
  Parameter estimate(s):
   Phi
0.6073908
Number of Observations: 308
Number of Groups: 11

*

Result from Splus:

*
Linear mixed-effects model fit by REML
   Data: Ovary
   Log-restricted-likelihood: -774.724
   Fixed: follicles ~ sin(2 * pi * Time) + cos(2 * pi * Time)
  (Intercept) sin(2 * pi * Time) cos(2 * pi * Time)
 12.18809  -2.985282 -0.8777629

Random effects:
  Formula:  ~ sin(2 * pi * Time) | Mare
  Structure: Diagonal
 (Intercept) sin(2 * pi * Time) Residual
StdDev:2.8584781.25802 3.507097

Correlation Structure: AR(1)
  Formula:  ~ 1 | Mare
  Parameter estimate(s):
Phi
  0.5722019
Number of Observations: 308
Number of Groups: 11
  
**


[[alternative HTML version deleted]]

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


[R] Copula calculation in R?

2003-11-18 Thread Thomas Holm
Hello

Anyone that now of any function in R that can calculate copulas?
Or if anyone have any code avaible I would be more than interested. 

Thank you in advance

/Thomas

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


Re: [R] \preformatted and $

2003-11-18 Thread Uwe Ligges


On 17 Nov 2003, Arend P. van der Veen wrote:

> Hi,
> 
> I have been developing a package in R and have been working on
> documentation.  I have a \details function that contains the following:
> 
> \details{
> 
> some text
> 
> \preformatted{
> [my-section]
> user = apv
> host = 127.0.0.1
> }
> 
> }
> 
>  When I run R CMD check I get an error while checking the manual.  If I
> remove:
> 
> \preformatted{
> [my-section]
> user = apv
> host = 127.0.0.1
> }
> 
> and replace it with 
> 
> [my-section]
> user = apv
> host = 127.0.0.1
> 
> the error goes away.
> 
> Has anybody had this problem?  

Confirmed. The problem is that there is no newline after
\end{verbatim}
in the produced TeX code, so we get, e.g.:
\end{verbatim}\end{Details}
.

Might be fixed in R-patched (I don't have access right now).


> 
> I have also have a problem including a '$' in my documentation.  I
> replace them with \$ which made latex happy but then \$ showed up in the
> HTML and R help.

Hmmm. All of the following works for me:

\$, \code{$}, and \deqn{\$}{$}


Uwe Ligges



> Any advice would be appreciated,
> Arend van der Veen
> 
> __
> [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] data.frame subset?

2003-11-18 Thread Jeff D. Hamann
Can someone tell me why this is since I can't seem to find an explination in
the docs or FAQ for this.

Since there are no "BM" in the mtrs data.frame, but only in the "parent"
data.frame (trees), I'm assuming the subset data.frame is still associated
with the original. Is that correct and how would I create a completly
separate data.frame since I'll be using by, lapply and such on the subset
data.frame using "sp" which currently causes by to choke...

> mtrs <- trees[trees$m == 1,]
> mtrs
plot tree sp m dbh tht   bfvol   cfvol
1  11 DF 1  44 185 3825.79  622.97
2  12 DF 1  38 188 3166.69  504.12
26 31 DF 1  42 185 3568.80  578.09
51 54 DF 1  30 189 2071.36  348.28
67 71 DF 1  33 168 2036.30  342.90
70 74 DF 1  45 180 3665.82  621.90
71 75 DF 1  30 160 1530.88  274.69
81 91 DF 1  44 175 3398.52  576.79
82 92 DF 1  68 205 9516.82 1461.21
95111 DF 1  30 170 1775.60  299.54
96112 DF 1  44 197 4249.98  680.64
97113 DF 1  44 187 3914.88  632.42
107   11   13 WH 1  44 175 3398.52  576.79
121   132 WF 1  48 205 5241.14  827.57
126   137 DF 1  40 182 3188.77  522.43
138   152 DF 1  69 182 7852.22 1285.42
143   157 DF 1  28 142 1146.77  207.67
159   179 DF 1  12  88   99.13   25.43
177   197 DF 1  37 162 2309.06  391.48
> attributes( mtrs$sp )
$class
[1] "factor"

$levels
[1] "BM" "DF" "WF" "WH"

>

---
Jeff D. Hamann
Forest Informatics, Inc.
PO Box 1421
Corvallis, Oregon USA 97339-1421
(office) 541-754-1428
(cell) 541-740-5988
[EMAIL PROTECTED]
www.forestinformatics.com

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


[R] How to return a big treelike list from .Call Interface (protect stack overflow)

2003-11-18 Thread "Jens Oehlschlägel"

I try to create a big treelike list structure using the RDefines/RInternal
macros. The tree carries information at each node (attribute list) and at each
leaf (vector). 
My understanding is that for each node I add to the binary tree I have to
call 
  PROTECT(newnode = NEW_LIST(2)); 
and cannot UNPROTECT before I return the whole tree. Same story for node
attributes and leaf vectors. However, this way I easily reach the limit of the
proteckt stack at 1 (BTW this error is not catched). How can I increase
the protect stack? Is there a better way to create such an R structure? 
Can one do C-side recursive list assignment MyList[[c(1,2,1,2,2,1)]] <<-
NewSEXP without calling the R evaluator?

Thanks for any help
Best regards


Jens Oehlschlägel

-- 
GMX Weihnachts-Special: Seychellen-Traumreise zu gewinnen!

Rentier entlaufen. Finden Sie Rudolph! Als Belohnung winken tolle
Preise. http://www.gmx.net/de/cgi/specialmail/

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


[R] Is it possible to source a R program in VBA?

2003-11-18 Thread Christine Pelletier
Hello,

I am a complete beginner in R and in programing in general. I wrote some programs in R 
and I have to interface them in VBA. I saw that with the Dcom package it is possible. 
I looked at the examples, and I did not found how to 'source' a R program into VB 
environment in order to call my function. Is it possible? Does some tutorials or 
documentation exist and on the call of R from VB? Where can I find them?

Thank you very much for your help. 

Christine
[[alternative HTML version deleted]]

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


Re: [R] data.frame subset?

2003-11-18 Thread Uwe Ligges


On Tue, 18 Nov 2003, Jeff D. Hamann wrote:

> Can someone tell me why this is since I can't seem to find an explination in
> the docs or FAQ for this.
> 
> Since there are no "BM" in the mtrs data.frame, but only in the "parent"
> data.frame (trees), I'm assuming the subset data.frame is still associated
> with the original. Is that correct and how would I create a completly
> separate data.frame since I'll be using by, lapply and such on the subset
> data.frame using "sp" which currently causes by to choke...
> 
> > mtrs <- trees[trees$m == 1,]
> > mtrs
> plot tree sp m dbh tht   bfvol   cfvol
> 1  11 DF 1  44 185 3825.79  622.97
> 2  12 DF 1  38 188 3166.69  504.12
> 26 31 DF 1  42 185 3568.80  578.09
> 51 54 DF 1  30 189 2071.36  348.28
> 67 71 DF 1  33 168 2036.30  342.90
> 70 74 DF 1  45 180 3665.82  621.90
> 71 75 DF 1  30 160 1530.88  274.69
> 81 91 DF 1  44 175 3398.52  576.79
> 82 92 DF 1  68 205 9516.82 1461.21
> 95111 DF 1  30 170 1775.60  299.54
> 96112 DF 1  44 197 4249.98  680.64
> 97113 DF 1  44 187 3914.88  632.42
> 107   11   13 WH 1  44 175 3398.52  576.79
> 121   132 WF 1  48 205 5241.14  827.57
> 126   137 DF 1  40 182 3188.77  522.43
> 138   152 DF 1  69 182 7852.22 1285.42
> 143   157 DF 1  28 142 1146.77  207.67
> 159   179 DF 1  12  88   99.13   25.43
> 177   197 DF 1  37 162 2309.06  391.48
> > attributes( mtrs$sp )
> $class
> [1] "factor"
> 
> $levels
> [1] "BM" "DF" "WF" "WH"
> 


A factor remembers all its levels unless you tell to drop them as in:
 mtrs <- trees[trees$m == 1, , drop = TRUE]

Uwe Ligges

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


[R] x[x > y] and more conditions

2003-11-18 Thread Christian Schulz
...and  i'm getting all cases which
are true for above condition and get the information
how many cases match, too. The vector's are in a attached data.frame.

FAKTOR30[FAKTOR30 > 0.234]
...
[102193] 0.352 0.352 0.288 0.354 0.352 0.358 0.352 0.352 0.311 0.370 0.352
0.336
[102205] 0.352 0.274 0.352 0.405 0.354 0.352 0.352 0.352 0.352 0.352 0.352
0.340
[102217] 0.352 0.352


But if i use more than one "index" term
UMSATZ30[UMSATZ30 > 10] && FAKTOR30[FAKTOR30 = 0.234]

[1] NA

I get  true, false  or NA  and the latter i think this mean there isn't any
case with this condition!?
But, how can i check cases with more than one condition like the single
example, i trial some but getting no success?

Many thanks for help,
christian

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


Re: [R] x[x > y] and more conditions

2003-11-18 Thread Uwe Ligges


On Tue, 18 Nov 2003, Christian Schulz wrote:

> ...and  i'm getting all cases which
> are true for above condition and get the information
> how many cases match, too. The vector's are in a attached data.frame.
> 
> FAKTOR30[FAKTOR30 > 0.234]
> ...
> [102193] 0.352 0.352 0.288 0.354 0.352 0.358 0.352 0.352 0.311 0.370 0.352
> 0.336
> [102205] 0.352 0.274 0.352 0.405 0.354 0.352 0.352 0.352 0.352 0.352 0.352
> 0.340
> [102217] 0.352 0.352
> 
> 
> But if i use more than one "index" term
> UMSATZ30[UMSATZ30 > 10] && FAKTOR30[FAKTOR30 = 0.234]
> 
> [1] NA

See ?"&&" which tells you to use "&" instead os "&&" for vectorized
logical operations like this one.

Using "&&" only evaluates the first elements of those logical vectors, so
there seems to be an NA in UMSATZ30[1] or FAKTOR30[1]

Uwe Ligges

 
> I get  true, false  or NA  and the latter i think this mean there isn't any
> case with this condition!?
> But, how can i check cases with more than one condition like the single
> example, i trial some but getting no success?
> 
> Many thanks for help,
> christian
> 
> __
> [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] How to return a big treelike list from .Call Interface (protect stack overflow)

2003-11-18 Thread Peter Dalgaard
"Jens Oehlschlägel" <[EMAIL PROTECTED]> writes:

> I try to create a big treelike list structure using the RDefines/RInternal
> macros. The tree carries information at each node (attribute list) and at each
> leaf (vector). 
> My understanding is that for each node I add to the binary tree I have to
> call 
>   PROTECT(newnode = NEW_LIST(2)); 
> and cannot UNPROTECT before I return the whole tree. Same story for node
> attributes and leaf vectors. However, this way I easily reach the limit of the
> proteckt stack at 1 (BTW this error is not catched). How can I increase
> the protect stack? Is there a better way to create such an R structure? 
> Can one do C-side recursive list assignment MyList[[c(1,2,1,2,2,1)]] <<-
> NewSEXP without calling the R evaluator?

Nono, protection is recursive. You can UNPROTECT as soon as a
structure becomes part of a PROTECT'ed structure, or even avoid
protection at all if you assign immediately, e.g.

SET_VECTOR_ELT(oldnode,0, newnode=NEW_LIST(2))

I believe the protect stack overflow situation has improved in 1.8.1.

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


[R] package compilation

2003-11-18 Thread Joerg Schaber
Hi,

I recently wrote a new R package, which I could 'R CMD check' and 'R CMD 
build' nicely on my Intel Linux PC. Loading the new library as a normal 
user on my PC also works nicely.
This packages includes some compiled C-code in a shared library. 
However, before submitting the package to CRAN I wanted to install it 
also under an other platform in order to check if everything works 
fine. Obviously, in order to install it under another platform I have 
to recompile the shared lib. So I added a /src directory in the library 
containing the C source code and than run a 'R CMD build'. However, 
running 'R CMD INSTALL'  on the resulting tar.gz archive does not 
recompile the source code on the new machine. But installing other 
packages having a /src directory the source code is recompiled.
So what do I have to do that running a 'R CMD install' on my *tar.gz 
file recompiles de source code and creates a platform dependend shared lib?
Thanks,

joerg

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


Re: [R] package compilation

2003-11-18 Thread Uwe Ligges


On Tue, 18 Nov 2003, Joerg Schaber wrote:

> Hi,
> 
> I recently wrote a new R package, which I could 'R CMD check' and 'R CMD 
> build' nicely on my Intel Linux PC. Loading the new library as a normal 
> user on my PC also works nicely.
> This packages includes some compiled C-code in a shared library. 
> However, before submitting the package to CRAN I wanted to install it 
> also under an other platform in order to check if everything works 
>  fine. Obviously, in order to install it under another platform I have 
> to recompile the shared lib. So I added a /src directory in the library 
> containing the C source code and than run a 'R CMD build'. However, 
> running 'R CMD INSTALL'  on the resulting tar.gz archive does not 
> recompile the source code on the new machine. But installing other 
> packages having a /src directory the source code is recompiled.
> So what do I have to do that running a 'R CMD install' on my *tar.gz 
> file recompiles de source code and creates a platform dependend shared lib?

You have to remove any binaries from that directory, but R CMD build
should have done it for you. Or does the compilation fails out of other
reasons? It's hard to guess without any more details.

Uwe Ligges

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


[R] Problems installing lattice

2003-11-18 Thread Bernd Weiss
Dear all,

I am not able to install the lattice package. After finishing the
installation, I got the following error massage:

---snip---
Delete downloaded files (y/N)? y
 
Warning message:
argument `lib' is missing: using /usr/local/lib/R/site-library in:
install.packages("lattice")
> library(lattice)
Error in loadNamespace(i, c(lib.loc, .libPaths()), keep.source) :
There is no package called 'grid'
Error in library(lattice) : package/namespace load failed
>
---snap---

Some weaks ago a similar thread took place on this list [1]. I am using 

> version
 _
platform i386-pc-linux-gnu
arch i386
os   linux-gnu
system   i386, linux-gnu
status   beta
major1
minor8.1
year 2003
month11
day  14
language R

So, I don't think, that my version of R should be updated.

Any help would be appreciated,

Bernd

[1] http://finzi.psych.upenn.edu/R/Rhelp02a/archive/21118.html

-- 
Bernd Weiss, M.A.
Universitaet zu Koeln / University of Cologne
Forschungsinstitut fuer Soziologie / Research Institute for Sociology
Greinstr. 2 / 50 939 Cologne / Germany
Phone: +49 221 / 470-4234
E-Mail: <[EMAIL PROTECTED]>


[[alternative HTML version deleted]]

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


Re: [R] x[x > y] and more conditions

2003-11-18 Thread Prof Brian Ripley
Did you mean == not = ?

On Tue, 18 Nov 2003, Christian Schulz wrote:

> ...and  i'm getting all cases which
> are true for above condition and get the information
> how many cases match, too. The vector's are in a attached data.frame.
> 
> FAKTOR30[FAKTOR30 > 0.234]
> ...
> [102193] 0.352 0.352 0.288 0.354 0.352 0.358 0.352 0.352 0.311 0.370 0.352
> 0.336
> [102205] 0.352 0.274 0.352 0.405 0.354 0.352 0.352 0.352 0.352 0.352 0.352
> 0.340
> [102217] 0.352 0.352
> 
> 
> But if i use more than one "index" term
> UMSATZ30[UMSATZ30 > 10] && FAKTOR30[FAKTOR30 = 0.234]
> 
> [1] NA
> 
> I get  true, false  or NA  and the latter i think this mean there isn't any
> case with this condition!?
> But, how can i check cases with more than one condition like the single
> example, i trial some but getting no success?

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


Re: [R] Problems installing lattice

2003-11-18 Thread alessandro . semeria

Have you installed 'grid' pkg before lattice?
Look at dependencies !

A.S.



Alessandro Semeria
Models and Simulations Laboratory
Montecatini Environmental Research Center (Edison Group),
Via Ciro Menotti 48,
48023 Marina di Ravenna (RA), Italy
Tel. +39 544 536811
Fax. +39 544 538663
E-mail: [EMAIL PROTECTED]

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


[R] readline not found

2003-11-18 Thread Laurent Faisnel
Hi all,

I just upgraded to R-1.8.0. Everything worked fine but command line 
editing does not work. This clearly indicates that readline has not been 
found in the compilation process.

How could I explicitely indicate where to find it ?

I use a Red Hat 8.0 system. I checked the FAQ which says readline-devel 
is also needed, but I have it already installed. Perhaps should I add 
the configure option --with-readline=path/to/readline ?

>> rpm -qva | grep readline
readline-4.3-4
readline-devel-4.3-4
readline41-4.1-14
Is there a problem with that readline41 version ?

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


Re: [R] package compilation

2003-11-18 Thread Prof Brian Ripley
On Tue, 18 Nov 2003, Uwe Ligges wrote:

> 
> 
> On Tue, 18 Nov 2003, Joerg Schaber wrote:
> 
> > I recently wrote a new R package, which I could 'R CMD check' and 'R CMD 
> > build' nicely on my Intel Linux PC. Loading the new library as a normal 
> > user on my PC also works nicely.
> > This packages includes some compiled C-code in a shared library. 
> > However, before submitting the package to CRAN I wanted to install it 
> > also under an other platform in order to check if everything works 
> >  fine. Obviously, in order to install it under another platform I have 
> > to recompile the shared lib. So I added a /src directory in the library 
> > containing the C source code and than run a 'R CMD build'. However, 
> > running 'R CMD INSTALL'  on the resulting tar.gz archive does not 
> > recompile the source code on the new machine. But installing other 
> > packages having a /src directory the source code is recompiled.
> > So what do I have to do that running a 'R CMD install' on my *tar.gz 
> > file recompiles de source code and creates a platform dependend shared lib?
> 
> You have to remove any binaries from that directory, but R CMD build
> should have done it for you. Or does the compilation fails out of other
> reasons? It's hard to guess without any more details.

If you really run R CMD INSTALL foo.tar.gz (note capitals) then foo.tar.gz
is unpacked to a temporary directory and so the .so will be recompiled.

I suspect it find nothing to compile: check carefully what is in the 
foo.tar.gz.

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


AW: [R] x[x > y] and more conditions

2003-11-18 Thread Christian Schulz
Thanks for the hint's, and sorry
for my confusing, which come from my
sql activity which need &&  or AND.

regards,christian




-Ursprungliche Nachricht-
Von: Uwe Ligges [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 18. November 2003 11:29
An: Christian Schulz
Cc: R-Help
Betreff: Re: [R] x[x > y] and more conditions




On Tue, 18 Nov 2003, Christian Schulz wrote:

> ...and  i'm getting all cases which
> are true for above condition and get the information
> how many cases match, too. The vector's are in a attached data.frame.
>
> FAKTOR30[FAKTOR30 > 0.234]
> ...
> [102193] 0.352 0.352 0.288 0.354 0.352 0.358 0.352 0.352 0.311 0.370 0.352
> 0.336
> [102205] 0.352 0.274 0.352 0.405 0.354 0.352 0.352 0.352 0.352 0.352 0.352
> 0.340
> [102217] 0.352 0.352
>
>
> But if i use more than one "index" term
> UMSATZ30[UMSATZ30 > 10] && FAKTOR30[FAKTOR30 = 0.234]
>
> [1] NA

See ?"&&" which tells you to use "&" instead os "&&" for vectorized
logical operations like this one.

Using "&&" only evaluates the first elements of those logical vectors, so
there seems to be an NA in UMSATZ30[1] or FAKTOR30[1]

Uwe Ligges


> I get  true, false  or NA  and the latter i think this mean there isn't
any
> case with this condition!?
> But, how can i check cases with more than one condition like the single
> example, i trial some but getting no success?
>
> Many thanks for help,
> christian
>
> __
> [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] readline not found

2003-11-18 Thread Peter Dalgaard
Laurent Faisnel <[EMAIL PROTECTED]> writes:

> Hi all,
> 
> I just upgraded to R-1.8.0. Everything worked fine but command line
> editing does not work. This clearly indicates that readline has not
> been found in the compilation process.
> 
> How could I explicitely indicate where to find it ?
> 
> I use a Red Hat 8.0 system. I checked the FAQ which says
> readline-devel is also needed, but I have it already installed.
> Perhaps should I add the configure option
> --with-readline=path/to/readline ?
> 
>  >> rpm -qva | grep readline
> readline-4.3-4
> readline-devel-4.3-4
> readline41-4.1-14
> 
> Is there a problem with that readline41 version ?

It shouldn't get used. This should work cleanly on RH8.0 and does for
me. Best idea I can come up with is to clean up, reconfigure, and
check the out put and configure log for some anomaly in your local
configuration (paths, something hardcoding --without-readline, etc.).

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


[R] installing a local package in RAqua

2003-11-18 Thread John Christie
Hi,
How does one install a package that is local rather than on CRAN?
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] aov with Error and lme

2003-11-18 Thread Karl Knoblick
Hi

I searched in the list and only found questions
without answers e.g.
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/19955.html
: Is there a way to get the same results with lme as
with aov with Error()?

Can anybody reproduce the following results with lme:
id<-c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5)
factA<-c("al","al","al","al","al","al","al","al","al","al","al","al","al","al","al","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3")
factB<-c("B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3")
Y<-c(56,52,48,57,54,46,55,51,51,58,51,50,54,53,46,54,50,49,53,49,48,56,48,52,52,52,50,55,51,46,57,49,50,55,51,47,56,48,51,58,50,48,58,46,52)

df<-data.frame(id, factA, factB, Y)

df$id<-as.factor(df$id)
df.aov <- aov(Y ~ factA*factB + Error(factA:id),
data=df)
summary(df.aov)

Hope, somebody can help!

Karl





__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de

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


Re: [R] aov with Error and lme

2003-11-18 Thread Prof Brian Ripley
There are worked examples in MASS (at least the last two editions) of
getting `the same results with lme as with aov with Error()'.

Your over-long lines make it difficult to see, but this appears to be very 
similar to examples both in MASS and in Pinheiro & Bates.  Have you 
consulted either?


On Tue, 18 Nov 2003, Karl Knoblick wrote:

> I searched in the list and only found questions
> without answers e.g.
> http://finzi.psych.upenn.edu/R/Rhelp02a/archive/19955.html
> : Is there a way to get the same results with lme as
> with aov with Error()?
> 
> Can anybody reproduce the following results with lme:
> id<-c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5)
> factA<-c("al","al","al","al","al","al","al","al","al","al","al","al","al","al","al","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3")
> factB<-c("B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3")
> Y<-c(56,52,48,57,54,46,55,51,51,58,51,50,54,53,46,54,50,49,53,49,48,56,48,52,52,52,50,55,51,46,57,49,50,55,51,47,56,48,51,58,50,48,58,46,52)
> 
> df<-data.frame(id, factA, factB, Y)
> 
> df$id<-as.factor(df$id)
> df.aov <- aov(Y ~ factA*factB + Error(factA:id),
> data=df)
> summary(df.aov)

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


Re: [R] installing a local package in RAqua

2003-11-18 Thread John Christie
RAqua doesn't provide the external command capability.  Unless...

OK, I see, I can call R from the command line by giving the full path 
through the package.

On Nov 18, 2003, at 8:47 AM, a helpful list reader wrote:

On Tue, 2003-11-18 at 07:13, John Christie wrote:
Hi,
How does one install a package that is local rather than on CRAN?
I have'nt used RAqua but the docs mention R CMD INSTALL packagname
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] \preformatted and $

2003-11-18 Thread Arend P. van der Veen
I found my problem with the second item ('$').  As far as the first
problem with \preformatted, I check the tex code that was generated and
found that 

\end{verbatim}\end{Details}

However, if I add some text between the preformatted text and the end of
the detail section it works.  I will use that as a work around.

\details{
some text
\preformatted{
[my-section]
user = apv
host = 127.0.0.1
}
some more text
}

If anybody knows if this bug is corrected in the patch please let me
know.

Thanks,
Arend  

On Tue, 2003-11-18 at 04:40, Uwe Ligges wrote:
> On 17 Nov 2003, Arend P. van der Veen wrote:
> 
> > Hi,
> > 
> > I have been developing a package in R and have been working on
> > documentation.  I have a \details function that contains the following:
> > 
> > \details{
> > 
> > some text
> > 
> > \preformatted{
> > [my-section]
> > user = apv
> > host = 127.0.0.1
> > }
> > 
> > }
> > 
> >  When I run R CMD check I get an error while checking the manual.  If I
> > remove:
> > 
> > \preformatted{
> > [my-section]
> > user = apv
> > host = 127.0.0.1
> > }
> > 
> > and replace it with 
> > 
> > [my-section]
> > user = apv
> > host = 127.0.0.1
> > 
> > the error goes away.
> > 
> > Has anybody had this problem?  
> 
> Confirmed. The problem is that there is no newline after
> \end{verbatim}
> in the produced TeX code, so we get, e.g.:
> \end{verbatim}\end{Details}
> .
> 
> Might be fixed in R-patched (I don't have access right now).
> 
> 
> > 
> > I have also have a problem including a '$' in my documentation.  I
> > replace them with \$ which made latex happy but then \$ showed up in the
> > HTML and R help.
> 
> Hmmm. All of the following works for me:
> 
> \$, \code{$}, and \deqn{\$}{$}
> 
> 
> Uwe Ligges
> 
> 
> 
> > Any advice would be appreciated,
> > Arend van der Veen
> > 
> > __
> > [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] howto improve sharpeness of fonts in a jpg-image produced by R ?

2003-11-18 Thread Niels Steen Krogh
Hi.
I've done a standard barplotexample using R1-8.0, redhat8, probably using a 
GhostScript-integration.

How can I improve the "sharpness" of the fonts.
See for example the barplot (originally jpg coming from R) which is part of 
this screendump:
http://www.zug.dk/Members/Nielssteenkrogh/1067525916309553166/element_103003161029

I'm not sure where to improve the this. Is it an R-issue or an 
GhostScript-issue or?

/Niels

Cand. Polit.
Niels Steen Krogh
Solsortvej 44
2000 F.
Tlf: 3888 8613

ZiteLab / EmpoweR youR data with R, Zope and SOAP

_
Få alle de nye og sjove ikoner med MSN Messenger http://messenger.msn.dk/
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Looking for recommendations for optimal memory settings

2003-11-18 Thread Douglas Bates
Prof Brian Ripley <[EMAIL PROTECTED]> writes:

> On Mon, 17 Nov 2003, Busch, Joe wrote:
> 
> > We have a Windows 2000 operating system and I need to configure the
> > workstations.  What are your recommendations for users with very large data
> > sets (300Mb)?  The systems are Dell GX240s with 512 Mbs of Ram.  What
> > command line or environment variables work best?
> 
> The default ones.  Just add another 1.5Gb of RAM and then consider
> using --max-mem-size, the only setting that will make any real difference.
> (The next minor version of R, probably 1.9.0, will make better use of 2Gb 
> under Windows than the current one, so you may want to compile up 
> pre-releases of that.)

>From what I can see in looking at a couple of reviews, the GX240 uses
PC133 DIMMs and comes standard with 256 MB.  Depending on the number
of DIMM slots on the motherboard and the capacity of each slot it may
only be able to handle 1GB of memory and even that may mean removing
the 256 MB DIMMs to replace them with 512 MB DIMMs.  The good news is
that doing so is reasonably cheap.  According to www.pricewatch.com PC133
512 MB DIMMs are available for as little as (US)$40 whereas PC133 1 GB
DIMMs are (US)$160 and up.

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


Re: [R] \preformatted and $

2003-11-18 Thread Prof Brian Ripley
On 18 Nov 2003, Arend P. van der Veen wrote:

> I found my problem with the second item ('$').  As far as the first
> problem with \preformatted, I check the tex code that was generated and
> found that 
> 
> \end{verbatim}\end{Details}
> 
> However, if I add some text between the preformatted text and the end of
> the detail section it works.  I will use that as a work around.
> 
> \details{
> some text
> \preformatted{
> [my-section]
> user = apv
> host = 127.0.0.1
> }
> some more text
> }
> 
> If anybody knows if this bug is corrected in the patch please let me
> know.

Not yet, as this is not actually the bug: look what happens when there is 
text at the end of the \details section.

> 
> Thanks,
> Arend  
> 
> On Tue, 2003-11-18 at 04:40, Uwe Ligges wrote:
> > On 17 Nov 2003, Arend P. van der Veen wrote:
> > 
> > > Hi,
> > > 
> > > I have been developing a package in R and have been working on
> > > documentation.  I have a \details function that contains the following:
> > > 
> > > \details{
> > > 
> > > some text
> > > 
> > > \preformatted{
> > > [my-section]
> > > user = apv
> > > host = 127.0.0.1
> > > }
> > > 
> > > }
> > > 
> > >  When I run R CMD check I get an error while checking the manual.  If I
> > > remove:
> > > 
> > > \preformatted{
> > > [my-section]
> > > user = apv
> > > host = 127.0.0.1
> > > }
> > > 
> > > and replace it with 
> > > 
> > > [my-section]
> > > user = apv
> > > host = 127.0.0.1
> > > 
> > > the error goes away.
> > > 
> > > Has anybody had this problem?  
> > 
> > Confirmed. The problem is that there is no newline after
> > \end{verbatim}
> > in the produced TeX code, so we get, e.g.:
> > \end{verbatim}\end{Details}
> > .
> > 
> > Might be fixed in R-patched (I don't have access right now).
> > 
> > 
> > > 
> > > I have also have a problem including a '$' in my documentation.  I
> > > replace them with \$ which made latex happy but then \$ showed up in the
> > > HTML and R help.
> > 
> > Hmmm. All of the following works for me:
> > 
> > \$, \code{$}, and \deqn{\$}{$}
> > 
> > 
> > Uwe Ligges
> > 
> > 
> > 
> > > Any advice would be appreciated,
> > > Arend van der Veen
> > > 
> > > __
> > > [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

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


Re: [R] mixed model for Splus and R

2003-11-18 Thread Douglas Bates
Lei Liu <[EMAIL PROTECTED]> writes:

> I try to compare the mixed model package "lme" by Splus and R. I used the 
> dataset "Ovary" and the following code assuming AR(1) model for the error term:
> 
> lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data=Ovary, random = 
> pdDiag(~sin(2*pi*Time) ) , correlation=corAR1() )
> 
> But I got different results! And then I used a simpler model:
> 
> lme(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), data=Ovary, random = 
> pdDiag(~sin(2*pi*Time)) )
> 
> This time I got the same output. I wonder the reason for the inconsistence 
> between R and Splus. I attached the results as follows. Can someone tell me 
> how to do it correctly in R? Thanks!
> 
> Lei
> 
> Result from R:
> 
> **
> Linear mixed-effects model fit by REML
>Data: Ovary
>Log-restricted-likelihood: -775.2224
>Fixed: follicles ~ sin(2 * pi * Time) + cos(2 * pi * Time)
> (Intercept) sin(2 * pi * Time) cos(2 * pi * Time)
>  12.1895808 -2.9473432 -0.8807113
> 
> Random effects:
>   Formula: ~sin(2 * pi * Time) | Mare
>   Structure: Diagonal
>  (Intercept) sin(2 * pi * Time) Residual
> StdDev:2.807293 0.03630784 3.665217
> 
> Correlation Structure: AR(1)
>   Formula: ~1 | Mare
>   Parameter estimate(s):
>Phi
> 0.6073908
> Number of Observations: 308
> Number of Groups: 11
> 
> *
> 
> Result from Splus:
> 
> *
> Linear mixed-effects model fit by REML
>Data: Ovary
>Log-restricted-likelihood: -774.724
>Fixed: follicles ~ sin(2 * pi * Time) + cos(2 * pi * Time)
>   (Intercept) sin(2 * pi * Time) cos(2 * pi * Time)
>  12.18809  -2.985282 -0.8777629
> 
> Random effects:
>   Formula:  ~ sin(2 * pi * Time) | Mare
>   Structure: Diagonal
>  (Intercept) sin(2 * pi * Time) Residual
> StdDev:2.8584781.25802 3.507097
> 
> Correlation Structure: AR(1)
>   Formula:  ~ 1 | Mare
>   Parameter estimate(s):
> Phi
>   0.5722019
> Number of Observations: 308
> Number of Groups: 11
>   
> **

S-PLUS and R use different optimizer code so the results will not be
identical.  You may want to check with intervals() to see how
well-defined the optima are.  Also try setting
control=list(msVerbose=TRUE) in the call to lme to see how the actual
optimization is behaving.

The log-likelihood in complex lme and nlme models can be a difficult
function to optimize.  I am aware that the results from R's optimizer(s)
are not always as good as those from the optimizer used in S-PLUS and
we are working on rectifying that problem.

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


Re: [R] howto improve sharpeness of fonts in a jpg-image produced by R ?

2003-11-18 Thread Prof Brian Ripley
There are two ways to make jpgs in R: which did you use?

If you want a sharp image, why are you using a format designed for 
photographic images?

I suspect your viewer: that example seems as sharp as I would expect 
viewed in a high-quality JPEG viewer on my LCD screen.

On Tue, 18 Nov 2003, Niels Steen Krogh wrote:

> Hi.
> I've done a standard barplotexample using R1-8.0, redhat8, probably using a 
> GhostScript-integration.
> 
> How can I improve the "sharpness" of the fonts.
> See for example the barplot (originally jpg coming from R) which is part of 
> this screendump:
> http://www.zug.dk/Members/Nielssteenkrogh/1067525916309553166/element_103003161029
> 
> I'm not sure where to improve the this. Is it an R-issue or an 
> GhostScript-issue or?

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


Re: [R] aov with Error and lme

2003-11-18 Thread Karl Knoblick
Thanks!

But I could not find it in MASS 2nd edition, also not
a similiar example to mine in Pinheiro Bates. I
thought at least for a balanced and quite simple
design the results should be equal. Is that wrong?

Karl.

 --- Prof Brian Ripley <[EMAIL PROTECTED]>
schrieb: > There are worked examples in MASS (at least
the last
> two editions) of
> getting `the same results with lme as with aov with
> Error()'.
> 
> Your over-long lines make it difficult to see, but
> this appears to be very 
> similar to examples both in MASS and in Pinheiro &
> Bates.  Have you 
> consulted either?
> 
> 
> On Tue, 18 Nov 2003, Karl Knoblick wrote:
> 
> > I searched in the list and only found questions
> > without answers e.g.
> >
>
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/19955.html
> > : Is there a way to get the same results with lme
> as
> > with aov with Error()?
> > 
> > Can anybody reproduce the following results with
> lme:
> >
>
id<-c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5)
> >
>
factA<-c("al","al","al","al","al","al","al","al","al","al","al","al","al","al","al","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a2","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3","a3")
> >
>
factB<-c("B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3","B1","B2","B3")
> >
>
Y<-c(56,52,48,57,54,46,55,51,51,58,51,50,54,53,46,54,50,49,53,49,48,56,48,52,52,52,50,55,51,46,57,49,50,55,51,47,56,48,51,58,50,48,58,46,52)
> > 
> > df<-data.frame(id, factA, factB, Y)
> > 
> > df$id<-as.factor(df$id)
> > df.aov <- aov(Y ~ factA*factB + Error(factA:id),
> > data=df)
> > summary(df.aov)
> 
> -- 
> 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
>  


__

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de

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


[R] Invalid Characters for hclust or dist

2003-11-18 Thread Leandro Guimarÿffffe3es
Hi !!

   How are you ? Fines, I hope.

   Well, I'm using this function:

 hclust(dist(x), "ave);

   Where x is a table with my data.

   So, when I execute this, I was getting this error:

   "NA/NaN/Inf in foreign function call"

   I discovered this error was generated because in my
labels data there was a ' (single quote). I removed
this characters, in all ocorrencies, and the errors
stopped.

   I would want to know if there are others characters
that would generate this some problem...

   Thanks a lot and so sorry for my bad English.

Regards,

Leandro

Yahoo! Mail - 6MB, anti-spam e antivírus gratuito. Crie sua conta agora:
http://mail.yahoo.com.br

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


Re: [R] howto improve sharpeness of fonts in a jpg-image produced by R ?

2003-11-18 Thread Marc Schwartz
On Tue, 2003-11-18 at 07:45, Niels Steen Krogh wrote:
> Hi.
> I've done a standard barplotexample using R1-8.0, redhat8, probably using a 
> GhostScript-integration.
> 
> How can I improve the "sharpness" of the fonts.
> See for example the barplot (originally jpg coming from R) which is part of 
> this screendump:
> http://www.zug.dk/Members/Nielssteenkrogh/1067525916309553166/element_103003161029
> 
> I'm not sure where to improve the this. Is it an R-issue or an 
> GhostScript-issue or?
> 
> /Niels


In general for fonts, using bitmapped image formats are not the best way
to go since they cannot result in "smooth" curves.

Depending upon how you plan to actually use the images, PS/EPS/PDF
vector based image formats would yield higher quality images and fonts.

Be aware also that bitmapped images do not resize well, which is another
limitation of that format.

HTH,

Marc Schwartz

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


Re: [R] howto improve sharpeness of fonts in a jpg-image produced by R ?

2003-11-18 Thread Niels Steen Krogh
I used an expression like this:

bitmap(file="barplotx.jpg",type="jpeg")
barplot(c(1,2,3),c(3,4,5),main=list("Death Rates in Virginia", font = 1))
dev.off()
My question:  How can I improve the sharpeness of the text "Death Rates in 
Virginia".
Why jpeg: Its part of a web-environment using R through a SOAP-server. I 
also tried png256, jpeggray and others, but the text "Death Rates in 
Virginia" does not change sharpeness.

/Niels





Cand. Polit.
Niels Steen Krogh
Solsortvej 44
2000 F.
Tlf: 3888 8613

ZiteLab / EmpoweR youR data with R, Zope and SOAP




From: Prof Brian Ripley <[EMAIL PROTECTED]>
To: Niels Steen Krogh <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: [R] howto improve sharpeness of fonts in a jpg-image produced 
by R ?
Date: Tue, 18 Nov 2003 14:11:20 + (GMT)

There are two ways to make jpgs in R: which did you use?

If you want a sharp image, why are you using a format designed for
photographic images?
I suspect your viewer: that example seems as sharp as I would expect
viewed in a high-quality JPEG viewer on my LCD screen.
On Tue, 18 Nov 2003, Niels Steen Krogh wrote:

> Hi.
> I've done a standard barplotexample using R1-8.0, redhat8, probably 
using a
> GhostScript-integration.
>
> How can I improve the "sharpness" of the fonts.
> See for example the barplot (originally jpg coming from R) which is part 
of
> this screendump:
> 
http://www.zug.dk/Members/Nielssteenkrogh/1067525916309553166/element_103003161029
>
> I'm not sure where to improve the this. Is it an R-issue or an
> GhostScript-issue or?

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

_
Få alle de nye og sjove ikoner med MSN Messenger http://messenger.msn.dk/
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Problems installing lattice

2003-11-18 Thread Deepayan Sarkar

What version of lattice is this ? (try library(help = lattice)). What happens 
when you type library(grid) ?

Both grid and lattice are recommended packages, so appropriate versions of 
both should have been installed along with R 1.8.1. From your error message 
(which mentions /usr/local/lib/R/site-library), I'm guessing you are using 
Debian. If that's the case, please check if you have r-recommended installed, 
and whether it has the same version as r-base-core. Dirk uploaded the 1.8.1 
beta packages very recently, so they may not have made it to all the mirrors 
when you upgraded.

If this does not work, we need to know how you installed R to make any further 
diagnosis.  

Deepayan

On Tuesday 18 November 2003 04:56, Bernd Weiss wrote:
> Dear all,
>
> I am not able to install the lattice package. After finishing the
> installation, I got the following error massage:
>
> ---snip---
> Delete downloaded files (y/N)? y
>
> Warning message:
> argument `lib' is missing: using /usr/local/lib/R/site-library in:
> install.packages("lattice")
>
> > library(lattice)
>
> Error in loadNamespace(i, c(lib.loc, .libPaths()), keep.source) :
> There is no package called 'grid'
> Error in library(lattice) : package/namespace load failed
>
> ---snap---
>
> Some weaks ago a similar thread took place on this list [1]. I am using
>
> > version
>
>  _
> platform i386-pc-linux-gnu
> arch i386
> os   linux-gnu
> system   i386, linux-gnu
> status   beta
> major1
> minor8.1
> year 2003
> month11
> day  14
> language R
>
> So, I don't think, that my version of R should be updated.
>
> Any help would be appreciated,
>
> Bernd
>
> [1] http://finzi.psych.upenn.edu/R/Rhelp02a/archive/21118.html

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


Re: [R] installing a local package in RAqua

2003-11-18 Thread Thomas Lumley
On Tue, 18 Nov 2003, John Christie wrote:

>
> RAqua doesn't provide the external command capability.  Unless...
>

RAqua has a menu item on the packages menu to install a local source
package.

-thomas

> OK, I see, I can call R from the command line by giving the full path
> through the package.
>
> On Nov 18, 2003, at 8:47 AM, a helpful list reader wrote:
>
> > On Tue, 2003-11-18 at 07:13, John Christie wrote:
> >> Hi,
> >>How does one install a package that is local rather than on CRAN?
> >
> > I have'nt used RAqua but the docs mention R CMD INSTALL packagname
>
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>

Thomas Lumley   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]   University of Washington, Seattle

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


Re: [R] howto improve sharpeness of fonts in a jpg-image produced by R ?

2003-11-18 Thread Prof Brian D Ripley
On Tue, 18 Nov 2003, Niels Steen Krogh wrote:

> I used an expression like this:
>
> bitmap(file="barplotx.jpg",type="jpeg")

So that was nothing to do with R, as reading the help page would have told
you.  Your subject line is false: the `jpg-image' was produced by gs and
you should look into fixing your problems with that.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UKFax:  +44 1865 272595

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


[R] Histogram

2003-11-18 Thread Arend P. van der Veen
Hi,

I have what should be a simple question.  I would like to generate a
histogram of

x <- c("a","b","c","b","c","c")

where the first bar to be labeled 'c' with height 3, second bar to be
labeled 'b' with height 2 and third bar to be labeled 'a' with height 1.

This should be an easy task in R but I think I am missing something?

Thanks,
Arend van der Veen

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


Re: [R] Histogram

2003-11-18 Thread Ben Bolker


plot(table(factor(x,levels=c("c","b","a"

is at least approximately what you want (the only complicated bit is 
reversing the order of the bars from the default alphabetical order)

substituting barplot() for plot() also works

you may want to use ylab="something" in the plot or barplot command to get 
a more descriptive axis label

On 18 Nov 2003, Arend P. van der Veen wrote:

> Hi,
> 
> I have what should be a simple question.  I would like to generate a
> histogram of
> 
> x <- c("a","b","c","b","c","c")
> 
> where the first bar to be labeled 'c' with height 3, second bar to be
> labeled 'b' with height 2 and third bar to be labeled 'a' with height 1.
> 
> This should be an easy task in R but I think I am missing something?
> 
> Thanks,
> Arend van der Veen
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

-- 
620B Bartram Hall[EMAIL PROTECTED]
Zoology Department, University of Floridahttp://www.zoo.ufl.edu/bolker
Box 118525   (ph)  352-392-5697
Gainesville, FL 32611-8525   (fax) 352-392-3704

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


Re: [R] Histogram

2003-11-18 Thread Uwe Ligges


On 18 Nov 2003, Arend P. van der Veen wrote:

> Hi,
> 
> I have what should be a simple question.  I would like to generate a
> histogram of
> 
> x <- c("a","b","c","b","c","c")
> 
> where the first bar to be labeled 'c' with height 3, second bar to be
> labeled 'b' with height 2 and third bar to be labeled 'a' with height 1.
> 
> This should be an easy task in R but I think I am missing something?
> 
> Thanks,
> Arend van der Veen
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 

You don't want a histogram, but a barplot:
barplot(table(x))

Uwe Ligges

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


Re: [R] Histogram

2003-11-18 Thread Ryota Suzuki
Arend P. van der Veen wrote:
(B> Hi,
(B>
(B> I have what should be a simple question.  I would like to generate a
(B> histogram of
(B>
(B> x <- c("a","b","c","b","c","c")
(B>
(B> where the first bar to be labeled 'c' with height 3, second bar to be
(B> labeled 'b' with height 2 and third bar to be labeled 'a' with height 1.
(B
(BMaybe the following would help you:
(B
(Bx <- c("a","b","c","b","c","c")
(Bx.fac <- factor(x)
(Bplot(x.fac)
(B
(BBest Regards,
(BRyota Suzuki
(B
(B>
(B> This should be an easy task in R but I think I am missing something?
(B>
(B> Thanks,
(B> Arend van der Veen
(B>
(B> __
(B> [EMAIL PROTECTED] mailing list
(B> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
(B>
(B
(B__
(B[EMAIL PROTECTED] mailing list
(Bhttps://www.stat.math.ethz.ch/mailman/listinfo/r-help

Re: [R] Histogram

2003-11-18 Thread Peter Dalgaard
"Arend P. van der Veen" <[EMAIL PROTECTED]> writes:

> Hi,
> 
> I have what should be a simple question.  I would like to generate a
> histogram of
> 
> x <- c("a","b","c","b","c","c")
> 
> where the first bar to be labeled 'c' with height 3, second bar to be
> labeled 'b' with height 2 and third bar to be labeled 'a' with height 1.
> 
> This should be an easy task in R but I think I am missing something?

That's not a histogram...

barplot(rev(table(x)))

will do it, or - allowing more general level shuffling - 

barplot(table(factor(x,levels=c("c","b","a"

or 

barplot(rev(sort(table(x

if you want the columns by decreasing frequency.

-- 
   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] howto improve sharpeness of fonts in a jpg-image produced by R ?

2003-11-18 Thread Marc Schwartz
On Tue, 2003-11-18 at 09:04, Niels Steen Krogh wrote:
> I used an expression like this:
> 
> bitmap(file="barplotx.jpg",type="jpeg")
> barplot(c(1,2,3),c(3,4,5),main=list("Death Rates in Virginia", font = 1))
> dev.off()
> 
> 
> My question:  How can I improve the sharpeness of the text "Death Rates in 
> Virginia".
> Why jpeg: Its part of a web-environment using R through a SOAP-server. I 
> also tried png256, jpeggray and others, but the text "Death Rates in 
> Virginia" does not change sharpeness.
> 
> 
> /Niels

SNIP

As Prof. Ripley indicated, this is a Ghostscript (GS) issue, where R is
simply providing an interface of sorts to that application.

One option, at the expense of larger file and image size, is to increase
the dpi resolution for the image that GS generates, using the 'res'
argument in bitmap():

bitmap(file = "barplotx300.jpg", type = "jpeg", res = 300)
barplot(c(1, 2, 3), c(3, 4, 5), 
main = list("Death Rates in Virginia",  font = 1))
dev.off()

You will likely get a better result (and a smaller file size) using a
PNG format file, if you must stay with a bitmapped approach:

bitmap(file = "barplotx300.png", type = "png256", res = 300)
barplot(c(1, 2, 3), c(3, 4, 5), 
main = list("Death Rates in Virginia",  font = 1))
dev.off()

Keep in mind that PNG uses a lossless compression approach, whereas JPEG
will typically use a lossy compression, which results in a general
degradation of the image quality.

You can play around with the resolution settings until you get something
that is acceptable. The default is 72 which is fine for photographs in
browsers, but not for plots.

Keep in mind that the above will result in larger image dimensions using
the default height and width arguments. The above images will be 1800 x
1800 pixels, so you will need to scale accordingly. Notice however, that
even upon magnification, the fonts are still not as crisp as a vector
format image.

For example, try these and zoom in on the text:

pdf(file = "barplotx.pdf")
barplot(c(1, 2, 3), c(3, 4, 5), 
main = list("Death Rates in Virginia", font = 1))
dev.off()

or this:

postscript(file = "barplotx.ps")
barplot(c(1, 2, 3), c(3, 4, 5), 
main = list("Death Rates in Virginia", font = 1))
dev.off()

Both the PDF and PS formats will look even better printed.

HTH,

Marc Schwartz

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


Re: [R] Histogram

2003-11-18 Thread Duncan Murdoch
On 18 Nov 2003 10:29:50 -0500, "Arend P. van der Veen"
<[EMAIL PROTECTED]> wrote :

>Hi,
>
>I have what should be a simple question.  I would like to generate a
>histogram of
>
>x <- c("a","b","c","b","c","c")
>
>where the first bar to be labeled 'c' with height 3, second bar to be
>labeled 'b' with height 2 and third bar to be labeled 'a' with height 1.
>
>This should be an easy task in R but I think I am missing something?

Try  barplot(rev(table(x))).

You use table() to calculate frequencies of discrete classes (and
hist() to count frequencies of different bins for continuous
variables), rev() to reverse the order from the natural order, and
barplot() to plot the bars.

Duncan Murdoch

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


Re: [R] Copula calculation in R?

2003-11-18 Thread Martin Maechler

Hello
Anyone that now of any function in R that can calculate copulas?
Or if anyone have any code avaible I would be more than interested. 

Thank you in advance

/Thomas

__
[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] time series

2003-11-18 Thread gregory
Hi the list,

I did not find what I was looking for in archives, thus I decide to send 
this mail.

I would like to do a regression on this kind of dataset where s1 et s2 
are values of the same variable:

time   0  1560240
s1  A1   B1   C1D1
s2  A2   B2   C1D2
I tryed in vain to use the ts package but it seems I am not able to 
create a ts object with my dataframe.

In advance thank a lot

Greg

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


Re: [R] Copula calculation in R?

2003-11-18 Thread Martin Maechler
I'm sorry for my accidental reply

(which was caused by the fact that you were lazy and did 
 reply to an *existing* r-help posting and changed the subject
 instead of writing a new e-mail -- this destroys all threading
 ("sort+indent according to one topic") in the archives and many
 people's mail readers 
)

>> Hello
>> Anyone that now of any function in R that can calculate copulas?
>> Or if anyone have any code avaible I would be more than interested. 

>> Thank you in advance

>> /Thomas

Now to the answer:  There is some S-plus code around here at ETH
that I could get.  Please inquire privately if there isn't a
better answer here.

Regards,

Martin Maechler <[EMAIL PROTECTED]> http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16Leonhardstr. 27
ETH (Federal Inst. Technology)  8092 Zurich SWITZERLAND
phone: x-41-1-632-3408  fax: ...-1228   <><

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


[R] SVM question

2003-11-18 Thread Murad Nayal


Hello all,

I am trying to use svm (from the e1071 package) to solve a binary
classification problem. The two classes in my particular data set are
unequally populated. class 'I' (for important) has about 3000 instances
while class "B" (for background) has about 20,000. experimenting with
different classifiers I realized that in cases where such an asymmetry
exists there is a danger in trivially inflating accuracy levels by
biasing the classifier towards the more prevalent class. for example,
using the numbers cited above, if the testing set maintains the same
distribution of classes as the original data set then you can get an
accuracy of about 85% by simply classifying everything as a "B". an
unsatisfactory classifier given the 'importance' of detecting the "I"
class.

which brings me to my question: I am trying to adjust for these issues
by 

- using the class.weights parameter of svm: I couldn't quite get a sense
of how to use this parameter from the svm help page (or the introductory
papers on the libsvm web site). Is this supposed to be a vector of the
priors for the two classes i.e. c(I=.15,B=.85) (which gave me horrible
coverage of the 'I' class). is there any 'correct' or conventional
values to use for this parameter in cases of unequal sample sizes (for
example, the 'complement' of the priors: c(I=0.85,B=0.15) on the grounds
that these values will give the two classes in the dataset equal
weights. or is it simply another tunable parameter. 

- choosing training sets that contain randomly selected but equal
numbers of cases of each class (and testing on the remaining cases. this
is repeated to assess stability of the accuracy and coverage values).
here i get mediocre accuracy but respectable coverage of "I". This is
not strictly an R question, but I thought someone on the list might have
had recent experience with these types of problems and can offer some
comments about such an approach.

many thanks

 
-- 
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] adding variable

2003-11-18 Thread Martin Wegmann
Hello, 

I have count data of animals (here y, y1, y2...) and env. variables (x, x1, 
x2 ,).

I used a glm 

glm(y~x1+x2+x3)

glm(y1~x1+x2+x3)

and now I would like to add the count data of other species to investigate if 
they might have a bigger impact than the env. variables:

#x? are the selected var from the first glm run

glm(y~x?+x?+y1)

glm(y~x?+x?+x?+y2)



I wonder if there is a more elegant method to do this than adding (and 
removing) each y by hand. 

thanks in advance, cheers Martin

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


Re: [R] readline not found

2003-11-18 Thread Laurent Faisnel
The problem is solved.
I cc this mail to John who probably had the same kind of problem.
Peter Dalgaard wrote:
Laurent Faisnel <[EMAIL PROTECTED]> writes:

That's the part of the log where you have the debug information (at the 
top) :


configure:11773: gcc -o conftest -g -O2  -L/usr/local/lib conftest.c
-lreadline  -ldl -lm  >&5
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../libreadline.so:
undefined reference to `tgetnum'
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../libreadline.so:
undefined reference to `tgoto'
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../libreadline.so:
undefined reference to `tgetflag'
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../libreadline.so:
undefined reference to `BC'
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../libreadline.so:
undefined reference to `tputs'
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../libreadline.so:
undefined reference to `PC'
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../libreadline.so:
undefined reference to `tgetent'
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../libreadline.so:
undefined reference to `UP'
/usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../libreadline.so:
undefined reference to `tgetstr'


Oho... I think those routines are from libncurses,
I'm very impressed by your intuition (or memory). That's exactly where 
the problem was.

so you might be
needing
ncurses-5.2-28
I already had this one installed. Not sufficient.

ncurses-devel-5.2-28
But not this one. Once it is installed, evrything works fine and I have 
a readline-enabled R version.

(not sure you really need the last one, but...)

It's really needed.

More info : http://dbforums.com/arch/147/2002/12/608415 (exactly the same)

Peter : Thanks a lot.

John : Hope it's a solution to your problem too.


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


[R] \samp tag

2003-11-18 Thread Joerg Schaber
Hi

including the  \samp tag in Rd files gives me errors creating the 
tex-documentation.
How can I escape literal sequences in Rd files? \preformatted also does 
not seem to work.

joerg

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


Re: [R] adding variable

2003-11-18 Thread Prof Brian Ripley
On Tue, 18 Nov 2003, Martin Wegmann wrote:

> I have count data of animals (here y, y1, y2...) and env. variables (x, x1, 
> x2 ,).
> 
> I used a glm 
> 
> glm(y~x1+x2+x3)
> 
> glm(y1~x1+x2+x3)
> 
> and now I would like to add the count data of other species to investigate if 
> they might have a bigger impact than the env. variables:
> 
> #x? are the selected var from the first glm run
> 
> glm(y~x?+x?+y1)
> 
> glm(y~x?+x?+x?+y2)
> 
> 
> 
> I wonder if there is a more elegant method to do this than adding (and 
> removing) each y by hand. 

Do you mean each x?  In either case, see ?update.

-- 
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] model formula

2003-11-18 Thread Bill Simpson
I have continuous variables x, y, z. The plot of the data looks like this:

y
|   z=1(o), 2(@), 3(#), 4(*)
|
|*   *  *
|
|
|#   #   #  #
|
|
|@@@  @
|
| o
|   o
|  o
| o  
|o
 x
The correct model appears to be: if z==1, y~x+z; else y~z
(y~z + z:x isn't it)

How can I express this model in lm()? If I can't express it properly in
lm(), what is the best way to fit the model?

Thanks for any help.

Bill Simpson

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


Re: [R] \samp tag

2003-11-18 Thread Prof Brian Ripley
On Tue, 18 Nov 2003, Joerg Schaber wrote:

> including the  \samp tag in Rd files gives me errors creating the 
> tex-documentation.

Examples, please.

> How can I escape literal sequences in Rd files?

See `Writing R Extensions' for what needs escaping and how.

> \preformatted also does 
> not seem to work.

In what sense does \preformatted not seem to work?  An unrelated bug
in latex (sic) processing has been fixed based on earlier correspondence.

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


Re: [R] HMisc describe -- error with dates

2003-11-18 Thread tmurph6
Thank you Gabor and Frank for you replies last week. Unfortunately I still don't
get it (I'm kind of new at this). Just to recap: I'm starting with a Julian
date and want results presented as 11NOV2003, for example (or some other date
format with no time component). 

The HMisc describe function accepts variables that I have now formatted like
this   

>date.ddmmmyy(aidsdate)

whereas it does not like variables formatted like this

>dates(aidsdate,format="day.mon.year", origin=c(month = 1, day = 1, year =
1960))

which is what I was using with an earlier version of Hmisc.

I wasn't able to figure out how to use posix.

The problem now is that, unlike before, the dates are not sorted (at least not
chronologically--maybe like character variables) and I liked seeing the 5
lowest and highest dates in the describe output. 

Sorry for pestering, but it is a testimony to how much I like Hmisc :)

Thanks!

Tanya



Quoting Frank E Harrell Jr <[EMAIL PROTECTED]>:

> On Tue, 11 Nov 2003 20:40:50 -0500 (EST)
> "Gabor Grothendieck" <[EMAIL PROTECTED]> wrote:
> 
> > 
> > 
> > dates is part of chron.  There may be something wrong in 
> > Hmisc's detection of chron objects.
> > 
> > > chron(1)
> > [1] 01/02/70
> > 
> > > isChron(chron(1))
> > FALSE
> > 
> > ---
> >  
> > Date: Tue, 11 Nov 2003 20:06:38 -0500 
> > From: <[EMAIL PROTECTED]>
> > To: Frank E Harrell Jr <[EMAIL PROTECTED]> 
> > Cc: <[EMAIL PROTECTED]> 
> > Subject: Re: [R] HMisc describe -- error with dates 
> > 
> >  
> >  
> > I am using the chron package. I have no preference for which function I
> > use. I just want the most reliable format for HMisc functions and
> > general plotting. I like the ddmonyyy formats (e.g. 11NOV2003). What
> > would you recommend?
> 
> I like POSIX but chron should be workable.  The fix for isChron in Hmisc
> is:
> 
> function(x) {
>   cl <- class(x)
>   dc <- if(.R.) c('POSIXt','POSIXct','dates','times','chron') else
> c('timeDate','date','dates','times','chron')
>   length(cl) && any(cl %in% dc)
> }
> 
> But describe also runs this command:
> 
>   if(isdatetime) notime <- all(format(x.unique,"%H%M%S")=='00')
> 
> and such calls to format for chron objects (which actually calls
> format.dates if x.unique is a dates object) do not work.  So a few more
> modifications will need to be made in describe to work with chron objects,
> when time allows.
> 
> Frank
> 
> > 
> > Thank you!
> > 
> > Quoting Frank E Harrell Jr <[EMAIL PROTECTED]>:
> > 
> > > On Tue, 11 Nov 2003 18:28:24 -0500
> > > [EMAIL PROTECTED] wrote:
> > > 
> > > > Hello,
> > > > 
> > > > I am trying to use HMisc describe on a data frame. I have specified
> > > > certain variables as dates using, for example:
> > > > 
> > > > df1$aidsdate <- dates(aidsdate,format="day.mon.year",
> > > > origin=c(month = 1, day = 1, year = 1960))
> > > > 
> > > > When I use describe on the dataframe I get this error:
> > > > 
> > > > Error in Ops.dates(weights, x) : * not defined for chron objects
> > > > 
> > > > Has anyone had this problem? I had used the same method with an
> > > > older version of R and HMisc and it worked. 
> > > > 
> > > > Should be be formatting date variables differently?
> > > > 
> > > > Thank you!
> > > > 
> > > > Sincerely,
> > > > Tanya Murphy
> > > > 
> > > 
> > > In recent versions, describe for R recognizes date/times by one of the
> > > following classes: 'POSIXt','POSIXct','chron'. If you really need to
> > > use another date format I could be talked into extending the code for
> > > that if you can remind me where dates( ) is found. -Frank
> > > 
> > > ---
> > > Frank E Harrell Jr Professor and Chair School of Medicine
> > > Department of Biostatistics Vanderbilt University
> > >
> > 
> > __
> > [EMAIL PROTECTED] mailing list
> > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> 
> 
> ---
> Frank E Harrell JrProfessor and ChairSchool of Medicine
>   Department of BiostatisticsVanderbilt University
> 




-
This mail sent through IMP: http://horde.org/imp/

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


Re: [R] model formula

2003-11-18 Thread Peter Dalgaard
Bill Simpson <[EMAIL PROTECTED]> writes:

> I have continuous variables x, y, z. The plot of the data looks like this:
> 
> y
> |   z=1(o), 2(@), 3(#), 4(*)
> |
> |*   *  *
> |
> |
> |#   #   #  #
> |
> |
> |@@@  @
> |
> | o
> |   o
> |  o
> | o  
> |o
>  x
> The correct model appears to be: if z==1, y~x+z; else y~z
> (y~z + z:x isn't it)

Not if z really is continuous...

 
> How can I express this model in lm()? If I can't express it properly in
> lm(), what is the best way to fit the model?


I'd try something like 

x2 <- ifelse(z==1, x, 0)
z2 <- factor(z)

y ~ x2+z2


-- 
   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] model formula

2003-11-18 Thread John Fox
Dear Bill,

I believe that lm(y ~ z + I((z == 1)*x)) will give you what you want.

I hope that this helps,
 John
At 08:40 AM 11/18/2003 -0500, you wrote:
I have continuous variables x, y, z. The plot of the data looks like this:

y
|   z=1(o), 2(@), 3(#), 4(*)
|
|*   *  *
|
|
|#   #   #  #
|
|
|@@@  @
|
| o
|   o
|  o
| o
|o
 x
The correct model appears to be: if z==1, y~x+z; else y~z
(y~z + z:x isn't it)
How can I express this model in lm()? If I can't express it properly in
lm(), what is the best way to fit the model?

John Fox
Department of Sociology
McMaster University
email: [EMAIL PROTECTED]
web: http://www.socsci.mcmaster.ca/jfox
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] model formula

2003-11-18 Thread Bill Simpson
Thanks very much John & Peter for your help.

Bill

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


Re: [R] Copula calculation in R?

2003-11-18 Thread kjetil
On 18 Nov 2003 at 11:26, Thomas Holm wrote:

What is copulas?

Kjetil Halvorsen

> Hello
> 
> Anyone that now of any function in R that can calculate copulas?
> Or if anyone have any code avaible I would be more than interested. 
> 
> Thank you in advance
> 
> /Thomas
> 
> __
> [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] adding variable

2003-11-18 Thread Martin Wegmann
On Tuesday 18 November 2003 19:32, Prof Brian Ripley wrote:
> On Tue, 18 Nov 2003, Martin Wegmann wrote:
> > I have count data of animals (here y, y1, y2...) and env. variables (x,
> > x1, x2 ,).
> >
> > I used a glm
> >
> > glm(y~x1+x2+x3)
> >
> > glm(y1~x1+x2+x3)
> >
> > and now I would like to add the count data of other species to
> > investigate if they might have a bigger impact than the env. variables:
> >
> > #x? are the selected var from the first glm run
> >
> > glm(y~x?+x?+y1)
> >
> > glm(y~x?+x?+x?+y2)
> >
> > 
> >
> > I wonder if there is a more elegant method to do this than adding (and
> > removing) each y by hand.
>
> Do you mean each x?  In either case, see ?update.

update looks good but with update and with adding the y I have to do it 
manually. 

I thought something like doing 

glm(y~x+x1+x2++y§) 

where y§ is: grep y1 out of df.y run glm and name it
grep y2 out of df.y run glm .

until all y's of df.y has been onced included in the model.
every time only one y§ has to be included

the included x's have to be kept. I only want to look if one species variables 
has more explanation power than the env. variables.

perhaps this helps to understand what I am looking for:
I think bash scripts are not possible in R but it would look like such a bash 
script for GRASS:

for variable in y1 y2 y3  ; do

glm(y~x+x1+x2+$variable)->glm.$variable
; done

#where $variable refers to the name of read in y's.


Martin

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


Re: [R] Copula calculation in R?

2003-11-18 Thread Thomas Lumley
On Tue, 18 Nov 2003 [EMAIL PROTECTED] wrote:

> On 18 Nov 2003 at 11:26, Thomas Holm wrote:
>
> What is copulas?

After you rescale a bivariate distribution to have specified marginal
distributions the copula is what's left.

-thomas

>
> Kjetil Halvorsen
>
> > Hello
> >
> > Anyone that now of any function in R that can calculate copulas?
> > Or if anyone have any code avaible I would be more than interested.
> >
> > Thank you in advance
> >
> > /Thomas
> >
> > __
> > [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
>

Thomas Lumley   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]   University of Washington, Seattle

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


Re: [R] adding variable

2003-11-18 Thread Prof Brian Ripley
Are you looking for something like add1 then?

We do need a much clearer explanation of what you are trying to do to be 
able to help you: and not with y used in two separate senses!

On Tue, 18 Nov 2003, Martin Wegmann wrote:

> On Tuesday 18 November 2003 19:32, Prof Brian Ripley wrote:
> > On Tue, 18 Nov 2003, Martin Wegmann wrote:
> > > I have count data of animals (here y, y1, y2...) and env. variables (x,
> > > x1, x2 ,).
> > >
> > > I used a glm
> > >
> > > glm(y~x1+x2+x3)
> > >
> > > glm(y1~x1+x2+x3)
> > >
> > > and now I would like to add the count data of other species to
> > > investigate if they might have a bigger impact than the env. variables:
> > >
> > > #x? are the selected var from the first glm run
> > >
> > > glm(y~x?+x?+y1)
> > >
> > > glm(y~x?+x?+x?+y2)
> > >
> > > 
> > >
> > > I wonder if there is a more elegant method to do this than adding (and
> > > removing) each y by hand.
> >
> > Do you mean each x?  In either case, see ?update.
> 
> update looks good but with update and with adding the y I have to do it 
> manually. 
> 
> I thought something like doing 
> 
> glm(y~x+x1+x2++y§) 
> 
> where y§ is: grep y1 out of df.y run glm and name it
> grep y2 out of df.y run glm .
> 
> until all y's of df.y has been onced included in the model.
> every time only one y§ has to be included
> 
> the included x's have to be kept. I only want to look if one species variables 
> has more explanation power than the env. variables.
> 
> perhaps this helps to understand what I am looking for:
> I think bash scripts are not possible in R but it would look like such a bash 
> script for GRASS:
> 
> for variable in y1 y2 y3  ; do
> 
> glm(y~x+x1+x2+$variable)->glm.$variable
> ; done
> 
> #where $variable refers to the name of read in y's.
> 
> 
> Martin
> 
> 
> 
> 

-- 
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] arima models

2003-11-18 Thread bridget
Hi all,

I want to calculate the residuals of an ARIMA fit to a time series using 
the same calculation method as in arima() in the ts package, BUT I want 
to be able to specify fixed values for ALL the parameters in the ARIMA 
model.  The "fixed = ..." argument in the arima() command appears to 
require at least one parameter to be variable.  Does anyone know a way 
around this?  Altering the parameter values using, for example,

model<-arima(t, order = c(1,1,0), seasonal = list(order = c(0,1,1), 
period = 12));
model$coef[1]<-0.75;

doesn't affect the other model values.

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


Re: [R] adding variable

2003-11-18 Thread kjetil
On 18 Nov 2003 at 21:53, Martin Wegmann wrote:

You can go by text representation in a loop, using some of the 
following stuff:

> form <- "y ~ x   "
> as.formula(form)
y ~ x
> nchar(form)
[1] 8
> substr(form, 7,8)
[1] "  "
> substr(form, 7,8) <- "+z"
> form
[1] "y ~ x +z"
> as.formula(form)
y ~ x + z
> 

Then you can loop over (part of) names(your.df)

Kjetil Halvorsen

> On Tuesday 18 November 2003 19:32, Prof Brian Ripley wrote:
> > On Tue, 18 Nov 2003, Martin Wegmann wrote:
> > > I have count data of animals (here y, y1, y2...) and env.
> > > variables (x, x1, x2 ,).
> > >
> > > I used a glm
> > >
> > > glm(y~x1+x2+x3)
> > >
> > > glm(y1~x1+x2+x3)
> > >
> > > and now I would like to add the count data of other species to
> > > investigate if they might have a bigger impact than the env.
> > > variables:
> > >
> > > #x? are the selected var from the first glm run
> > >
> > > glm(y~x?+x?+y1)
> > >
> > > glm(y~x?+x?+x?+y2)
> > >
> > > 
> > >
> > > I wonder if there is a more elegant method to do this than adding
> > > (and removing) each y by hand.
> >
> > Do you mean each x?  In either case, see ?update.
> 
> update looks good but with update and with adding the y I have to do
> it manually. 
> 
> I thought something like doing 
> 
> glm(y~x+x1+x2++y§) 
> 
> where y§ is: grep y1 out of df.y run glm and name it
> grep y2 out of df.y run glm .
> 
> until all y's of df.y has been onced included in the model.
> every time only one y§ has to be included
> 
> the included x's have to be kept. I only want to look if one species
> variables has more explanation power than the env. variables.
> 
> perhaps this helps to understand what I am looking for:
> I think bash scripts are not possible in R but it would look like such
> a bash script for GRASS:
> 
> for variable in y1 y2 y3  ; do
> 
> glm(y~x+x1+x2+$variable)->glm.$variable
> ; done
> 
> #where $variable refers to the name of read in y's.
> 
> 
> Martin
> 
> __
> [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] adding variable

2003-11-18 Thread Martin Wegmann
Ok I try to explain it clearer. 

I am not looking for step() add1() drop1() or similar commands. Nothing to do 
with variable selection.

I have two data frames, on with environmental variables and another one with 
animal data (let's say absence/presence of 10 species)

first I look which env. variables explain the presence of species 1

glm(species1~env.var1+env.var2+.) -> glm.spec1

step(glm.spec1) -> glm.spec1.step

I get certain env. variables which have the biggest explanatory power.

Now I would like to treat the other absence/presence data of my species like 
env. variables which could influence the presence of species1
I included the env.variable from glm.spec1.step (I call them env.varX+...)

glm(species1~env.varX+..+species2) -> glm.species1.sp2


glm(species1~env.varX+..+species3) -> glm.species1.sp3


and this procedure shall be done for all remaining species.

I am looking for a method to add automatically each species2 up to species10 
and run glm(). 
The first part with the env. variables shall be kept as it is but the last 
variable (speciesX) shall be changed each time. I am looking for something 
like a placeholder and the command greps a different species from the species 
dataframe for each run and add it instead of the place holder.

I hope I explained it better. thanks Martin

On Tuesday 18 November 2003 22:14, Prof Brian Ripley wrote:
> Are you looking for something like add1 then?
>
> We do need a much clearer explanation of what you are trying to do to be
> able to help you: and not with y used in two separate senses!
>
> On Tue, 18 Nov 2003, Martin Wegmann wrote:
> > On Tuesday 18 November 2003 19:32, Prof Brian Ripley wrote:
> > > On Tue, 18 Nov 2003, Martin Wegmann wrote:
> > > > I have count data of animals (here y, y1, y2...) and env. variables
> > > > (x, x1, x2 ,).
> > > >
> > > > I used a glm
> > > >
> > > > glm(y~x1+x2+x3)
> > > >
> > > > glm(y1~x1+x2+x3)
> > > >
> > > > and now I would like to add the count data of other species to
> > > > investigate if they might have a bigger impact than the env.
> > > > variables:
> > > >
> > > > #x? are the selected var from the first glm run
> > > >
> > > > glm(y~x?+x?+y1)
> > > >
> > > > glm(y~x?+x?+x?+y2)
> > > >
> > > > 
> > > >
> > > > I wonder if there is a more elegant method to do this than adding
> > > > (and removing) each y by hand.
> > >
> > > Do you mean each x?  In either case, see ?update.
> >
> > update looks good but with update and with adding the y I have to do it
> > manually.
> >
> > I thought something like doing
> >
> > glm(y~x+x1+x2++y§)
> >
> > where y§ is: grep y1 out of df.y run glm and name it
> > grep y2 out of df.y run glm .
> >
> > until all y's of df.y has been onced included in the model.
> > every time only one y§ has to be included
> >
> > the included x's have to be kept. I only want to look if one species
> > variables has more explanation power than the env. variables.
> >
> > perhaps this helps to understand what I am looking for:
> > I think bash scripts are not possible in R but it would look like such a
> > bash script for GRASS:
> >
> > for variable in y1 y2 y3  ; do
> >
> > glm(y~x+x1+x2+$variable)->glm.$variable
> > ; done
> >
> > #where $variable refers to the name of read in y's.
> >
> >
> > Martin

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


Re: [R] adding variable

2003-11-18 Thread Prof Brian Ripley
On Tue, 18 Nov 2003, Martin Wegmann wrote:

> Ok I try to explain it clearer. 
> 
> I am not looking for step() add1() drop1() or similar commands. Nothing to do 
> with variable selection.
> 
> I have two data frames, on with environmental variables and another one with 
> animal data (let's say absence/presence of 10 species)
> 
> first I look which env. variables explain the presence of species 1
> 
> glm(species1~env.var1+env.var2+.) -> glm.spec1
> 
> step(glm.spec1) -> glm.spec1.step
> 
> I get certain env. variables which have the biggest explanatory power.
> 
> Now I would like to treat the other absence/presence data of my species like 
> env. variables which could influence the presence of species1
> I included the env.variable from glm.spec1.step (I call them env.varX+...)
> 
> glm(species1~env.varX+..+species2) -> glm.species1.sp2
> 
> 
> glm(species1~env.varX+..+species3) -> glm.species1.sp3
> 
> 
> and this procedure shall be done for all remaining species.
> 
> I am looking for a method to add automatically each species2 up to species10 
> and run glm(). 

That is what add1 does.

> The first part with the env. variables shall be kept as it is but the last 
> variable (speciesX) shall be changed each time. I am looking for something 
> like a placeholder and the command greps a different species from the species 
> dataframe for each run and add it instead of the place holder.
> 
> I hope I explained it better. thanks Martin
> 
> On Tuesday 18 November 2003 22:14, Prof Brian Ripley wrote:
> > Are you looking for something like add1 then?
> >
> > We do need a much clearer explanation of what you are trying to do to be
> > able to help you: and not with y used in two separate senses!
> >
> > On Tue, 18 Nov 2003, Martin Wegmann wrote:
> > > On Tuesday 18 November 2003 19:32, Prof Brian Ripley wrote:
> > > > On Tue, 18 Nov 2003, Martin Wegmann wrote:
> > > > > I have count data of animals (here y, y1, y2...) and env. variables
> > > > > (x, x1, x2 ,).
> > > > >
> > > > > I used a glm
> > > > >
> > > > > glm(y~x1+x2+x3)
> > > > >
> > > > > glm(y1~x1+x2+x3)
> > > > >
> > > > > and now I would like to add the count data of other species to
> > > > > investigate if they might have a bigger impact than the env.
> > > > > variables:
> > > > >
> > > > > #x? are the selected var from the first glm run
> > > > >
> > > > > glm(y~x?+x?+y1)
> > > > >
> > > > > glm(y~x?+x?+x?+y2)
> > > > >
> > > > > 
> > > > >
> > > > > I wonder if there is a more elegant method to do this than adding
> > > > > (and removing) each y by hand.
> > > >
> > > > Do you mean each x?  In either case, see ?update.
> > >
> > > update looks good but with update and with adding the y I have to do it
> > > manually.
> > >
> > > I thought something like doing
> > >
> > > glm(y~x+x1+x2++y§)
> > >
> > > where y§ is: grep y1 out of df.y run glm and name it
> > > grep y2 out of df.y run glm .
> > >
> > > until all y's of df.y has been onced included in the model.
> > > every time only one y§ has to be included
> > >
> > > the included x's have to be kept. I only want to look if one species
> > > variables has more explanation power than the env. variables.
> > >
> > > perhaps this helps to understand what I am looking for:
> > > I think bash scripts are not possible in R but it would look like such a
> > > bash script for GRASS:
> > >
> > > for variable in y1 y2 y3  ; do
> > >
> > > glm(y~x+x1+x2+$variable)->glm.$variable
> > > ; done
> > >
> > > #where $variable refers to the name of read in y's.
> > >
> > >
> > > Martin
> 
> 
> 

-- 
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] Question regarding mosaicplot

2003-11-18 Thread Jean Vidal
I tried this :
> mosaicplot(stoc ~ q9r + segca,data=tmp2,color=T) : works fine.
And now, this :
> mosaicplot(stoc ~ q9r + segca, data=tmp2, color=T, main="Big title")
Error in model.frame(formula, rownames, variables, varnames, extras, 
extranames,  :
invalid variable type

I'm probably stupid and missed something simple in the manual (and wouldn't 
like to be flamed if insinuating that, may be... a bug ? Oh no !).

It can be done with :
> mosaicplot(table(tmp2$stoc,tmp2$q9r,tmp2$segca),color=T,main="Big 
title") : works fine.

So, no real trouble for me...

> version
 _
platform i386-pc-mingw32
arch i386
os   mingw32
system   i386, mingw32
status
major1
minor8.0
year 2003
month10
day  08
language R
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] HMisc describe -- error with dates

2003-11-18 Thread Frank E Harrell Jr
On Tue, 18 Nov 2003 13:47:17 -0500
[EMAIL PROTECTED] wrote:

> Thank you Gabor and Frank for you replies last week. Unfortunately I
> still don't get it (I'm kind of new at this). Just to recap: I'm
> starting with a Julian date and want results presented as 11NOV2003, for
> example (or some other date format with no time component). 
> 
> The HMisc describe function accepts variables that I have now formatted
> like this   
> 
> >date.ddmmmyy(aidsdate)
> 
> whereas it does not like variables formatted like this
> 
> >dates(aidsdate,format="day.mon.year", origin=c(month = 1, day = 1, year
> >=
> 1960))
> 
> which is what I was using with an earlier version of Hmisc.
> 
> I wasn't able to figure out how to use posix.
> 
> The problem now is that, unlike before, the dates are not sorted (at
> least not chronologically--maybe like character variables) and I liked
> seeing the 5 lowest and highest dates in the describe output. 
> 
> Sorry for pestering, but it is a testimony to how much I like Hmisc :)
> 
> Thanks!
> 
> Tanya
> 
> 
> 

Tanya,

I want to fix this in general.  It's on my todo list for next week. 
-Frank


> Quoting Frank E Harrell Jr <[EMAIL PROTECTED]>:
> 
> > On Tue, 11 Nov 2003 20:40:50 -0500 (EST)
> > "Gabor Grothendieck" <[EMAIL PROTECTED]> wrote:
> > 
> > > 
> > > 
> > > dates is part of chron.  There may be something wrong in 
> > > Hmisc's detection of chron objects.
> > > 
> > > > chron(1)
> > > [1] 01/02/70
> > > 
> > > > isChron(chron(1))
> > > FALSE
> > > 
> > > ---
> > >  
> > > Date: Tue, 11 Nov 2003 20:06:38 -0500 
> > > From: <[EMAIL PROTECTED]>
> > > To: Frank E Harrell Jr <[EMAIL PROTECTED]> 
> > > Cc: <[EMAIL PROTECTED]> 
> > > Subject: Re: [R] HMisc describe -- error with dates 
> > > 
> > >  
> > >  
> > > I am using the chron package. I have no preference for which
> > > function I use. I just want the most reliable format for HMisc
> > > functions and general plotting. I like the ddmonyyy formats (e.g.
> > > 11NOV2003). What would you recommend?
> > 
> > I like POSIX but chron should be workable.  The fix for isChron in
> > Hmisc is:
> > 
> > function(x) {
> >   cl <- class(x)
> >   dc <- if(.R.) c('POSIXt','POSIXct','dates','times','chron') else
> > c('timeDate','date','dates','times','chron')
> >   length(cl) && any(cl %in% dc)
> > }
> > 
> > But describe also runs this command:
> > 
> >   if(isdatetime) notime <- all(format(x.unique,"%H%M%S")=='00')
> > 
> > and such calls to format for chron objects (which actually calls
> > format.dates if x.unique is a dates object) do not work.  So a few
> > more modifications will need to be made in describe to work with chron
> > objects, when time allows.
> > 
> > Frank
> > 
> > > 
> > > Thank you!
> > > 
> > > Quoting Frank E Harrell Jr <[EMAIL PROTECTED]>:
> > > 
> > > > On Tue, 11 Nov 2003 18:28:24 -0500
> > > > [EMAIL PROTECTED] wrote:
> > > > 
> > > > > Hello,
> > > > > 
> > > > > I am trying to use HMisc describe on a data frame. I have
> > > > > specified certain variables as dates using, for example:
> > > > > 
> > > > > df1$aidsdate <- dates(aidsdate,format="day.mon.year",
> > > > > origin=c(month = 1, day = 1, year = 1960))
> > > > > 
> > > > > When I use describe on the dataframe I get this error:
> > > > > 
> > > > > Error in Ops.dates(weights, x) : * not defined for chron objects
> > > > > 
> > > > > Has anyone had this problem? I had used the same method with an
> > > > > older version of R and HMisc and it worked. 
> > > > > 
> > > > > Should be be formatting date variables differently?
> > > > > 
> > > > > Thank you!
> > > > > 
> > > > > Sincerely,
> > > > > Tanya Murphy
> > > > > 
> > > > 
> > > > In recent versions, describe for R recognizes date/times by one of
> > > > the following classes: 'POSIXt','POSIXct','chron'. If you really
> > > > need to use another date format I could be talked into extending
> > > > the code for that if you can remind me where dates( ) is found.
> > > > -Frank
> > > > 
> > > > ---
> > > > Frank E Harrell Jr Professor and Chair School of Medicine
> > > > Department of Biostatistics Vanderbilt University
> > > >
> > > 
> > > __
> > > [EMAIL PROTECTED] mailing list
> > > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> > 
> > 
> > ---
> > Frank E Harrell JrProfessor and ChairSchool of
> > Medicine
> >   Department of BiostatisticsVanderbilt
> >   University
> > 
> 
> 
> 
> 
> -
> This mail sent through IMP: http://horde.org/imp/
> 
> __
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help


---
Frank E Harrell JrProfessor and ChairSchool of Medicine
  Department of BiostatisticsVanderbilt University

__
[EMAIL PROTECTED] mailing list
https://www.st

Re: [R] HMisc describe -- error with dates

2003-11-18 Thread Gabor Grothendieck


Since Frank Harrell indicates that he will likely have addressed
the chron issue in Hmisc by next week you may just want to
wait for that; however, if you need an interim solution for
representing chron dates in such a manner that they sort and
display correctly under the Hmisc describe function then here
are two workarounds.

Assume z is your vector of chron dates.


1. Character variables

Represent them as character variables using a format, such as
/mm/dd , that sorts correctly under character comparisons:

  chr <- substring( paste(years(z),chron(z),sep="/"), 1, 10 )
  describe(chr)

This will convert chr back to chron:

 chron( paste(substring(chr,6),substring(chr,3,4),sep="/") )


2. Factors

Represent them as factors like this:

  zs <- chron(sort(unique(z)))
  f <- factor(z,lev=zs,lab=zs)
  describe(f)

This will convert f back to chron:

  chron(as.character(f))


---

From: Frank E Harrell Jr <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]> 
Cc: <[EMAIL PROTECTED]> 
Subject: Re: [R] HMisc describe -- error with dates 

 
 
On Tue, 18 Nov 2003 13:47:17 -0500
[EMAIL PROTECTED] wrote:

> Thank you Gabor and Frank for you replies last week. Unfortunately I
> still don't get it (I'm kind of new at this). Just to recap: I'm
> starting with a Julian date and want results presented as 11NOV2003, for
> example (or some other date format with no time component). 
> 
> The HMisc describe function accepts variables that I have now formatted
> like this 
> 
> >date.ddmmmyy(aidsdate)
> 
> whereas it does not like variables formatted like this
> 
> >dates(aidsdate,format="day.mon.year", origin=c(month = 1, day = 1, year
> >=
> 1960))
> 
> which is what I was using with an earlier version of Hmisc.
> 
> I wasn't able to figure out how to use posix.
> 
> The problem now is that, unlike before, the dates are not sorted (at
> least not chronologically--maybe like character variables) and I liked
> seeing the 5 lowest and highest dates in the describe output. 
> 
> Sorry for pestering, but it is a testimony to how much I like Hmisc :)
> 
> Thanks!
> 
> Tanya
> 
> 
> 

Tanya,

I want to fix this in general. It's on my todo list for next week. 
-Frank


> Quoting Frank E Harrell Jr <[EMAIL PROTECTED]>:
> 
> > On Tue, 11 Nov 2003 20:40:50 -0500 (EST)
> > "Gabor Grothendieck" <[EMAIL PROTECTED]> wrote:
> > 
> > > 
> > > 
> > > dates is part of chron. There may be something wrong in 
> > > Hmisc's detection of chron objects.
> > > 
> > > > chron(1)
> > > [1] 01/02/70
> > > 
> > > > isChron(chron(1))
> > > FALSE
> > > 
> > > ---
> > > 
> > > Date: Tue, 11 Nov 2003 20:06:38 -0500 
> > > From: <[EMAIL PROTECTED]>
> > > To: Frank E Harrell Jr <[EMAIL PROTECTED]> 
> > > Cc: <[EMAIL PROTECTED]> 
> > > Subject: Re: [R] HMisc describe -- error with dates 
> > > 
> > > 
> > > 
> > > I am using the chron package. I have no preference for which
> > > function I use. I just want the most reliable format for HMisc
> > > functions and general plotting. I like the ddmonyyy formats (e.g.
> > > 11NOV2003). What would you recommend?
> > 
> > I like POSIX but chron should be workable. The fix for isChron in
> > Hmisc is:
> > 
> > function(x) {
> > cl <- class(x)
> > dc <- if(.R.) c('POSIXt','POSIXct','dates','times','chron') else
> > c('timeDate','date','dates','times','chron')
> > length(cl) && any(cl %in% dc)
> > }
> > 
> > But describe also runs this command:
> > 
> > if(isdatetime) notime <- all(format(x.unique,"%H%M%S")=='00')
> > 
> > and such calls to format for chron objects (which actually calls
> > format.dates if x.unique is a dates object) do not work. So a few
> > more modifications will need to be made in describe to work with chron
> > objects, when time allows.
> > 
> > Frank
> > 
> > > 
> > > Thank you!
> > > 
> > > Quoting Frank E Harrell Jr <[EMAIL PROTECTED]>:
> > > 
> > > > On Tue, 11 Nov 2003 18:28:24 -0500
> > > > [EMAIL PROTECTED] wrote:
> > > > 
> > > > > Hello,
> > > > > 
> > > > > I am trying to use HMisc describe on a data frame. I have
> > > > > specified certain variables as dates using, for example:
> > > > > 
> > > > > df1$aidsdate <- dates(aidsdate,format="day.mon.year",
> > > > > origin=c(month = 1, day = 1, year = 1960))
> > > > > 
> > > > > When I use describe on the dataframe I get this error:
> > > > > 
> > > > > Error in Ops.dates(weights, x) : * not defined for chron objects
> > > > > 
> > > > > Has anyone had this problem? I had used the same method with an
> > > > > older version of R and HMisc and it worked. 
> > > > > 
> > > > > Should be be formatting date variables differently?
> > > > > 
> > > > > Thank you!
> > > > > 
> > > > > Sincerely,
> > > > > Tanya Murphy
> > > > > 
> > > > 
> > > > In recent versions, describe for R recognizes date/times by one of
> > > > the following classes: 'POSIXt','POSIXct','chron'. If you really
> > > > need to use another date format I could be talked into extending
> > > > the code for that if you can remind me where dates( ) is found.
> > > > -Frank
> >

[R] converting a numeric vector to a single string

2003-11-18 Thread Rajarshi Guha
Hi,
  this is probably a very obvious question but I cant see how I can
convert a numeric vector to a single string as opposed to  a character
vector.

Essentially if I have a vector defined as

x <- c(1,2,3.76,4.56)

I would like to generate the string:

"1 2 3.76 4.56"

rather than

"1" "2" "3.76" "4.56"

which is what paste() gives me.

I thought of using a textConnection() but as far as I can see I need to
use something like writeLines which requires a character vector.

Thanks,


---
Rajarshi Guha <[EMAIL PROTECTED]> 
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
---
All great discoveries are made by mistake.
-- Young

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


Re: [R] converting a numeric vector to a single string

2003-11-18 Thread Hadley Wickham
Did you read ?paste ?  I think using the collapse argument will give you 
what you want.

Hadley

Rajarshi Guha wrote:

Hi,
 this is probably a very obvious question but I cant see how I can
convert a numeric vector to a single string as opposed to  a character
vector.
Essentially if I have a vector defined as

x <- c(1,2,3.76,4.56)

I would like to generate the string:

"1 2 3.76 4.56"

rather than

"1" "2" "3.76" "4.56"

which is what paste() gives me.

I thought of using a textConnection() but as far as I can see I need to
use something like writeLines which requires a character vector.
Thanks,

 

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


Re: [R] Question regarding mosaicplot

2003-11-18 Thread Prof Brian Ripley
It is a bug (which has been seen before).  Just use title to add the main 
title afterwards.

On Tue, 18 Nov 2003, Jean Vidal wrote:

> I tried this :
>  > mosaicplot(stoc ~ q9r + segca,data=tmp2,color=T) : works fine.
> 
> And now, this :
>  > mosaicplot(stoc ~ q9r + segca, data=tmp2, color=T, main="Big title")
> Error in model.frame(formula, rownames, variables, varnames, extras, 
> extranames,  :
>  invalid variable type
> 
> I'm probably stupid and missed something simple in the manual (and wouldn't 
> like to be flamed if insinuating that, may be... a bug ? Oh no !).
> 
> It can be done with :
>  > mosaicplot(table(tmp2$stoc,tmp2$q9r,tmp2$segca),color=T,main="Big 
> title") : works fine.
> 
> So, no real trouble for me...
> 
>  > version
>   _
> platform i386-pc-mingw32
> arch i386
> os   mingw32
> system   i386, mingw32
> status
> major1
> minor8.0
> year 2003
> month10
> day  08
> language R
> 
> __
> [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

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