[R] Updating packages to R 2.1.0

2005-04-18 Thread Prof Brian Ripley
A very handy new feature of 2.1.0 is that
update.packages(ask=FALSE, checkBuilt=TRUE)
will re-install all your packages with current versions built under 2.1.0.
This works for both Unix-alikes and Windows (and for MacOS in due course).
If you have many packages installed, allow some time (maybe an hour for 
all the CRAN packages on a P4 2.4GHz Linux box).

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


Re: [R] dynamic function loading

2005-04-18 Thread Uwe Ligges
Omar Lakkis wrote:
How can I do dynamic function loading in R?
I have a list of R functions in the database and want to, dynamicly,
execute teh function that corresponds to my in comming data. Is there
a way to do that without a big if/else?
I don't know whether I understand correctly, but I guess you are 
loooking for object oriented approaches.
So write a generic function and its methods that correspond to your data 
objects. You might want to read the green book on S4 classes.

Uwe Ligges

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


Re: [R] error due to locales again

2005-04-18 Thread Prof Brian Ripley
Yes.  Please do beta-test *before* release: R 2.1.0 is released.
If no one actually tests R in your language, we will not discover that
there are problems in that language.  Over the the users to beta-test when 
asked to.

On Tue, 19 Apr 2005, ronggui wrote:
example(lm)
Error in switch(x[2], "1250" = return("ISO 8859-2"), "1251" = return("KOI8-U"), 
 :
   argument is missing, with no default
 Sys.getlocale(category = "LC_ALL")
[1] "LC_COLLATE=Chinese_People's Republic of China.936;LC_CTYPE=Chinese_People's 
Republic of China.936;LC_MONETARY=Chinese_People's Republic of 
China.936;LC_NUMERIC=C;LC_TIME=Chinese_People's Republic of China.936"
version
_
platform i386-pc-mingw32
arch i386
os   mingw32
system   i386, mingw32
status   beta
major2
minor1.0
year 2005
month04
day  16
language R

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


[R] error due to locales again

2005-04-18 Thread ronggui
>example(lm)
Error in switch(x[2], "1250" = return("ISO 8859-2"), "1251" = return("KOI8-U"), 
 : 
argument is missing, with no default

>  Sys.getlocale(category = "LC_ALL")
[1] "LC_COLLATE=Chinese_People's Republic of 
China.936;LC_CTYPE=Chinese_People's Republic of 
China.936;LC_MONETARY=Chinese_People's Republic of 
China.936;LC_NUMERIC=C;LC_TIME=Chinese_People's Republic of China.936"

> version
 _  
platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status   beta   
major2  
minor1.0
year 2005   
month04 
day  16 
language R

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


RE: [R] using imported tables

2005-04-18 Thread Mulholland, Tom
I guess one of the reasons that you have not had a reply is that you have not 
followed the posting guide. If you give the list something to work with (a 
small reproducible example)

You use the word package which in R is very precise, but which I think you are 
using to describe the file you are reading. This amkes it harder for us to 
understand what your problem is.

if you type ?read.table and read the help you will find that the parameter 
col.names is a "a vector of optional names for the variables. The default is to 
use '"V"' followed by the column number." Typically this would look something 
like col.names = c("ColA","ColB", ..., "ColZ") That is one for each column in 
the matrix or data.frame.

But I'm guessing. If I saw the code I might see something else that you've done 
to to see what you mean by "assigns a name to the entire table."

Now's a good time to reread the posting guide, assuming that you have already 
done so.

Tom



> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Owen Buchner
> Sent: Tuesday, 19 April 2005 10:16 AM
> To: R-help@stat.math.ethz.ch
> Subject: [R] using imported tables
> 
> 
> I've recently found out using read.table i can insert a table 
> into R from a .dat
> file.  The problem i'm having is now that i've got R to read 
> the package i want
> to use the data from each column.  I've tried adding titles 
> to each column
> using col.name, but it assigns a name to the entire table and 
> wont recognize
> the name i gave the table later in programming.  Is there 
> something i'm doing
> wrong or am i missing an important step?  I'd appreciate any help.
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>

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


Re: [R] Compatability with Tiger OS X 10.4

2005-04-18 Thread Prof Brian Ripley
No one _can_ know.  Mac OS 10.4 is unreleased, and things can easily 
break before release.

It is working on pre-releases.  One problem is that Mac OS 10.4 (don't 
think you need two tens) will use gcc 4.0.0, which is also unreleased and 
its release candidates have problems compiling R (see the R-admin manual 
for R 2.1.0), including on Mac OS 10.4: there are also questions about how 
`properly' it runs R.  The biggest problem we found in gcc 4.0.0 has been 
fixed within the last week, and it is unclear if this fix will make Mac OS 
10.4.

The R Mac OS X maintainers are working hard (thank you Stefano and Simon) 
on this and I expect them to succeed, but quite possibly by using patched 
tools or non-standard options (such as using a static Fortran runtime).

Watch this space (or R-sig-mac if it needs to be technical).
On Mon, 18 Apr 2005, Hemant Ishwaran wrote:
Does anyone know if R will install and run properly on the
soon to be released Tiger operating system (Mac OS X 10.4)?
There must be several Mac users out there (like myself) who
will be considering the upgrade.
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Odd diagnostic plots in mixed-effects models

2005-04-18 Thread Andrew Robinson
Dear R community,

In the excellent nlme package the default diagnostic plot graphs the innermost 
residuals against innermost fitted values.  I recently fit a mixed-effects 
model in which there was a very clear positive linear trend in this plot.  

I inferred that this trend occurred because my fixed effect was a two-level 
factor, and my random effect was a 12-level factor. The negative residuals were 
associated with negative random effects (because of shrinkage, I assume), and 
the positive with positive.  The fixed effects explained little varaition. 
Therefore plotting the innermost residuals against the innermost fitted values 
had the negative residuals to the left and the positive residuals to the right, 
occasioning a trend.

My questions are: is it (as I suspect) harmless, or does it suggest that the 
model is lacking?  And, is this effect likely to compromise the interpretation 
of any of the other standard diagnostic plots (eg qqnorm)?

Thanks much for any thoughts,

Andrew
--
Andrew Robinson  Ph: 208 885 7115
Department of Forest Resources   Fa: 208 885 6226
University of Idaho  E : [EMAIL PROTECTED]
PO Box 441133W : http://www.uidaho.edu/~andrewr
Moscow ID 83843  Or: http://www.biometrics.uidaho.edu
No statement above necessarily represents my employer's opinion.

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


[R] using imported tables

2005-04-18 Thread Owen Buchner
I've recently found out using read.table i can insert a table into R from a .dat
file.  The problem i'm having is now that i've got R to read the package i want
to use the data from each column.  I've tried adding titles to each column
using col.name, but it assigns a name to the entire table and wont recognize
the name i gave the table later in programming.  Is there something i'm doing
wrong or am i missing an important step?  I'd appreciate any help.

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


Re: [R] Compatability with Tiger OS X 10.4

2005-04-18 Thread David L. Van Brunt, Ph.D.
don't know about the binaries, but I'd be surprised if you couldn't compile 
it. You've given me something to think about, though, as to whether I want 
to upgrade on my "analytic box".


On 4/18/05, Hemant Ishwaran <[EMAIL PROTECTED]> wrote:
> 
> Does anyone know if R will install and run properly on the
> soon to be released Tiger operating system (Mac OS X 10.4)?
> There must be several Mac users out there (like myself) who
> will be considering the upgrade.
> --
> Hemant Ishwaran
> Staff, Dept of Quantitative Health Sciences, Cleveland Clinic Foundation
> Adjunct Professor, Dept of Statistics, Case University
> 
> http://www.bio.ri.ccf.org/Resume/Pages/Ishwaran/ishwaran.html
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 



-- 
---
David L. Van Brunt, Ph.D.
mailto:[EMAIL PROTECTED]

[[alternative HTML version deleted]]

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


[R] Listas de E-mails para Mala Direta , Marketing Direto

2005-04-18 Thread marcosjbd_g5a
Cadastros para mala direta livre de spam programas grátis para e-mail marketing 
Cadastros para mala direta livre de spam e-mails para mala direta por classe 
social:

http://www.gueb.de/divulgamail

e-mails para mala direta por classe social Listas de E-mails para Mala Direta 
, Marketing Direto programas grátis para e-mail marketing cadastros de e-mails 
divididos por segmento Cadastros para mala direta livre de spam:

http://www.gueb.de/divulgamail

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


[R] Compatability with Tiger OS X 10.4

2005-04-18 Thread Hemant Ishwaran
Does anyone know if R will install and run properly on the
soon to be released Tiger operating system (Mac OS X 10.4)?
There must be several Mac users out there (like myself) who
will be considering the upgrade.
--
Hemant Ishwaran
Staff, Dept of Quantitative Health Sciences, Cleveland Clinic Foundation
Adjunct Professor, Dept of Statistics, Case University
http://www.bio.ri.ccf.org/Resume/Pages/Ishwaran/ishwaran.html
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Barplot and colors for legend

2005-04-18 Thread Mulholland, Tom
Well I don't know how I can live with myself. I guess I can't wait for the site 
to mirror itself in case someone thinks I'm yesterday's man. ;-)

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Achim Zeileis
> Sent: Monday, 18 April 2005 10:56 PM
...
> Subject: Re: [R] Barplot and colors for legend

...

> This must be an old version of R ;-)

...

Tom Mulholland
Perth, WA, Australia.

  ,-_|\
 / \
 ?_,-._/
  v

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


Re: [R] longer object length, is not a multiple of shorter object length in: kappa * gcounts

2005-04-18 Thread Hui Han
I see. Thanks, Andy!
Hui
Liaw, Andy wrote:
I suspect you set the bandwidth too small.  Consider:
 

x <- sort(runif(100)) * 100
min(diff(x))
   

[1] 0.001700642
 

library(KernSmooth)
   

KernSmooth 2.22 installed
Copyright M. P. Wand 1997
 

dx <- bkde(x, bandwidth=.001)
   

Warning message:
longer object length
   is not a multiple of shorter object length in: kappa * gcounts 

Andy
 

From: Hui Han
Hi,
I was using a density estimation function as follows:
> est <- KernSmooth::bkde(x3, bandwidth=10)
When setting bandwidth less than 5, I got the error "longer object 
length,  is not a multiple of shorter object length in: kappa 
* gcounts ".

I wonder if there is anybody who can explain the error for me?
Thanks!
Hui
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html


   


--
Notice:  This e-mail message, together with any attachments, contains information of 
Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), 
and/or its affiliates (which may be known outside the United States as Merck Frosst, 
Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, 
proprietary copyrighted and/or legally privileged. It is intended solely for the use of 
the individual or entity named on this message.  If you are not the intended recipient, 
and have received this message in error, please notify us immediately by reply e-mail 
and then delete it from your system.
--

 

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


Re: [R] standard normal gaussian

2005-04-18 Thread Spencer Graves
 ?pnorm
 For more information, try "help.start()" -> "An Introduction to R" 
-> "Probability distributions". 

 spencer graves
simone gabbriellini wrote:
Hello List,
I need to calculate the p-value (in a standard normal gaussian) for a 
Z value I have.
I guess if I had to calculate by myself the value of the area in my 
function or refer to some already made function in R.

Any hints?
Thank you very much,
Simone
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] longer object length, is not a multiple of shorter object length in: kappa * gcounts

2005-04-18 Thread Liaw, Andy
I suspect you set the bandwidth too small.  Consider:

> x <- sort(runif(100)) * 100
> min(diff(x))
[1] 0.001700642
> library(KernSmooth)
KernSmooth 2.22 installed
Copyright M. P. Wand 1997
> dx <- bkde(x, bandwidth=.001)
Warning message:
longer object length
is not a multiple of shorter object length in: kappa * gcounts 

Andy

> From: Hui Han
> 
> Hi,
> 
> I was using a density estimation function as follows:
>  > est <- KernSmooth::bkde(x3, bandwidth=10)
> When setting bandwidth less than 5, I got the error "longer object 
> length,  is not a multiple of shorter object length in: kappa 
> * gcounts ".
> 
> I wonder if there is anybody who can explain the error for me?
> 
> Thanks!
> Hui
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 
>

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


RE: [R] Pearson corelation and p-value for matrix

2005-04-18 Thread Liaw, Andy
> From: John Fox 
> 
> Dear Andy,
> 
> Very nice! (My point was that if this is a one-time thing, for Dren to
> puzzle over it is probably more time-consuming than simply doing it
> inefficiently.)

There's a memory/speed tradeoff.  The loop avoids creating multiple
6000x6000 matrices that my version would require, and one of those would
take up 274MB!  I could not run my function on a 6000x6000 case on my laptop
(nor rcorr).  The example I showed was 2000x2000.  Also, as Frank pointed
out, it's not flexible.  As John said, it's good for one-time use.  For more
general consumption, one would want to write more flexible and robust code,
in which case one might very well re-invent rcorr...

Cheers,
Andy
 
> Regards,
>  John
> 
> 
> John Fox
> Department of Sociology
> McMaster University
> Hamilton, Ontario
> Canada L8S 4M4
> 905-525-9140x23604
> http://socserv.mcmaster.ca/jfox 
>  
> 
> > -Original Message-
> > From: Liaw, Andy [mailto:[EMAIL PROTECTED] 
> > Sent: Monday, April 18, 2005 2:40 PM
> > To: 'John Fox'; 'Dren Scott'
> > Cc: 'R-Help'
> > Subject: RE: [R] Pearson corelation and p-value for matrix
> > 
> > I believe this will do:
> > 
> > cor.pval2 <- function(x,  alternative="two-sided") {
> > corMat <- cor(x, use=if (any(is.na(x))) 
> > "pairwise.complete.obs" else
> > "all")
> > df <- crossprod(!is.na(x)) - 2
> > STATISTIC <- sqrt(df) * corMat / sqrt(1 - corMat^2)
> > p <- pt(STATISTIC, df)
> > p <- if (alternative == "less") {
> > p
> > } else if (alternative == "greater") {
> > 1 - p
> > } else 2 * pmin(p, 1 - p)
> > p
> > }
> > 
> > Some test:
> > 
> > > set.seed(1)
> > > x <- matrix(runif(2e3 * 1e2), 2e3)
> > > system.time(res1 <- cor.pval(t(x)), gcFirst=TRUE)
> > [1] 17.28  0.77 18.16NANA
> > > system.time(res2 <- cor.pval2(t(x)), gcFirst=TRUE)
> > [1] 19.51  1.05 20.70NANA
> > > max(abs(res1 - res2))
> > [1] 0
> > > x[c(1, 3, 6), c(2, 4)] <- NA
> > > x[30, 61] <- NA
> > > system.time(res2 <- cor.pval2(t(x)), gcFirst=TRUE)
> > [1] 24.48  0.71 25.28NANA
> > 
> > This is a bit slower because of the extra computation for 
> > "df".  One can try to save some computation by only computing 
> > with the lower (or upper) triangular part.
> > 
> > Cheers,
> > Andy
> > 
> > > From: John Fox
> > > 
> > > Dear Dren,
> > > 
> > > Since cor(), on which Andy's solution is based, can compute 
> > > pairwise-present correlations, you could adapt his function 
> > -- you'll 
> > > have to adjust the df for each pair. Alternatively, you 
> > could probably 
> > > save some time (programming time + computer time) by just 
> using my 
> > > solution:
> > > 
> > > > R <- diag(100)
> > > > R[upper.tri(R)] <- R[lower.tri(R)] <- .5
> > > > library(mvtnorm)
> > > > X <- rmvnorm(6000, sigma=R)
> > > > system.time(for (i in 1:50) cor.pvalues(X), gc=TRUE)
> > > [1] 518.19   1.11 520.23 NA NA
> > > 
> > > I know that time is money, but nine minutes (on my machine) 
> > probably 
> > > won't bankrupt anyone.
> > > 
> > > Regards,
> > >  John
> > > 
> > > 
> > > John Fox
> > > Department of Sociology
> > > McMaster University
> > > Hamilton, Ontario
> > > Canada L8S 4M4
> > > 905-525-9140x23604
> > > http://socserv.mcmaster.ca/jfox
> > > 
> > > 
> > > > -Original Message-
> > > > From: [EMAIL PROTECTED] 
> > > > [mailto:[EMAIL PROTECTED] On Behalf Of 
> Dren Scott
> > > > Sent: Monday, April 18, 2005 12:41 PM
> > > > To: 'R-Help'
> > > > Subject: RE: [R] Pearson corelation and p-value for matrix
> > > > 
> > > > Hi all,
> > > >  
> > > > Thanks Andy, Mark and John for all the help. I really 
> > appreciate it. 
> > > > I'm new to both R and statistics, so please excuse any 
> > gaffes on my 
> > > > part.
> > > >  
> > > > Essentially what I'm trying to do, is to evaluate for 
> > each row, how 
> > > > many other rows would have a p-value < 0.05. So, after I 
> > get my N x 
> > > > N p-value matrix, I'll just filter out values that are > 0.05.
> > > >  
> > > > Each of my datasets (6000 rows x 100 columns) would 
> > consist of some 
> > > > NA's. The iterative procedure (cor.pvalues) proposed by 
> > John would 
> > > > yield the values, but it would take an inordinately 
> long time (I 
> > > > have 50 of these datasets to process). The solution proposed by 
> > > > Andy, although fast, would not be able to incorporate the NA's.
> > > >  
> > > > Is there any workaround for the NA's? Or possibly do 
> you think I 
> > > > could try something else?
> > > >  
> > > > Thanks very much. 
> > > >  
> > > > Dren
> > > > 
> > > > 
> > > > "Liaw, Andy" <[EMAIL PROTECTED]> wrote:
> > > > > From: John Fox
> > > > > 
> > > > > Dear Andy,
> > > > > 
> > > > > That's clearly much better -- and illustrates an
> > > effective strategy
> > > > > for vectorizing (or "matricizing") a computation. I think
> > > I'll 

[R] standard normal gaussian

2005-04-18 Thread simone gabbriellini
Hello List,
I need to calculate the p-value (in a standard normal gaussian) for a Z 
value I have.
I guess if I had to calculate by myself the value of the area in my 
function or refer to some already made function in R.

Any hints?
Thank you very much,
Simone
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Re-release of R 2.1.0

2005-04-18 Thread Peter Dalgaard

Due to a mishap in the build procedure, the originally released
sources erroneously had "2.2.0" in several places within the
"configure" file. A re-released version has been put up in

   http://biostat.ku.dk/~pd/R-release/

and should find its way to CRAN and its mirrors some time tomorrow.

The new files have md5 sums as follows:

94d55d512a9ba36caa9b7df079bae19f  COPYING
d8045f3b8f929c1cb29a1e3fd737b499  COPYING.LIB
70447ae7f2c35233d3065b004aa4f331  INSTALL
8b78e12b100a6834fdada2dfaab98ab0  NEWS
88bbd6781faedc788a1cbd434194480c  ONEWS
4f004de59e24a52d0f500063b4603bcb  OONEWS
fb47b1fdef4323031e24d541a2f36b2b  R-2.0.1.tar.gz
270f7a7382e8cb10a353148598f91096  R-2.1.0.tar.gz
d8a2d5461c16aa37b1418c0500423bec  R-2.1.0.tar.gz-split.aa
9a8e7b5988fc4e43b56561cbb6853534  R-2.1.0.tar.gz-split.ab
dfb0600d8726613ac5a424bbd054c243  R-2.1.0.tar.gz-split.ac
150903071850a951722713560834029a  R-2.1.0.tar.gz-split.ad
cb416f351d0c9c75a86c27998d691372  R-2.1.0.tar.gz-split.ae
d8e01f2b68d2f689444901ae1957c396  R-2.1.0.tar.gz-split.af
3949c2649d595683fe26212dc292f4b1  R-2.1.0.tar.gz-split.ag
4e984f0b2dacf5d52657b04e874756d9  R-2.1.0.tar.gz-split.ah
c0f6e6135e54bd5d8917c804ec4b9b15  R-2.1.0.tar.gz-split.ai
270f7a7382e8cb10a353148598f91096  R-latest.tar.gz
56a780cdec835c5c598f8dfc0738f7f3  README

AFAIK, the Windows build doesn't use "configure", so should be OK.

Source builds get (at least) Makeconf wrong, causing the following
symptom:

> library(MASS)
Warning message:
package 'MASS' was built under R version 2.2.0

In that case, you'll need to rebuild with the corrected "configure".
You can get the file separately from

https://svn.r-project.org/R/tags/R-2-1-0/configure 

Apologies for the inconvenience. 

-pd

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

___
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-announce

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


[R] Re: longer object length, is not a multiple of shorter object length in: kappa * gcounts

2005-04-18 Thread Hui Han

Hui Han wrote:
Hi,
Another phenomenon is that if I don't sort the data vector x3, I get 
the same error  regardless of the bandwidth value:
   Actually for really large bandwidth,e.g. 120, it deosn't report 
errors.  Sorry for the confusing description.

"longer object length,  is not a multiple of shorter object length in: 
kappa * gcounts ".

Thanks in advance for any help you can give me!
Hui
Hui Han wrote:
Hi,
I was using a density estimation function as follows:
> est <- KernSmooth::bkde(x3, bandwidth=10)
When setting bandwidth less than 5, I got the error "longer object 
length,  is not a multiple of shorter object length in: kappa * 
gcounts ".

I wonder if there is anybody who can explain the error for me?
Thanks!
Hui


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


[R] Re: longer object length, is not a multiple of shorter object length in: kappa * gcounts

2005-04-18 Thread Hui Han
Hi,
Another phenomenon is that if I don't sort the data vector x3, I get the 
same error  regardless of the bandwidth value:
"longer object length,  is not a multiple of shorter object length in: 
kappa * gcounts ".

Thanks in advance for any help you can give me!
Hui
Hui Han wrote:
Hi,
I was using a density estimation function as follows:
> est <- KernSmooth::bkde(x3, bandwidth=10)
When setting bandwidth less than 5, I got the error "longer object 
length,  is not a multiple of shorter object length in: kappa * 
gcounts ".

I wonder if there is anybody who can explain the error for me?
Thanks!
Hui

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


[R] longer object length, is not a multiple of shorter object length in: kappa * gcounts

2005-04-18 Thread Hui Han
Hi,
I was using a density estimation function as follows:
> est <- KernSmooth::bkde(x3, bandwidth=10)
When setting bandwidth less than 5, I got the error "longer object 
length,  is not a multiple of shorter object length in: kappa * gcounts ".

I wonder if there is anybody who can explain the error for me?
Thanks!
Hui
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Pearson corelation and p-value for matrix

2005-04-18 Thread John Fox
Dear Andy,

Very nice! (My point was that if this is a one-time thing, for Dren to
puzzle over it is probably more time-consuming than simply doing it
inefficiently.)

Regards,
 John


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

> -Original Message-
> From: Liaw, Andy [mailto:[EMAIL PROTECTED] 
> Sent: Monday, April 18, 2005 2:40 PM
> To: 'John Fox'; 'Dren Scott'
> Cc: 'R-Help'
> Subject: RE: [R] Pearson corelation and p-value for matrix
> 
> I believe this will do:
> 
> cor.pval2 <- function(x,  alternative="two-sided") {
> corMat <- cor(x, use=if (any(is.na(x))) 
> "pairwise.complete.obs" else
> "all")
> df <- crossprod(!is.na(x)) - 2
> STATISTIC <- sqrt(df) * corMat / sqrt(1 - corMat^2)
> p <- pt(STATISTIC, df)
> p <- if (alternative == "less") {
> p
> } else if (alternative == "greater") {
> 1 - p
> } else 2 * pmin(p, 1 - p)
> p
> }
> 
> Some test:
> 
> > set.seed(1)
> > x <- matrix(runif(2e3 * 1e2), 2e3)
> > system.time(res1 <- cor.pval(t(x)), gcFirst=TRUE)
> [1] 17.28  0.77 18.16NANA
> > system.time(res2 <- cor.pval2(t(x)), gcFirst=TRUE)
> [1] 19.51  1.05 20.70NANA
> > max(abs(res1 - res2))
> [1] 0
> > x[c(1, 3, 6), c(2, 4)] <- NA
> > x[30, 61] <- NA
> > system.time(res2 <- cor.pval2(t(x)), gcFirst=TRUE)
> [1] 24.48  0.71 25.28NANA
> 
> This is a bit slower because of the extra computation for 
> "df".  One can try to save some computation by only computing 
> with the lower (or upper) triangular part.
> 
> Cheers,
> Andy
> 
> > From: John Fox
> > 
> > Dear Dren,
> > 
> > Since cor(), on which Andy's solution is based, can compute 
> > pairwise-present correlations, you could adapt his function 
> -- you'll 
> > have to adjust the df for each pair. Alternatively, you 
> could probably 
> > save some time (programming time + computer time) by just using my 
> > solution:
> > 
> > > R <- diag(100)
> > > R[upper.tri(R)] <- R[lower.tri(R)] <- .5
> > > library(mvtnorm)
> > > X <- rmvnorm(6000, sigma=R)
> > > system.time(for (i in 1:50) cor.pvalues(X), gc=TRUE)
> > [1] 518.19   1.11 520.23 NA NA
> > 
> > I know that time is money, but nine minutes (on my machine) 
> probably 
> > won't bankrupt anyone.
> > 
> > Regards,
> >  John
> > 
> > 
> > John Fox
> > Department of Sociology
> > McMaster University
> > Hamilton, Ontario
> > Canada L8S 4M4
> > 905-525-9140x23604
> > http://socserv.mcmaster.ca/jfox
> > 
> > 
> > > -Original Message-
> > > From: [EMAIL PROTECTED] 
> > > [mailto:[EMAIL PROTECTED] On Behalf Of Dren Scott
> > > Sent: Monday, April 18, 2005 12:41 PM
> > > To: 'R-Help'
> > > Subject: RE: [R] Pearson corelation and p-value for matrix
> > > 
> > > Hi all,
> > >  
> > > Thanks Andy, Mark and John for all the help. I really 
> appreciate it. 
> > > I'm new to both R and statistics, so please excuse any 
> gaffes on my 
> > > part.
> > >  
> > > Essentially what I'm trying to do, is to evaluate for 
> each row, how 
> > > many other rows would have a p-value < 0.05. So, after I 
> get my N x 
> > > N p-value matrix, I'll just filter out values that are > 0.05.
> > >  
> > > Each of my datasets (6000 rows x 100 columns) would 
> consist of some 
> > > NA's. The iterative procedure (cor.pvalues) proposed by 
> John would 
> > > yield the values, but it would take an inordinately long time (I 
> > > have 50 of these datasets to process). The solution proposed by 
> > > Andy, although fast, would not be able to incorporate the NA's.
> > >  
> > > Is there any workaround for the NA's? Or possibly do you think I 
> > > could try something else?
> > >  
> > > Thanks very much. 
> > >  
> > > Dren
> > > 
> > > 
> > > "Liaw, Andy" <[EMAIL PROTECTED]> wrote:
> > > > From: John Fox
> > > > 
> > > > Dear Andy,
> > > > 
> > > > That's clearly much better -- and illustrates an
> > effective strategy
> > > > for vectorizing (or "matricizing") a computation. I think
> > I'll add
> > > > this to my list of programming examples. It might be a little 
> > > > dangerous to pass ...
> > > > through to cor(), since someone could specify
> > type="spearman", for
> > > > example.
> > > 
> > > Ah, yes, the "..." isn't likely to help here! Also, it will only 
> > > work correctly if there are no NA's, for example (or else 
> the degree 
> > > of freedom would be wrong).
> > > 
> > > Best,
> > > Andy
> > > 
> > > > Thanks,
> > > > John
> > > > 
> > > > 
> > > > John Fox
> > > > Department of Sociology
> > > > McMaster University
> > > > Hamilton, Ontario
> > > > Canada L8S 4M4
> > > > 905-525-9140x23604
> > > > http://socserv.mcmaster.ca/jfox
> > > > 
> > > > 
> > > > > -Original Message-
> > > > > From: Liaw, Andy [mailto:[EMAIL PROTECTE

[R] Discrepancy between gam from gam package and gam in S-PLUS

2005-04-18 Thread John Fox
Dear Trevor,

I've noticed a discrepancy in the degrees of freedom reported by gam() from
the gam package in R vs. gam() in S-PLUS. The nonparametric df differ by 1;
otherwise (except for things that depend upon the df), the output is the
same:

- snip  

*** From R (gam version 0.93):

> mod.gam <- gam(prestige ~ lo(income, span=.6), data=Prestige)
> summary(mod.gam)

Call: gam(formula = prestige ~ lo(income, span = 0.6), data = Prestige)
Deviance Residuals:
Min  1Q  Median  3Q Max 
-17.163  -8.205  -1.998   8.070  32.326 

(Dispersion Parameter for gaussian family taken to be 122.5047)

Null Deviance: 29895.43 on 101 degrees of freedom
Residual Deviance: 12004.72 on 97.9939 degrees of freedom
AIC: 785.82 

Number of Local Scoring Iterations: 2 

DF for Terms and F-values for Nonparametric Effects

   Df Npar Df Npar F Pr(F)
(Intercept) 1 
lo(income, span = 0.6)  1   2 10.626 6.537e-05 ***
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 


*** From S-PLUS 6.2.1 for Windows:

> library(car)
> mod.gam <- gam(prestige ~ lo(income, span=.6), data=Prestige)
> summary(mod.gam)

Call: gam(formula = prestige ~ lo(income, span = 0.6), data = Prestige)
Deviance Residuals:
   Min1QMedian   3Q  Max 
 -17.16264 -8.205246 -1.997525 8.070375 32.32608

(Dispersion Parameter for Gaussian family taken to be 123.7677 )

Null Deviance: 29895.43 on 101 degrees of freedom

Residual Deviance: 12004.72 on 96.99392 degrees of freedom

Number of Local Scoring Iterations: 1 

DF for Terms and F-values for Nonparametric Effects

   Df Npar Df   Npar FPr(F) 
   (Intercept)  1  
lo(income, span = 0.6)  1   3 7.018995 0.0002517358
> 

- snip  

I suppose that one of these must be in error.

Regards,
 John

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

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


RE: [R] R-squared in summary(lm...)

2005-04-18 Thread Berton Gunter
Please consult any basic book on linear regression/linear models; for
example, APPLIED REGRESSION ANALYSIS by Draper and Smith. Or google on
"adjusted R-Squared."

In brief, Adjusted R-squared arrempts to compensate for the property that
adding extra regressors -- even random ones -- to a linear model **always**
increases R-squared. It does so by penalizing for extra regressors. So
R-squared is almost never useful as an indication of the quality of fit.
Adjusted R-squared might be (but often isn't either because of selection
bias among other reasons).

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
"The business of the statistician is to catalyze the scientific learning
process."  - George E. P. Box
 
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Benjamin M. Osborne
> Sent: Monday, April 18, 2005 3:52 PM
> To: R help
> Subject: [R] R-squared in summary(lm...)
> 
> What is the difference between the two R-squareds returned 
> for a linear
> regression by summary(lm...)?  When might one report multiple 
> vs. adjusted
> R-squared?
> Thank you,
> Ben Osborne
> 
> -- 
> Botany Department
> University of Vermont
> 109 Carrigan Drive
> Burlington, VT 05405
> 
> [EMAIL PROTECTED]
> phone: 802-656-0297
> fax: 802-656-0440
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>

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


[R] using imported tables

2005-04-18 Thread Owen Buchner
I've recently found out using read.table i can insert a table into R from a .dat
file.  The problem i'm having is now that i've got R to read the package i want
to use the data from each column.  I've tried adding titles to each column
using col.name, but it assigns a name to the entire table and wont recognize
the name i gave the table later in programming.  Is there something i'm doing
wrong or am i missing an important step?  I'd appreciate any help.

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


[R] R-squared in summary(lm...)

2005-04-18 Thread Benjamin M. Osborne
What is the difference between the two R-squareds returned for a linear
regression by summary(lm...)?  When might one report multiple vs. adjusted
R-squared?
Thank you,
Ben Osborne

-- 
Botany Department
University of Vermont
109 Carrigan Drive
Burlington, VT 05405

[EMAIL PROTECTED]
phone: 802-656-0297
fax: 802-656-0440

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


Re: [R] Construction of a large sparse matrix

2005-04-18 Thread roger koenker
The dense blocks are too big as Reid has already written --
for smaller instances of this sort of thing  I would suggest that the 
the kronecker
product %x% operator in SparseM,  would be more convenient.

url:www.econ.uiuc.edu/~rogerRoger Koenker
email   [EMAIL PROTECTED]   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820
On Apr 18, 2005, at 3:54 PM, Doran, Harold wrote:
Dear List:
I'm working to construct a very large sparse matrix and have found
relief using the SparseM package. I have encountered an issue that is
confusing to me and wonder if anyone may be able to suggest a smarter
solution. The matrix I'm creating is a covariance matrix for a larger
research problem that is subsequently used in a simulation. Below is 
the
latex form of the matrix if anyone wants to see the pattern I am trying
to create.

The core of my problem seems to localize to the last line of the
following portion of code.
n<-sample.size*4
k<-n/4
vl.mat <- as.matrix.csr(0, n, n)
block <- 1:k #each submatrix size
for(i in 1:3) vl.mat[i *k + block, i*k + block] <- LE
When the variable LE is 0, the matrix is easily created. For example,
when sample.size = 10,000 this matrix was created on my machine in 
about
1 second. Here is the object size.

object.size(vl.mat)
[1] 160692
However, when LE is any number other than 0, the code generates an
error. For example, when I try LE <- 2 I get
Error: cannot allocate vector of size 781250 Kb
In addition: Warning message:
Reached total allocation of 1024Mb: see help(memory.size)
Error in as.matrix.coo(as.matrix.csr(value, nrow = length(rw), ncol =
length(cl))) :
Unable to find the argument "x" in selecting a method for
function "as.matrix.coo"
I'm guessing that single digit integers should occupy the same amount 
of
memory. So, I'm thinking that the matrix is "less sparse" and the
problem is related to the introduction of a non-zero element (seems
obvious). However, the matrix still retains a very large proportion of
zeros. In fact, there are still more zeros than non-zero elements.

Can anyone suggest a reason why I am not able to create this matrix? 
I'm
at the limit of my experience and could use a pointer if anyone is able
to provide one.

Many thanks,
Harold
P.S. The matrix above is added to another matrix to create the
covariance matrix below. The code above is designed to create the
portion of the matrix \sigma^2_{vle}\bm{J} .
\begin{equation}
\label{vert:cov}
\bm{\Phi} = var
\left [
\begin{array}{c}
Y^*_{1}\\
Y^*_{2}\\
Y^*_{3}\\
Y^*_{4}\\
\end{array}
\right ]
=
\left [
\begin{array}{}
\sigma^2_{\epsilon}\bm{I}& \sigma^2_{\epsilon}\rho\bm{I} & \bm{0} &
\bm{0}\\
\sigma^2_{\epsilon}\rho\bm{I} &
\sigma^2_{\epsilon}\bm{I}+\sigma^2_{vle}\bm{J} &
\sigma^2_{\epsilon}\rho^2\bm{I} & \bm{0}\\
\bm{0} & \sigma^2_{\epsilon}\rho^2\bm{I} &
\sigma^2_{\epsilon}\bm{I}+\sigma^2_{vle}\bm{J}&
\sigma^2_{\epsilon}\rho^3\bm{I}\\
\bm{0} & \bm{0} & \sigma^2_{\epsilon}\rho^3\bm{I}&
\sigma^2_{\epsilon}\bm{I}+\sigma^2_{vle}\bm{J} \\
\end{array}
\right]
\end{equation}
where $\bm{I}$ is the identity matrix, $\bm{J}$ is the unity matrix, 
and
$\rho$ is the autocorrelation.


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


RE: [R] Construction of a large sparse matrix

2005-04-18 Thread Huntsinger, Reid
Your statements for sample.size=10,000 try to construct a matrix with 3
dense 10,000 x 10,000 blocks. That's approximately 10*10*8 MB each and very
likely explains your error message. 

Since you have a simple formula for the matrix, why not define a function to
implement multiplication by this matrix (and whatever else you want to do
with it), rather than use general sparse matrix representations? 

Reid Huntsinger

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Doran, Harold
Sent: Monday, April 18, 2005 4:55 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Construction of a large sparse matrix


Dear List:

I'm working to construct a very large sparse matrix and have found
relief using the SparseM package. I have encountered an issue that is
confusing to me and wonder if anyone may be able to suggest a smarter
solution. The matrix I'm creating is a covariance matrix for a larger
research problem that is subsequently used in a simulation. Below is the
latex form of the matrix if anyone wants to see the pattern I am trying
to create. 

The core of my problem seems to localize to the last line of the
following portion of code. 

n<-sample.size*4
k<-n/4
vl.mat <- as.matrix.csr(0, n, n) 
block <- 1:k #each submatrix size
for(i in 1:3) vl.mat[i *k + block, i*k + block] <- LE

When the variable LE is 0, the matrix is easily created. For example,
when sample.size = 10,000 this matrix was created on my machine in about
1 second. Here is the object size.

> object.size(vl.mat)
[1] 160692

However, when LE is any number other than 0, the code generates an
error. For example, when I try LE <- 2 I get

Error: cannot allocate vector of size 781250 Kb
In addition: Warning message: 
Reached total allocation of 1024Mb: see help(memory.size) 
Error in as.matrix.coo(as.matrix.csr(value, nrow = length(rw), ncol =
length(cl))) : 
Unable to find the argument "x" in selecting a method for
function "as.matrix.coo" 

I'm guessing that single digit integers should occupy the same amount of
memory. So, I'm thinking that the matrix is "less sparse" and the
problem is related to the introduction of a non-zero element (seems
obvious). However, the matrix still retains a very large proportion of
zeros. In fact, there are still more zeros than non-zero elements. 

Can anyone suggest a reason why I am not able to create this matrix? I'm
at the limit of my experience and could use a pointer if anyone is able
to provide one.

Many thanks,
Harold


P.S. The matrix above is added to another matrix to create the
covariance matrix below. The code above is designed to create the
portion of the matrix \sigma^2_{vle}\bm{J} . 


\begin{equation}
\label{vert:cov}
\bm{\Phi} = var
\left [ 
\begin{array}{c}
Y^*_{1}\\
Y^*_{2}\\
Y^*_{3}\\
Y^*_{4}\\
\end{array}
\right ]
=
\left [ 
\begin{array}{}
\sigma^2_{\epsilon}\bm{I}& \sigma^2_{\epsilon}\rho\bm{I} & \bm{0} &
\bm{0}\\
\sigma^2_{\epsilon}\rho\bm{I} &
\sigma^2_{\epsilon}\bm{I}+\sigma^2_{vle}\bm{J} &
\sigma^2_{\epsilon}\rho^2\bm{I} & \bm{0}\\
\bm{0} & \sigma^2_{\epsilon}\rho^2\bm{I} &
\sigma^2_{\epsilon}\bm{I}+\sigma^2_{vle}\bm{J}&
\sigma^2_{\epsilon}\rho^3\bm{I}\\
\bm{0} & \bm{0} & \sigma^2_{\epsilon}\rho^3\bm{I}&
\sigma^2_{\epsilon}\bm{I}+\sigma^2_{vle}\bm{J} \\
\end{array}
\right]
\end{equation}

where $\bm{I}$ is the identity matrix, $\bm{J}$ is the unity matrix, and
$\rho$ is the autocorrelation.



[[alternative HTML version deleted]]

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

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


Re: [R] R 2.1.0 GUI language

2005-04-18 Thread Prof Brian Ripley
On Mon, 18 Apr 2005, Stephan Tolksdorf wrote:
[...]
LC_ALL doesn't seem to change the message language. LC_MESSAGES,
which is mentioned  in the installation and administration guide,
doesn't seem to exist in R 2.1.0 and isn't listed in the locales help.
Right: it cannot be set inside R.  For as the manual says:
  Note that you should not expect to be able to change the language
  once R is running.
But it can be set as an environment variable outside R, as described in 
the rw-FAQ.  Setting either LC_MESSAGES or LC_ALL=de on the command line 
works for me.

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


[R] Construction of a large sparse matrix

2005-04-18 Thread Doran, Harold
Dear List:

I'm working to construct a very large sparse matrix and have found
relief using the SparseM package. I have encountered an issue that is
confusing to me and wonder if anyone may be able to suggest a smarter
solution. The matrix I'm creating is a covariance matrix for a larger
research problem that is subsequently used in a simulation. Below is the
latex form of the matrix if anyone wants to see the pattern I am trying
to create. 

The core of my problem seems to localize to the last line of the
following portion of code. 

n<-sample.size*4
k<-n/4
vl.mat <- as.matrix.csr(0, n, n) 
block <- 1:k #each submatrix size
for(i in 1:3) vl.mat[i *k + block, i*k + block] <- LE

When the variable LE is 0, the matrix is easily created. For example,
when sample.size = 10,000 this matrix was created on my machine in about
1 second. Here is the object size.

> object.size(vl.mat)
[1] 160692

However, when LE is any number other than 0, the code generates an
error. For example, when I try LE <- 2 I get

Error: cannot allocate vector of size 781250 Kb
In addition: Warning message: 
Reached total allocation of 1024Mb: see help(memory.size) 
Error in as.matrix.coo(as.matrix.csr(value, nrow = length(rw), ncol =
length(cl))) : 
Unable to find the argument "x" in selecting a method for
function "as.matrix.coo" 

I'm guessing that single digit integers should occupy the same amount of
memory. So, I'm thinking that the matrix is "less sparse" and the
problem is related to the introduction of a non-zero element (seems
obvious). However, the matrix still retains a very large proportion of
zeros. In fact, there are still more zeros than non-zero elements. 

Can anyone suggest a reason why I am not able to create this matrix? I'm
at the limit of my experience and could use a pointer if anyone is able
to provide one.

Many thanks,
Harold


P.S. The matrix above is added to another matrix to create the
covariance matrix below. The code above is designed to create the
portion of the matrix \sigma^2_{vle}\bm{J} . 


\begin{equation}
\label{vert:cov}
\bm{\Phi} = var
\left [ 
\begin{array}{c}
Y^*_{1}\\
Y^*_{2}\\
Y^*_{3}\\
Y^*_{4}\\
\end{array}
\right ]
=
\left [ 
\begin{array}{}
\sigma^2_{\epsilon}\bm{I}& \sigma^2_{\epsilon}\rho\bm{I} & \bm{0} &
\bm{0}\\
\sigma^2_{\epsilon}\rho\bm{I} &
\sigma^2_{\epsilon}\bm{I}+\sigma^2_{vle}\bm{J} &
\sigma^2_{\epsilon}\rho^2\bm{I} & \bm{0}\\
\bm{0} & \sigma^2_{\epsilon}\rho^2\bm{I} &
\sigma^2_{\epsilon}\bm{I}+\sigma^2_{vle}\bm{J}&
\sigma^2_{\epsilon}\rho^3\bm{I}\\
\bm{0} & \bm{0} & \sigma^2_{\epsilon}\rho^3\bm{I}&
\sigma^2_{\epsilon}\bm{I}+\sigma^2_{vle}\bm{J} \\
\end{array}
\right]
\end{equation}

where $\bm{I}$ is the identity matrix, $\bm{J}$ is the unity matrix, and
$\rho$ is the autocorrelation.



[[alternative HTML version deleted]]

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


Re: [R] Very Slow Gower Similarity Function

2005-04-18 Thread Tyler Smith
Quoting Martin Maechler <[EMAIL PROTECTED]>:

> I don't know what exactly you want.

The Gower coefficient I am referring to comes from his 1971 article in
Biometrics (27(4):857-871). It differs from most commonly used measures (but
not, apparently, daisy!) by allowing the incorporation of quantitative and
qualitative (binary or unordered multistate characters) variables, and also by
providing a mechanism for dropping missing values from similarity calculations.
This is also covered in Legendre and Legendre.

>
> The function  daisy() in the recommended package "cluster"
> has always worked with missing values and IIRC, the book
> "Kaufman & Rousseeuw" {which I have not at hand here at home},
> clearly mentions Gower's origin of their distance measure
> definition.

I was unaware of the daisy function. Looking over it now it differs from the
Gower coefficient primarily in the method of standardization. Gower
standardized each variable by dividing it by it's range ("ranging"), where
daisy does a more conventional standardization (-mean and /SD). As I understand
it, there isn't much to recommend standardizing over ranging (or vice versa) so
daisy may provide a useful alternative for my project. I'll have to look into
it!

Thanks,

Tyler

>
> Martin Maechler, maintainer of cluster package,
> ETH Zurich
>

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


Re: [R] R 2.1.0 GUI language

2005-04-18 Thread Stephan Tolksdorf
Thanks for your prompt reply.
Which OS is this?  PLEASE do read the posting guide.
Win XP, SP2 (German), which I forgot to mention despite heaving read the 
guide.

This *is* documented in the `R Installation and Adminstration' Manual, 
section `Internationalization'.
Looked in the wrong place (and the help isn't globally searchable).
If your OS is set to German, then why don't you expect R to follow?
I'd just like to have an option to change the language. English is my 
working language and the common denominator of my tool chain. German 
warning messages probably also wouldn't be much help to me when asking 
for help on this list.
By the way, I'd be quite afraid to suddenly see the German decimal comma 
 instead of point in my program output, but fortunately R isn't that 
localized.

If you don't want German menus, do you want German months (as has 
happened for many versions).

For Windows or Linux, to just change the language of messages, set 
environment variable LANGUAGE=en.  To set all aspects, set LC_ALL=en.  I 
don't know about MacOS X menus.
LC_ALL doesn't seem to change the message language. LC_MESSAGES,
which is mentioned  in the installation and administration guide,
doesn't seem to exist in R 2.1.0 and isn't listed in the locales help.
I helped myself by putting
Sys.putenv("LANGUAGE"="EN");Sys.setlocale("LC_ALL","EN")
into etc/Rprofile. Don't know if this is the default way to go.
Stephan
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Pearson corelation and p-value for matrix

2005-04-18 Thread Liaw, Andy
I believe this will do:

cor.pval2 <- function(x,  alternative="two-sided") {
corMat <- cor(x, use=if (any(is.na(x))) "pairwise.complete.obs" else
"all")
df <- crossprod(!is.na(x)) - 2
STATISTIC <- sqrt(df) * corMat / sqrt(1 - corMat^2)
p <- pt(STATISTIC, df)
p <- if (alternative == "less") {
p
} else if (alternative == "greater") {
1 - p
} else 2 * pmin(p, 1 - p)
p
}

Some test:

> set.seed(1)
> x <- matrix(runif(2e3 * 1e2), 2e3)
> system.time(res1 <- cor.pval(t(x)), gcFirst=TRUE)
[1] 17.28  0.77 18.16NANA
> system.time(res2 <- cor.pval2(t(x)), gcFirst=TRUE)
[1] 19.51  1.05 20.70NANA
> max(abs(res1 - res2))
[1] 0
> x[c(1, 3, 6), c(2, 4)] <- NA
> x[30, 61] <- NA
> system.time(res2 <- cor.pval2(t(x)), gcFirst=TRUE)
[1] 24.48  0.71 25.28NANA

This is a bit slower because of the extra computation for "df".  One can try
to save some computation by only computing with the lower (or upper)
triangular part.

Cheers,
Andy

> From: John Fox
> 
> Dear Dren,
> 
> Since cor(), on which Andy's solution is based, can compute 
> pairwise-present
> correlations, you could adapt his function -- you'll have to 
> adjust the df
> for each pair. Alternatively, you could probably save some 
> time (programming
> time + computer time) by just using my solution:
> 
> > R <- diag(100)
> > R[upper.tri(R)] <- R[lower.tri(R)] <- .5
> > library(mvtnorm)
> > X <- rmvnorm(6000, sigma=R)
> > system.time(for (i in 1:50) cor.pvalues(X), gc=TRUE)
> [1] 518.19   1.11 520.23 NA NA
> 
> I know that time is money, but nine minutes (on my machine) 
> probably won't
> bankrupt anyone.
> 
> Regards,
>  John
> 
> 
> John Fox
> Department of Sociology
> McMaster University
> Hamilton, Ontario
> Canada L8S 4M4
> 905-525-9140x23604
> http://socserv.mcmaster.ca/jfox 
>  
> 
> > -Original Message-
> > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] On Behalf Of Dren Scott
> > Sent: Monday, April 18, 2005 12:41 PM
> > To: 'R-Help'
> > Subject: RE: [R] Pearson corelation and p-value for matrix
> > 
> > Hi all,
> >  
> > Thanks Andy, Mark and John for all the help. I really 
> > appreciate it. I'm new to both R and statistics, so please 
> > excuse any gaffes on my part. 
> >  
> > Essentially what I'm trying to do, is to evaluate for each 
> > row, how many other rows would have a p-value < 0.05. So, 
> > after I get my N x N p-value matrix, I'll just filter out 
> > values that are > 0.05.
> >  
> > Each of my datasets (6000 rows x 100 columns) would consist 
> > of some NA's. The iterative procedure (cor.pvalues) proposed 
> > by John would yield the values, but it would take an 
> > inordinately long time (I have 50 of these datasets to 
> > process). The solution proposed by Andy, although fast, would 
> > not be able to incorporate the NA's.
> >  
> > Is there any workaround for the NA's? Or possibly do you 
> > think I could try something else?
> >  
> > Thanks very much. 
> >  
> > Dren
> > 
> > 
> > "Liaw, Andy" <[EMAIL PROTECTED]> wrote:
> > > From: John Fox
> > > 
> > > Dear Andy,
> > > 
> > > That's clearly much better -- and illustrates an 
> effective strategy 
> > > for vectorizing (or "matricizing") a computation. I think 
> I'll add 
> > > this to my list of programming examples. It might be a little 
> > > dangerous to pass ...
> > > through to cor(), since someone could specify 
> type="spearman", for 
> > > example.
> > 
> > Ah, yes, the "..." isn't likely to help here! Also, it will 
> > only work correctly if there are no NA's, for example (or 
> > else the degree of freedom would be wrong). 
> > 
> > Best,
> > Andy
> > 
> > > Thanks,
> > > John
> > > 
> > > 
> > > John Fox
> > > Department of Sociology
> > > McMaster University
> > > Hamilton, Ontario
> > > Canada L8S 4M4
> > > 905-525-9140x23604
> > > http://socserv.mcmaster.ca/jfox
> > > 
> > > 
> > > > -Original Message-
> > > > From: Liaw, Andy [mailto:[EMAIL PROTECTED]
> > > > Sent: Friday, April 15, 2005 9:51 PM
> > > > To: 'John Fox'; [EMAIL PROTECTED]
> > > > Cc: 'R-Help'; 'Dren Scott'
> > > > Subject: RE: [R] Pearson corelation and p-value for matrix
> > > > 
> > > > We can be a bit sneaky and `borrow' code from cor.test.default:
> > > > 
> > > > cor.pval <- function(x, alternative="two-sided", ...) { 
> corMat <- 
> > > > cor(x, ...) n <- nrow(x) df <- n - 2 STATISTIC <- 
> > sqrt(df) * corMat 
> > > > / sqrt(1 - corMat^2) p <- pt(STATISTIC, df) p <- if 
> > (alternative == 
> > > > "less") { p } else if (alternative == "greater") {
> > > > 1 - p
> > > > } else 2 * pmin(p, 1 - p)
> > > > p
> > > > }
> > > > 
> > > > The test:
> > > > 
> > > > > system.time(c1 <- cor.pvals(X), gcFirst=TRUE)
> > > > [1] 13.19 0.01 13.58 NA NA
> > > > > system.time(c2 <- cor.pvalues(X), gcFirst=TRUE)
> > > > [1] 6.22 0.00 6.42 NA NA
> > > > > system.time(c3 <- cor.p

RE: [R] when can we expect Prof Tierney's compiled R?

2005-04-18 Thread Liaw, Andy
Do you mean the byte code compiler?  You can find it at:
http://www.stat.uiowa.edu/~luke/R/compiler/

Andy

> From: Jason Liao
> 
> I am excited to learn that Prof. Tierney is bringing to us compiled R.
> I would like to learn when it will be available. This information will
> be useful in scheduling some of my projects. Thanks.
> 
> Jason
> 
> 
> Jason Liao, http://www.geocities.com/jg_liao
> Dept. of Biostatistics, http://www2.umdnj.edu/bmtrxweb
> University of Medicine and Dentistry of New Jersey
> 683 Hoes Lane West, Piscataway' NJ 08854
> phone 732-235-5429, School of Public Health office
> phone 732-235-9824, Cancer Institute of New Jersey office
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 
>

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


Re: [R] Very Slow Gower Similarity Function

2005-04-18 Thread Martin Maechler
> "Tyler" == Tyler Smith <[EMAIL PROTECTED]>
> on Mon, 18 Apr 2005 12:10:34 -0400 writes:

Tyler> Hello, I am a relatively new user of R. I have
Tyler> written a basic function to calculate the Gower
Tyler> similarity function. I was motivated to do so partly
Tyler> as an excercise in learning R, and partly because the
Tyler> existing option (vegdist in the vegan package) does
Tyler> not accept missing values.

I don't know what exactly you want.

The function  daisy() in the recommended package "cluster"
has always worked with missing values and IIRC, the book
"Kaufman & Rousseeuw" {which I have not at hand here at home},
clearly mentions Gower's origin of their distance measure
definition.

Martin Maechler, maintainer of cluster package,
ETH Zurich


Tyler> I think I have succeeded - my function gives me the
Tyler> correct values. However, now that I'm starting to use
Tyler> it with real data, I realise it's very slow. It takes
Tyler> more than 45 minutes on my Windows 98 machine (R
Tyler> 2.0.1 Patched (2005-03-29)) with a 185x32 matrix with
Tyler> ca 100 missing values. If anyone can suggest ways to
Tyler> speed up my function I would appreciate it. I suspect
Tyler> having a pair of nested for loops is the problem, but
Tyler> I couldn't figure out how to get rid of them.

Tyler> The function is:

Tyler> ### Gower Similarity Matrix###

Tyler> sGow <- function (mat){

Tyler> OBJ <- nrow(mat) #number of objects MATDESC <- ncol
Tyler> (mat) #number of descriptors MRANGE <- apply
Tyler> (mat,2,max, na.rm=T)-apply (mat,2,min,na.rm=T) #descr
Tyler> ranges DESCRIPT <- 1:MATDESC #descriptor index vector
Tyler> smat <- matrix(1, nrow = OBJ, ncol = OBJ) #'empty'
Tyler> similarity matrix

Tyler> for (i in 1:OBJ){ for (j in i:OBJ){

Tyler> ##calculate index vector of non-NA descriptors
Tyler> between objects i and j descvect <- intersect
Tyler> (setdiff (DESCRIPT,
Tyler> DESCRIPT[is.na(mat[i,DESCRIPT])]), setdiff (DESCRIPT,
Tyler> DESCRIPT[is.na (mat[j,DESCRIPT])]))

Tyler> descnum <- length(descvect) # number of valid
Tyler> descr for i~j comparison

Tyler> partialsim <- (1-
Tyler> abs(mat[i,descvect]-mat[j,descvect])/MRANGE[descvect])

Tyler> smat[i,j] <- smat[j,i] <- sum (partialsim) /
Tyler> descnum } } smat }

Tyler> Thank-you for your time,

Tyler> Tyler

Tyler> -- Tyler Smith

Tyler> PhD Candidate Plant Science Department McGill
Tyler> University

Tyler> [EMAIL PROTECTED]

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

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


Re: [R] R 2.1.0 GUI language

2005-04-18 Thread Prof Brian Ripley
On Mon, 18 Apr 2005, Stephan Tolksdorf wrote:
How do I set the language of the GUI? With R 2.1.0 it suddenly changed to 
German and I want it to stay English. I couldn't find any setting to change.
Which OS is this?  PLEASE do read the posting guide.
This *is* documented in the `R Installation and Adminstration' Manual, 
section `Internationalization'.

If your OS is set to German, then why don't you expect R to follow?
If you don't want German menus, do you want German months (as has happened 
for many versions).

For Windows or Linux, to just change the language of messages, set 
environment variable LANGUAGE=en.  To set all aspects, set LC_ALL=en.  I 
don't know about MacOS X menus.

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


RE: [R] Pearson corelation and p-value for matrix

2005-04-18 Thread John Fox
Dear Dren,

Since cor(), on which Andy's solution is based, can compute pairwise-present
correlations, you could adapt his function -- you'll have to adjust the df
for each pair. Alternatively, you could probably save some time (programming
time + computer time) by just using my solution:

> R <- diag(100)
> R[upper.tri(R)] <- R[lower.tri(R)] <- .5
> library(mvtnorm)
> X <- rmvnorm(6000, sigma=R)
> system.time(for (i in 1:50) cor.pvalues(X), gc=TRUE)
[1] 518.19   1.11 520.23 NA NA

I know that time is money, but nine minutes (on my machine) probably won't
bankrupt anyone.

Regards,
 John


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

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Dren Scott
> Sent: Monday, April 18, 2005 12:41 PM
> To: 'R-Help'
> Subject: RE: [R] Pearson corelation and p-value for matrix
> 
> Hi all,
>  
> Thanks Andy, Mark and John for all the help. I really 
> appreciate it. I'm new to both R and statistics, so please 
> excuse any gaffes on my part. 
>  
> Essentially what I'm trying to do, is to evaluate for each 
> row, how many other rows would have a p-value < 0.05. So, 
> after I get my N x N p-value matrix, I'll just filter out 
> values that are > 0.05.
>  
> Each of my datasets (6000 rows x 100 columns) would consist 
> of some NA's. The iterative procedure (cor.pvalues) proposed 
> by John would yield the values, but it would take an 
> inordinately long time (I have 50 of these datasets to 
> process). The solution proposed by Andy, although fast, would 
> not be able to incorporate the NA's.
>  
> Is there any workaround for the NA's? Or possibly do you 
> think I could try something else?
>  
> Thanks very much. 
>  
> Dren
> 
> 
> "Liaw, Andy" <[EMAIL PROTECTED]> wrote:
> > From: John Fox
> > 
> > Dear Andy,
> > 
> > That's clearly much better -- and illustrates an effective strategy 
> > for vectorizing (or "matricizing") a computation. I think I'll add 
> > this to my list of programming examples. It might be a little 
> > dangerous to pass ...
> > through to cor(), since someone could specify type="spearman", for 
> > example.
> 
> Ah, yes, the "..." isn't likely to help here! Also, it will 
> only work correctly if there are no NA's, for example (or 
> else the degree of freedom would be wrong). 
> 
> Best,
> Andy
> 
> > Thanks,
> > John
> > 
> > 
> > John Fox
> > Department of Sociology
> > McMaster University
> > Hamilton, Ontario
> > Canada L8S 4M4
> > 905-525-9140x23604
> > http://socserv.mcmaster.ca/jfox
> > 
> > 
> > > -Original Message-
> > > From: Liaw, Andy [mailto:[EMAIL PROTECTED]
> > > Sent: Friday, April 15, 2005 9:51 PM
> > > To: 'John Fox'; [EMAIL PROTECTED]
> > > Cc: 'R-Help'; 'Dren Scott'
> > > Subject: RE: [R] Pearson corelation and p-value for matrix
> > > 
> > > We can be a bit sneaky and `borrow' code from cor.test.default:
> > > 
> > > cor.pval <- function(x, alternative="two-sided", ...) { corMat <- 
> > > cor(x, ...) n <- nrow(x) df <- n - 2 STATISTIC <- 
> sqrt(df) * corMat 
> > > / sqrt(1 - corMat^2) p <- pt(STATISTIC, df) p <- if 
> (alternative == 
> > > "less") { p } else if (alternative == "greater") {
> > > 1 - p
> > > } else 2 * pmin(p, 1 - p)
> > > p
> > > }
> > > 
> > > The test:
> > > 
> > > > system.time(c1 <- cor.pvals(X), gcFirst=TRUE)
> > > [1] 13.19 0.01 13.58 NA NA
> > > > system.time(c2 <- cor.pvalues(X), gcFirst=TRUE)
> > > [1] 6.22 0.00 6.42 NA NA
> > > > system.time(c3 <- cor.pval(X), gcFirst=TRUE)
> > > [1] 0.07 0.00 0.07 NA NA
> > > 
> > > Cheers,
> > > Andy
> > > 
> > > > From: John Fox
> > > > 
> > > > Dear Mark,
> > > > 
> > > > I think that the reflex of trying to avoid loops in R is often 
> > > > mistaken, and so I decided to try to time the two
> > approaches (on a
> > > > 3GHz Windows XP system).
> > > > 
> > > > I discovered, first, that there is a bug in your 
> function -- you 
> > > > appear to have indexed rows instead of columns; fixing that:
> > > > 
> > > > cor.pvals <- function(mat)
> > > > {
> > > > cols <- expand.grid(1:ncol(mat), 1:ncol(mat)) 
> matrix(apply(cols, 
> > > > 1,
> > > > function(x) cor.test(mat[, x[1]], mat[, x[2]])$p.value), ncol = 
> > > > ncol(mat)) }
> > > > 
> > > > 
> > > > My function is cor.pvalues and yours cor.pvals. This is
> > for a data
> > > > matrix with 1000 observations on 100 variables:
> > > > 
> > > > > R <- diag(100)
> > > > > R[upper.tri(R)] <- R[lower.tri(R)] <- .5
> > > > > library(mvtnorm)
> > > > > X <- rmvnorm(1000, sigma=R)
> > > > > dim(X)
> > > > [1] 1000 100
> > > > > 
> > > > > system.time(cor.pvalues(X))
> > > > [1] 5.53 0.00 5.53 NA NA
> > > > > 
> > > > > system.time(cor.pvals(X))
> > > > [1] 12.66 0.00 12.66 NA NA
> > > > > 
> > > > 
> > > > I frankly didn't expect the a

Re: [R] Very Slow Gower Similarity Function

2005-04-18 Thread Jari Oksanen
On 18 Apr 2005, at 20:36, Anon. wrote:
Jari Oksanen wrote:
On 18 Apr 2005, at 19:10, Tyler Smith wrote:
Hello,
I am a relatively new user of R. I have written a basic function to 
calculate
the Gower similarity function. I was motivated to do so partly as an 
excercise
in learning R, and partly because the existing option (vegdist in 
the vegan
package) does not accept missing values.

Speed is the reason to use C instead of R. It should be easy, almost 
trivial, to modify the vegdist.c  so that it handles missing values. 
I guess this handling means ignoring the value pair if one of the 
values is missing -- which is not so gentle to the metric properties 
so dear to Gower. Package vegan is designed for ecological community 
data which generally do not have missing values (except in 
environmental data), but contributions are welcome.

The only reason you never see ecological community data with missing 
values is because the ecologists remove those species/sites from their 
Excel sheets before they give it to you to sort out their mess.
Well, ecologists have plenty of missing species in their community 
data, but these have zero values since they were not observed. I guess 
some Bob O'Hara is going to have a paper about this in JAE.

This is actually one of the few things they know how to do in Excel - 
I'm dreading the day when a paper appears in JAE saying that you can 
use Excel to produce P-values.

The "A" in "JAE" stands for "Animal": for real things they still have 
Journal of Ecology.

To be slightly more serious, as an exercise the OP could consider 
writing a wrapper function in R that removes the missing data and then 
calls vegdist to calculate his Gower similarity index.

The looping goes within C code, and for pairwise deletion of missing 
values wrapping is difficult. With complete.cases this is trivial (and 
then your result would be more metric as well).
--
Jari Oksanen, Oulu, Finland

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


[R] when can we expect Prof Tierney's compiled R?

2005-04-18 Thread Jason Liao
I am excited to learn that Prof. Tierney is bringing to us compiled R.
I would like to learn when it will be available. This information will
be useful in scheduling some of my projects. Thanks.

Jason


Jason Liao, http://www.geocities.com/jg_liao
Dept. of Biostatistics, http://www2.umdnj.edu/bmtrxweb
University of Medicine and Dentistry of New Jersey
683 Hoes Lane West, Piscataway‚ NJ 08854
phone 732-235-5429, School of Public Health office
phone 732-235-9824, Cancer Institute of New Jersey office

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


[R] R 2.1.0 GUI language

2005-04-18 Thread Stephan Tolksdorf
Hi
How do I set the language of the GUI? With R 2.1.0 it suddenly changed 
to German and I want it to stay English. I couldn't find any setting to 
change.

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


RE: [R] Generating a binomial random variable correlated with a

2005-04-18 Thread Mohammad A. Chaudhary
Dear:
Thank you very much for your 'generous' help. Overall I have learnt the
limits of the solution to my problem. I was not feeling compfortable how
I was going around with the problem.
Bill and Ted provided a wonderful insight into what I was accomplishing
and provided alternative solutions. The method suggested by Earnst and
Giovanni seems to be more objective and easy to implement. Ted's follow
up on Bills remark leads in the same direction too. I don't have words
to thank you all.
Ashraf

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


[R] dynamic function loading

2005-04-18 Thread Omar Lakkis
How can I do dynamic function loading in R?
I have a list of R functions in the database and want to, dynamicly,
execute teh function that corresponds to my in comming data. Is there
a way to do that without a big if/else?

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


Re: [R] colClasses = "Date" in read.delim, how to pass date-format?

2005-04-18 Thread Prof Brian Ripley
On Mon, 18 Apr 2005, Christoph Lehmann wrote:
so what do you recommend: I just need to be able to sort a data.frame
according to the date entry, and e.g. compute differences between subsequent
dates. Shall I stay with dates (thanks for the hint about confusion of Date
and dates) or is there a better way for this kind of task?
I suggest you use "Date": read as character and convert using as.Date 
after reading.

thanks a lot
Cheers
Christoph
You are confusing class "Date" (part of R) with class "dates" (part of
package chron).  There is no as() method for class "dates", so you can't
do this.  You can read the column as character (not factor) and convert
later, but it sounds like the `huge amount of memory (and time)' is in
fact taken by package chron.
On Mon, 18 Apr 2005, Christoph Lehmann wrote:
I have a huge data-set with one column being of type date.
Of course I can import the data using this column as "factor" and then
convert it later to dates, using:
sws.bezuege$FaktDat <- dates(as.character(sws.bezuege$FaktDat),
format = c(dates = "d.m.y"))
But the conversion requires a huge amount of memory (and time),
therefore I
would like to use colClasses = c("Date"). My question is:
since I have format  = c(dates = "d.m.y"), how can I pass this option to
read.delim(..., colClasses = c("Date")) ?
--
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
--
+++ GMX - Die erste Adresse für Mail, Message, More +++
1 GB Mailbox bereits in GMX FreeMail http://www.gmx.net/de/go/mail

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

Re: [R] colClasses = "Date" in read.delim, how to pass date-format?

2005-04-18 Thread Christoph Lehmann
so what do you recommend: I just need to be able to sort a data.frame
according to the date entry, and e.g. compute differences between subsequent
dates. Shall I stay with dates (thanks for the hint about confusion of Date
and dates) or is there a better way for this kind of task?

thanks a lot
Cheers
Christoph
> You are confusing class "Date" (part of R) with class "dates" (part of 
> package chron).  There is no as() method for class "dates", so you can't 
> do this.  You can read the column as character (not factor) and convert 
> later, but it sounds like the `huge amount of memory (and time)' is in 
> fact taken by package chron.
> 
> On Mon, 18 Apr 2005, Christoph Lehmann wrote:
> 
> > I have a huge data-set with one column being of type date.
> > Of course I can import the data using this column as "factor" and then 
> > convert it later to dates, using:
> >
> > sws.bezuege$FaktDat <- dates(as.character(sws.bezuege$FaktDat),
> > format = c(dates = "d.m.y"))
> >
> >
> > But the conversion requires a huge amount of memory (and time),
> therefore I 
> > would like to use colClasses = c("Date"). My question is:
> > since I have format  = c(dates = "d.m.y"), how can I pass this option to
> > read.delim(..., colClasses = c("Date")) ?
> 
> -- 
> Brian D. Ripley,  [EMAIL PROTECTED]
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel:  +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865 272595
> 

--

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


RE: [R] Pearson corelation and p-value for matrix

2005-04-18 Thread Dren Scott
Hi all,
 
Thanks Andy, Mark and John for all the help. I really appreciate it. I'm new to 
both R and statistics, so please excuse any gaffes on my part. 
 
Essentially what I'm trying to do, is to evaluate for each row, how many other 
rows would have a p-value < 0.05. So, after I get my N x N p-value matrix, I'll 
just filter out values that are > 0.05.
 
Each of my datasets (6000 rows x 100 columns) would consist of some NA's. The 
iterative procedure (cor.pvalues) proposed by John would yield the values, but 
it would take an inordinately long time (I have 50 of these datasets to 
process). The solution proposed by Andy, although fast, would not be able to 
incorporate the NA's.
 
Is there any workaround for the NA's? Or possibly do you think I could try 
something else?
 
Thanks very much. 
 
Dren


"Liaw, Andy" <[EMAIL PROTECTED]> wrote:
> From: John Fox 
> 
> Dear Andy,
> 
> That's clearly much better -- and illustrates an effective 
> strategy for
> vectorizing (or "matricizing") a computation. I think I'll 
> add this to my
> list of programming examples. It might be a little dangerous 
> to pass ...
> through to cor(), since someone could specify 
> type="spearman", for example.

Ah, yes, the "..." isn't likely to help here! Also, it will 
only work correctly if there are no NA's, for example (or 
else the degree of freedom would be wrong). 

Best,
Andy

> Thanks,
> John
> 
> 
> John Fox
> Department of Sociology
> McMaster University
> Hamilton, Ontario
> Canada L8S 4M4
> 905-525-9140x23604
> http://socserv.mcmaster.ca/jfox 
>  
> 
> > -Original Message-
> > From: Liaw, Andy [mailto:[EMAIL PROTECTED] 
> > Sent: Friday, April 15, 2005 9:51 PM
> > To: 'John Fox'; [EMAIL PROTECTED]
> > Cc: 'R-Help'; 'Dren Scott'
> > Subject: RE: [R] Pearson corelation and p-value for matrix
> > 
> > We can be a bit sneaky and `borrow' code from cor.test.default:
> > 
> > cor.pval <- function(x, alternative="two-sided", ...) {
> > corMat <- cor(x, ...)
> > n <- nrow(x)
> > df <- n - 2
> > STATISTIC <- sqrt(df) * corMat / sqrt(1 - corMat^2)
> > p <- pt(STATISTIC, df)
> > p <- if (alternative == "less") {
> > p
> > } else if (alternative == "greater") {
> > 1 - p
> > } else 2 * pmin(p, 1 - p)
> > p
> > }
> > 
> > The test:
> > 
> > > system.time(c1 <- cor.pvals(X), gcFirst=TRUE)
> > [1] 13.19 0.01 13.58 NA NA
> > > system.time(c2 <- cor.pvalues(X), gcFirst=TRUE)
> > [1] 6.22 0.00 6.42 NA NA
> > > system.time(c3 <- cor.pval(X), gcFirst=TRUE)
> > [1] 0.07 0.00 0.07 NA NA
> > 
> > Cheers,
> > Andy
> > 
> > > From: John Fox
> > > 
> > > Dear Mark,
> > > 
> > > I think that the reflex of trying to avoid loops in R is often 
> > > mistaken, and so I decided to try to time the two 
> approaches (on a 
> > > 3GHz Windows XP system).
> > > 
> > > I discovered, first, that there is a bug in your function -- you 
> > > appear to have indexed rows instead of columns; fixing that:
> > > 
> > > cor.pvals <- function(mat)
> > > {
> > > cols <- expand.grid(1:ncol(mat), 1:ncol(mat))
> > > matrix(apply(cols, 1,
> > > function(x) cor.test(mat[, x[1]], mat[, 
> > > x[2]])$p.value),
> > > ncol = ncol(mat))
> > > }
> > > 
> > > 
> > > My function is cor.pvalues and yours cor.pvals. This is 
> for a data 
> > > matrix with 1000 observations on 100 variables:
> > > 
> > > > R <- diag(100)
> > > > R[upper.tri(R)] <- R[lower.tri(R)] <- .5
> > > > library(mvtnorm)
> > > > X <- rmvnorm(1000, sigma=R)
> > > > dim(X)
> > > [1] 1000 100
> > > > 
> > > > system.time(cor.pvalues(X))
> > > [1] 5.53 0.00 5.53 NA NA
> > > > 
> > > > system.time(cor.pvals(X))
> > > [1] 12.66 0.00 12.66 NA NA
> > > > 
> > > 
> > > I frankly didn't expect the advantage of my approach to be 
> > this large, 
> > > but there it is.
> > > 
> > > Regards,
> > > John
> > > 
> > > 
> > > John Fox
> > > Department of Sociology
> > > McMaster University
> > > Hamilton, Ontario
> > > Canada L8S 4M4
> > > 905-525-9140x23604
> > > http://socserv.mcmaster.ca/jfox
> > > 
> > > 
> > > > -Original Message-
> > > > From: Marc Schwartz [mailto:[EMAIL PROTECTED]
> > > > Sent: Friday, April 15, 2005 7:08 PM
> > > > To: John Fox
> > > > Cc: 'Dren Scott'; R-Help
> > > > Subject: RE: [R] Pearson corelation and p-value for matrix
> > > > 
> > > > Here is what might be a slightly more efficient way to 
> > get to John's
> > > > question:
> > > > 
> > > > cor.pvals <- function(mat)
> > > > {
> > > > rows <- expand.grid(1:nrow(mat), 1:nrow(mat))
> > > > matrix(apply(rows, 1,
> > > > function(x) cor.test(mat[x[1], ], mat[x[2], 
> > > > ])$p.value),
> > > > ncol = nrow(mat))
> > > > }
> > > > 
> > > > HTH,
> > > > 
> > > > Marc Schwartz
> > > > 
> > > > On Fri, 2005-04-15 at 18:26 -0400, John Fox wrote:
> > > > > Dear Dren,
> > > > > 
> > > > > How about the following?
> > > > > 
> > > > > cor.pvalues <- function(X){
> > > > > nc <- ncol(X)
> > > > > res <- m

Re: [R] Very Slow Gower Similarity Function

2005-04-18 Thread Anon.
Jari Oksanen wrote:
On 18 Apr 2005, at 19:10, Tyler Smith wrote:
Hello,
I am a relatively new user of R. I have written a basic function to 
calculate
the Gower similarity function. I was motivated to do so partly as an 
excercise
in learning R, and partly because the existing option (vegdist in the 
vegan
package) does not accept missing values.

Speed is the reason to use C instead of R. It should be easy, almost 
trivial, to modify the vegdist.c  so that it handles missing values. I 
guess this handling means ignoring the value pair if one of the values 
is missing -- which is not so gentle to the metric properties so dear 
to Gower. Package vegan is designed for ecological community data 
which generally do not have missing values (except in environmental 
data), but contributions are welcome.

The only reason you never see ecological community data with missing 
values is because the ecologists remove those species/sites from their 
Excel sheets before they give it to you to sort out their mess.  This is 
actually one of the few things they know how to do in Excel - I'm 
dreading the day when a paper appears in JAE saying that you can use 
Excel to produce P-values.

To be slightly more serious, as an exercise the OP could consider 
writing a wrapper function in R that removes the missing data and then 
calls vegdist to calculate his Gower similarity index.

Bob
--
Bob O'Hara
Department of Mathematics and Statistics
P.O. Box 68 (Gustaf Hällströmin katu 2b)
FIN-00014 University of Helsinki
Finland
Telephone: +358-9-191 51479
Mobile: +358 50 599 0540
Fax:  +358-9-191 51400
WWW:  http://www.RNI.Helsinki.FI/~boh/
Journal of Negative Results - EEB: www.jnr-eeb.org
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


RE: [R] Storing vectors as vectors and iterating through them

2005-04-18 Thread Wiener, Matthew
Ken -- try using lists:

> vec.list <- list(1:5, 2:4, 3:8)
> vec.list <- c(vec.list, list(7:9))
> vec.list
[[1]]
[1] 1 2 3 4 5

[[2]]
[1] 2 3 4

[[3]]
[1] 3 4 5 6 7 8

[[4]]
[1] 7 8 9

Then you can use "lapply" or "sapply", or just a "for" loop, to iterate over
the list, applying your function to each element.

Hope this helps,

Matt Wiener

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ken Termiso
Sent: Monday, April 18, 2005 1:09 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Storing vectors as vectors and iterating through them


Hi all,

I have a bunch of int vectors. Each vector holds a bunch of ints that 
correspond to row numbers of an existing matrix. I use the int vectors to 
pull out rows of data from a matrix, i.e.

data <- my_matrix[int_vector,]

I would like to store these int vectors in some sort of data structure that 
will preserve them as-is and allow iteration. I guess what I'm looking for 
would be something analogous to the java Vector class, as in this java-like 
pseudocode :

Vector V = new Vector;
V.add(a,b,c) // where a,b,c are lists

for(int i = 0; ihttps://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

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


[R] Storing vectors as vectors and iterating through them

2005-04-18 Thread Ken Termiso
Hi all,
I have a bunch of int vectors. Each vector holds a bunch of ints that 
correspond to row numbers of an existing matrix. I use the int vectors to 
pull out rows of data from a matrix, i.e.

data <- my_matrix[int_vector,]
I would like to store these int vectors in some sort of data structure that 
will preserve them as-is and allow iteration. I guess what I'm looking for 
would be something analogous to the java Vector class, as in this java-like 
pseudocode :

Vector V = new Vector;
V.add(a,b,c) // where a,b,c are lists
for(int i = 0; i
The point is to iterate through the data structure containing the int 
vectors, and, for each int vector, do some clustering and plotting, but what 
I cannot find is a data structure in R that would support this.. trying 
c(a,b,c) does not preserve each int vector, but instead merges all the ints 
into one vector. I need to keep them separate (so I can create a separate 
plot for each vector).

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


Re: [R] refitting lm() with same x, different y

2005-04-18 Thread Prof Brian Ripley
William,
As a first shot, use lm with a matrix response.  That fits them all at 
once with one QR-decomposition.  No analogue for glm or lmer, though, 
since for those the iterative fits run do depend on the response.

Brian
On Mon, 18 Apr 2005, William Valdar wrote:
Dear All,
Is there is a fast way of refitting lm() when the design matrix stays 
constant but the response is different? For example,

y1 ~ X
y2 ~ X
y3 ~ X
...etc.
where y1 is the 1st instance of the response vector. Calling lm() every time 
seems rather wasteful since the QR-decomposition of X needs to be calculated 
only once. It would be nice if qr() was called only once and then the same 
QR-factorization used in all subsequent fits. However, I can't see a way to 
do this easily. Can anybody else?

Why do I want to do this? I'm fitting ~1000 different X's to a response 
vector (for biologists: 1000 genetic markers to a measured phenotype with 
2000 cases) and wish to establish global significance thresholds for multiple 
testing. The fits have a complex dependency structure that makes the 
Bonferroni correction inappropriate. So I intend to refit all ~1000 X's with 
a shuffled response many times. However, this runs too slow for my needs.

Of course, not having to redo QR will only help if QR is a rate limiting step 
in lm(), so if anybody can tell me it's not, then that would be very helpful 
too. I would also like to do this for glm() and lmer() fits. Ideally.
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Very Slow Gower Similarity Function

2005-04-18 Thread Jari Oksanen
On 18 Apr 2005, at 19:10, Tyler Smith wrote:
Hello,
I am a relatively new user of R. I have written a basic function to 
calculate
the Gower similarity function. I was motivated to do so partly as an 
excercise
in learning R, and partly because the existing option (vegdist in the 
vegan
package) does not accept missing values.

Speed is the reason to use C instead of R. It should be easy, almost 
trivial, to modify the vegdist.c  so that it handles missing values. I 
guess this handling means ignoring the value pair if one of the values 
is missing -- which is not so gentle to the metric properties so dear 
to Gower. Package vegan is designed for ecological community data which 
generally do not have missing values (except in environmental data), 
but contributions are welcome.

I think I have succeeded - my function gives me the correct values. 
However, now
that I'm starting to use it with real data, I realise it's very slow. 
It takes
more than 45 minutes on my Windows 98 machine (R 2.0.1 Patched 
(2005-03-29))
with a 185x32 matrix with ca 100 missing values. If anyone can suggest 
ways to
speed up my function I would appreciate it. I suspect having a pair of 
nested
for loops is the problem, but I couldn't figure out how to get rid of 
them.
cheers, jari oksanen
--
Jari Oksanen, Oulu, Finland
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] colClasses = "Date" in read.delim, how to pass date-format?

2005-04-18 Thread Prof Brian Ripley
You are confusing class "Date" (part of R) with class "dates" (part of 
package chron).  There is no as() method for class "dates", so you can't 
do this.  You can read the column as character (not factor) and convert 
later, but it sounds like the `huge amount of memory (and time)' is in 
fact taken by package chron.

On Mon, 18 Apr 2005, Christoph Lehmann wrote:
I have a huge data-set with one column being of type date.
Of course I can import the data using this column as "factor" and then 
convert it later to dates, using:

sws.bezuege$FaktDat <- dates(as.character(sws.bezuege$FaktDat),
format = c(dates = "d.m.y"))
But the conversion requires a huge amount of memory (and time), therefore I 
would like to use colClasses = c("Date"). My question is:
since I have format  = c(dates = "d.m.y"), how can I pass this option to 
read.delim(..., colClasses = c("Date")) ?
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] a small problem with data

2005-04-18 Thread Douglas Bates
Yoko Nakajima wrote:
Hello,
I have a strange problem. I may have specified and scanned the data
set (I receive a message: Read 384134 items). I can check the
dimension of the data set by dim(xyz). But when I try to load the
data set or to list the data set by data(xyz), then I receive an
error message saying that data set not found in: data(xyz). Is this
possible, or is this because I deal with a large data set (dimension
is 13246 x 29). I can not run any package with this data set. I am
guessing that this is because of the same reason that I can not
load/list the data set.  Are reading data and loading data are
different? I am very puzzled.
The data function is used to load data sets from a package (and is not 
even needed for that any more if the package uses LazyData).

You do not need to use data(xyz) before using the name xyz.
To check the names of the objects currently in your worksheet use
objects()
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Latent Class Analyisis in R

2005-04-18 Thread Tim F Liao
Helen,

You may consider using LCA 1.1, written by Niels Waller at
Vanderbilt University.  You may need to get it from his
website at Vanderbilt instead of CRAN, at least it was the
case in the past.

Tim Liao

 Original message 
>Date: Mon, 18 Apr 2005 12:29:41 -0400
>From: "Dennis, Helen" <[EMAIL PROTECTED]>  
>Subject: [R] Latent Class Analyisis in R  
>To: 
>
>Hi,
>
>I am new to R. I would like to know if there is a package
available that
>will estimate a 2-class Latent Class Analysis, with trichotomous
>observed variables, some of which are free to covary.  
>
>I have read the PDF files regarding the e1071 and gllm
packages, but it
>appears that these only allow dichotomous measured variables,
and it is
>not clear to me whether they allow the measured variables to
covary.
>
>Thanks!
>
>Helen Dennis
>Education Associate
>Assessment and Analysis Group
>Delaware Dept. of Education
>401 Federal Street
>Suite 2
>Dover, DE 19707
>[EMAIL PROTECTED]
>tel: 302-739-6700
>fax: 302-739-3092
>
>__
>R-help@stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

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


[R] Retrieving column descriptions into Stata

2005-04-18 Thread AJ Bostian
Dear All,
I am working on a project with Stata 7 datafiles.  I'm trying to do some 
of my analysis in R since I don't have Stata handy.  My problem is with 
accessing the Stata column descriptions.  (Part of the project is to 
clean up these column descriptions.)

I imported the Stata files ok using the standard
X <- read.dta("c:/testdata/test1.dta")
test1.dta has column descriptions, but I can't figure out where they are 
kept in X.  (I assume they are in X somewhere; at least this is what the 
docs seem to imply.)  I see variable names in X, but no descriptions.

As a reverse test, I created a short dataset in R (the numbers 1-100), 
exported it to Stata format, and opened it in Stata.  I was expecting 
the column description to be null, but the column description was 
populated with the variable name.  So it appears that the export program 
knows how to set column descriptions.  I just need to figure out what 
attributes I need to check/set to make it do so.

Any suggestions would be much appreciated.
Regards,
AJ Bostian
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Latent Class Analyisis in R

2005-04-18 Thread Dennis, Helen
Hi,

I am new to R. I would like to know if there is a package available that
will estimate a 2-class Latent Class Analysis, with trichotomous
observed variables, some of which are free to covary.  

I have read the PDF files regarding the e1071 and gllm packages, but it
appears that these only allow dichotomous measured variables, and it is
not clear to me whether they allow the measured variables to covary.

Thanks!

Helen Dennis
Education Associate
Assessment and Analysis Group
Delaware Dept. of Education
401 Federal Street
Suite 2
Dover, DE 19707
[EMAIL PROTECTED]
tel: 302-739-6700
fax: 302-739-3092

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


RE: [R] Creating packages with windows (accessing data)

2005-04-18 Thread Alan T. Arnholt
Thank you,

The DESCRIPTION is what I needed...all works as I want now.

Alan-

Alan T. Arnholt
Associate Professor
Department of Mathematical Sciences
Appalachian State University
Boone, NC 28608
(828) 262 2863
www1.appstate.edu/~arnholta
 

-Original Message-
From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] 
Sent: Sunday, April 17, 2005 10:24 AM
To: Alan Arnholt
Cc: r-help@stat.math.ethz.ch; [EMAIL PROTECTED]
Subject: Re: [R] Creating packages with windows (accessing data)

Look at `Writing R Extensions' and the description of the DESCRIPTION 
file, specifically `LazyData'.

That is the manual about packages 

On Sun, 17 Apr 2005, Alan Arnholt wrote:

> I have created a package (under Windows 2.0.1) with 300+ data sets and <20
> or so functions I use in teaching.  However, to access the data, one needs
> to type data(foo) once the package has been installed and loaded.  With
> other packages namely MASS, after the package is installed and loaded with
> library(MASS), it is possible to refer to a data set say Animals by simply
> typing Animals at the command prompt.  I would like to have similar
> functionality in my package.  Would someone provide some hints as to what
> I need to do (read about xxx...or provide a line of code) so that the data
> in the package can be accessed once it is loaded without typing data(foo)
> all the time.  Currently, when I type the name of a function it shows the
> code for the function.  I would like it to also show the data when I type
> the name of any of the data sets.  Thanks for the pointers in advance.

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

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


[R] Very Slow Gower Similarity Function

2005-04-18 Thread Tyler Smith
Hello,

I am a relatively new user of R. I have written a basic function to calculate
the Gower similarity function. I was motivated to do so partly as an excercise
in learning R, and partly because the existing option (vegdist in the vegan
package) does not accept missing values.

I think I have succeeded - my function gives me the correct values. However, now
that I'm starting to use it with real data, I realise it's very slow. It takes
more than 45 minutes on my Windows 98 machine (R 2.0.1 Patched (2005-03-29))
with a 185x32 matrix with ca 100 missing values. If anyone can suggest ways to
speed up my function I would appreciate it. I suspect having a pair of nested
for loops is the problem, but I couldn't figure out how to get rid of them.

The function is:

### Gower Similarity Matrix###

sGow <- function (mat){

OBJ <- nrow(mat) #number of objects
MATDESC <- ncol (mat) #number of descriptors
MRANGE <- apply (mat,2,max, na.rm=T)-apply (mat,2,min,na.rm=T) #descr ranges
DESCRIPT <- 1:MATDESC #descriptor index vector
smat <- matrix(1, nrow = OBJ, ncol = OBJ) #'empty' similarity matrix

for (i in 1:OBJ){
  for (j in i:OBJ){

##calculate index vector of non-NA descriptors between objects i and j
descvect <- intersect (setdiff (DESCRIPT, DESCRIPT[is.na(mat[i,DESCRIPT])]),
 setdiff (DESCRIPT, DESCRIPT[is.na (mat[j,DESCRIPT])]))

descnum <- length(descvect) # number of valid descr for i~j comparison

partialsim <- (1- abs(mat[i,descvect]-mat[j,descvect])/MRANGE[descvect])

smat[i,j] <- smat[j,i] <- sum (partialsim) / descnum
  }
}
smat
}

Thank-you for your time,

Tyler

-- 
Tyler Smith

PhD Candidate
Plant Science Department
McGill University

[EMAIL PROTECTED]

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


Re: [R] Barplot and colors for legend

2005-04-18 Thread Werner Wernersen
>>>Hi all!
>>>
>>>One quick question: How do I get the standard
colors
>>>used by barplot? I have 
>>>some stacked bars and would like to add a
horizontal
>>>legend via legend() but I 
>>>don't know how to find the colors for the fills of
the
>>>legend points.
>>>
>>>Thanks!
>>>   Werner
>>
>>
>>Type
>>   barplot.default
>>and read the code:
>>
>>for a vector: "grey",
>>for a matrix: grey(seq(0.3^2.2, 0.9^2.2, length =
>>nrow(height))^(1/2.2))
> 
> 
> This must be an old version of R ;-)
> 
> In R 2.1.0, there is a function gray.colors() which
creates a vector of
> gamma-corrected gray colors (and is used in
barplot.default).
> 
> Best,
> Z

Thanks for the quick help!

I am using R 2.0.1 under Windows 2000 and Uwes
suggestion helps.
And another thanks: Finally I realized that I don't
have the newest R version!

Thanks again,
   Werner

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


[R] Install problem on Solaris 9

2005-04-18 Thread Shields, Rusty (IMS)
I'm trying to install R-2.0.1 on Solaris 9 and I'm receiving the
following error messages during make.
 
begin installing recommended package foreign
make[2]: *** [foreign.ts] Error 1
make[2]: Leaving directory
`/opt/net/source/R-2.0.1/src/library/Recommended'
make[1]: *** [recommended-packages] Error 2
make[1]: Leaving directory
`/opt/net/source/R-2.0.1/src/library/Recommended'
make: *** [stamp-recommended] Error 2

 
A review of src/library/Recommended/foreign.ts.out shows:
 
* Installing *source* package 'foreign' ...
configure: loading cache /dev/null
checking for gcc... make[3]: Entering directory
`/tmp/R.INSTALL.169/foreign'
gcc -m64
make[3]: Leaving directory `/tmp/R.INSTALL.169/foreign'
checking for C compiler default output file name... configure:
error: C compiler cannot create executables
See `config.log' for more details.
ERROR: configuration failed for package 'foreign'

 
A review of config.log does not reveal anything terribly useful.
 
I'm using gcc, g77, and g++ v3.4.1, 32 bit builds (I think), all
installed under /opt/net/utils/gcc3.4.1, which is in the path.
 
LD_LIBRARY_PATH=/otherstuff:/opt/net/utils/gcc3.4.1/lib:/opt/net/utils/l
ib:/otherstuff
 
My config.site contains:

CC="gcc"
CPPFLAGS="-I/usr/include"
F77="g77"
LDFLAGS="-L/opt/net/utils/gcc3.4.1/lib/"
CXX="g++"
 
 
What should I be looking for here?
 
Thanks.
 
Rusty

[[alternative HTML version deleted]]

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


[R] a small problem with data

2005-04-18 Thread Yoko Nakajima
Hello,

I have a strange problem. I may have specified and scanned the data set (I 
receive a message: Read 384134 items). I can check the dimension of the data 
set by dim(xyz). But when I try to load the data set or to list the data set by 
data(xyz), then I receive an error message saying that data set not found in: 
data(xyz). Is this possible, or is this because I deal with a large data set 
(dimension is 13246 x 29). I can not run any package with this data set. I am 
guessing that this is because of the same reason that I can not load/list the 
data set.  Are reading data and loading data are different? I am very puzzled.

Sincerely,
Yoko.






[[alternative HTML version deleted]]

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


Re: [R] R2.0.1 for Mac OS X 10.3 problem

2005-04-18 Thread Jari Oksanen
On Mon, 2005-04-18 at 06:39 -0700, Horacio Montenegro wrote:
>  I have the same problem, in Windows, and I think
> the .Rdata is not corrupted. Load R without loading
> the.Rdata file - move or rename it. Then library(lme4)
> and load the .Rdata - it should work.
> 
This also is my experience (in Linux & MacOS X). The .RData need not be
corrupted, but you have "corrupted" your R installation by deleting or
corrupting some package using S4 methods (like failed upgrade of a S4
method package). When you start R so that it tries to restore those S4
objects in .RData, you get the error. Renaming or deleting .RData will
help, of course. Alternatively, in my case it helped to start R with
option --no-restore-data (in Mac when starting R from terminal -- where
you are all the time in Linux). Probably it would help to install again
the original S4 package. (In my case this happened when I tried Thomas
Yee's VGAM and then removed the package.)

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

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


[R] refitting lm() with same x, different y

2005-04-18 Thread William Valdar
Dear All,
Is there is a fast way of refitting lm() when the design matrix stays constant 
but the response is different? For example,

y1 ~ X
y2 ~ X
y3 ~ X
...etc.
where y1 is the 1st instance of the response vector. Calling lm() every 
time seems rather wasteful since the QR-decomposition of X needs to be 
calculated only once. It would be nice if qr() was called only once and 
then the same QR-factorization used in all subsequent fits. However, I 
can't see a way to do this easily. Can anybody else?

Why do I want to do this? I'm fitting ~1000 different X's to a response 
vector (for biologists: 1000 genetic markers to a measured phenotype with 
2000 cases) and wish to establish global significance thresholds for 
multiple testing. The fits have a complex dependency structure that makes 
the Bonferroni correction inappropriate. So I intend to refit all ~1000 
X's with a shuffled response many times. However, this runs too slow for 
my needs.

Of course, not having to redo QR will only help if QR is a rate limiting 
step in lm(), so if anybody can tell me it's not, then that would be very 
helpful too. I would also like to do this for glm() and lmer() fits. 
Ideally.

Many thanks,
William
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Dr William Valdar   ++44 (0)1865 287 717
Wellcome Trust Centre   [EMAIL PROTECTED]
for Human Genetics, Oxford  www.well.ox.ac.uk/~valdar
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] colClasses = "Date" in read.delim, how to pass date-format?

2005-04-18 Thread Gabor Grothendieck
On 4/18/05, Christoph Lehmann <[EMAIL PROTECTED]> wrote:
> Hi
> I have a huge data-set with one column being of type date.
> Of course I can import the data using this column as "factor" and then
> convert it later to dates, using:
> 
> sws.bezuege$FaktDat <- dates(as.character(sws.bezuege$FaktDat),
>  format = c(dates = "d.m.y"))
> 
> But the conversion requires a huge amount of memory (and time),
> therefore I would like to use colClasses = c("Date"). My question is:
> since I have format  = c(dates = "d.m.y"), how can I pass this option to
> read.delim(..., colClasses = c("Date")) ?
> 

Check out:

http://tolstoy.newcastle.edu.au/R/help/05/02/12003.html

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


Re: [R] the graph gallery strikes back

2005-04-18 Thread Romain Francois
Gabor,
I was obviously kidding. Do you really think I would build a gallery for 
R without knowing its website. I spend a lot of time around 
http://www.r-project.org/  
The link has been added on the minute after i did read your mail.

Romain.
Le 18.04.2005 16:54, Gabor Grothendieck a écrit :
Its the R home page. I think the graph gallery might be used to
direct people to R before they have used it since its quite attractive.
At that point they will want to know how to get to the rest of R.
On 4/18/05, Romain Francois <[EMAIL PROTECTED]> wrote:
 

Hi,
I don't know about that web page, what is it ?
Romain
Le 18.04.2005 16:33, Gabor Grothendieck a écrit :
   

Just one suggestion.  Maybe you could provide on a link on that
page to http://www.r-project.org .
On 4/18/05, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
 

Yes, it works for me now.  Thanks.  Very impressive I might add.
On 4/18/05, Romain Francois <[EMAIL PROTECTED]> wrote:
   

Oops :)
That should be allright now.
Romain
Le 18.04.2005 13:52, Naji a écrit :

 

Hi Romain,
Great job.. Thanks a lot.
When pointing at the graph or the link (ie Kernel density estimator in R²,
Perspective plot and contour plot, etc) the browser is sending back a SQL
error (Safari, MacOSX3.8)
Erreur SQL!
Unknown column 'qualification' in 'field list'
Best regards
Naji
Le 18/04/05 11:29, « Romain Francois » <[EMAIL PROTECTED]> a écrit :


   

Hello useRs and helpRs,
Some time ago, in a gallaxy far away (here is the thread :
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46532.html ) we
discussed about a graph gallery showing the power of R in that domain. I
did some work around that, and there is a (pretty advanced) draft here :
http://addictedtor.free.fr/graphiques/displayGallery.php
For instance, there are some of my graphs, some of Eric Lecoutre's and
some coming from demo(graphics), demo(image), demo(persp) and so on.
Pretty soon, I'll add the possibility to  :
- add graphs dynamically from the web
- give a mark to each graph (maybe we can do some stats :) )
- link R function to their help pages from http://finzi.psych.upenn.edu/R
- add references to publications
-  whatever
Please take a look and tell me what should be improved. May the foRce be
with you.
Romain.
PS1 : Regarding graphs from demo(*), I wrote that author is R
Development Core Team, maybe those were done by a precise person in the
Core, in that case tell me and I'll change it.
PS2 : Source code highlighting was done by the highlight software  : (
http://www.andre-simon.de/ ) suggested to me by Eric Lecoutre.
 

--
 ~ 
~~  Romain FRANCOIS - http://addictedtor.free.fr ~~
Etudiant  ISUP - CS3 - Industrie et Services   
~~http://www.isup.cicrp.jussieu.fr/  ~~
   Stagiaire INRIA Futurs - Equipe SELECT  
~~   http://www.inria.fr/recherche/equipes/select.fr.html~~
 ~ 
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] generalized linear mixed models - how to compare?

2005-04-18 Thread Spencer Graves
No puedo entender.  Nicht versteh. Je ne comprend pas. 

Peter Spreeuwenberg wrote:
 Liset
Dat moet lukken en hoe sneller je het anlevert hoe eerder je resultaten terug 
ziet.
Dus, Ik wacht af.
groet Peter S

Date sent:  Sun, 17 Apr 2005 18:07:28 +0100 (BST)
From:   Prof Brian Ripley <[EMAIL PROTECTED]>
To: Deepayan Sarkar <[EMAIL PROTECTED]>
Subject:Re: [R] generalized linear mixed models - how to 
compare?
Copies to:  r-help@stat.math.ethz.ch,
Nestor Fernandez <[EMAIL PROTECTED]>
 

On Sun, 17 Apr 2005, Deepayan Sarkar wrote:
   

On Sunday 17 April 2005 08:39, Nestor Fernandez wrote:
 

I want to evaluate several generalized linear mixed models, including
the null model, and select the best approximating one. I have tried
glmmPQL (MASS library) and GLMM (lme4) to fit the models. Both result
in similar parameter estimates but fairly different likelihood
estimates.
My questions:
1- Is it correct to calculate AIC for comparing my models, given that
they use quasi-likelihood estimates? If not, how can I compare them?
2- Why the large differences in likelihood estimates between the two
procedures?
   

The likelihood reported by glmmPQL is wrong, as it's the likelihood of
an incorrect model (namely, an lme model that approximates the correct
glmm model).
 

Actually glmmPQL does not report a likelihood.  It returns an object of 
class "lme", but you need to refer to the reference for how to interpret 
that.  It *is* support software for a book.

   

GLMM uses (mostly) the same procedure to get parameter estimates, but as 
a final step calculates the likelihood for the correct model for those 
estimates (so the likelihood reported by it should be fairly reliable).
 

Well, perhaps but I need more convincing.  The likelihood involves many 
high-dimensional non-analytic integrations, so I do not see how GLMM can 
do those integrals -- it might approximate them, but that would not be 
`calculates the likelihood for the correct model'.  It would be helpful to 
have a clarification of this claim.  (Our experiments show that finding an 
accurate value of the log-likelihood is difficult and many available 
pieces of software differ in their values by large amounts.)

Further, since neither procedure does ML fitting, this is not a maximized 
likelihood as required to calculate an AIC value.  And even if it were, 
you need to be careful as often one GLMM is a boundary value for another, 
in which case the theory behind AIC needs adjustment.

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

Stichting NIVEL / NETHERLANDS INSTITUTE OF PRIMARY HEALTH CARE
Peter Spreeuwenberg
P.O. Box 1568
3500  BN Utrecht
Netherland
E-mail   : [EMAIL PROTECTED]
Direct: +31-30-2729678
General   : +31-30-2729700
Fax   : +31-30-2729729
Web-site  http://www.nivel.nl 

DISCLAIMER__
This message contains information that may be privileged or\...{{dropped}}
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

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


[R] colClasses = "Date" in read.delim, how to pass date-format?

2005-04-18 Thread Christoph Lehmann
Hi
I have a huge data-set with one column being of type date.
Of course I can import the data using this column as "factor" and then 
convert it later to dates, using:

sws.bezuege$FaktDat <- dates(as.character(sws.bezuege$FaktDat),
 format = c(dates = "d.m.y"))
But the conversion requires a huge amount of memory (and time), 
therefore I would like to use colClasses = c("Date"). My question is:
since I have format  = c(dates = "d.m.y"), how can I pass this option to 
read.delim(..., colClasses = c("Date")) ?

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


Re: [R] Barplot and colors for legend

2005-04-18 Thread Achim Zeileis
On Mon, 18 Apr 2005 16:48:42 +0200 Uwe Ligges wrote:

> Werner Wernersen wrote:
> 
> > Hi all!
> > 
> > One quick question: How do I get the standard colors
> > used by barplot? I have 
> > some stacked bars and would like to add a horizontal
> > legend via legend() but I 
> > don't know how to find the colors for the fills of the
> > legend points.
> > 
> > Thanks!
> >Werner
> 
> 
> Type
>barplot.default
> and read the code:
> 
> for a vector: "grey",
> for a matrix: grey(seq(0.3^2.2, 0.9^2.2, length =
> nrow(height))^(1/2.2))

This must be an old version of R ;-)

In R 2.1.0, there is a function gray.colors() which creates a vector of
gamma-corrected gray colors (and is used in barplot.default).

Best,
Z

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

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


Re: [R] the graph gallery strikes back

2005-04-18 Thread Gabor Grothendieck
Its the R home page. I think the graph gallery might be used to
direct people to R before they have used it since its quite attractive.
At that point they will want to know how to get to the rest of R.

On 4/18/05, Romain Francois <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I don't know about that web page, what is it ?
> 
> Romain
> 
> Le 18.04.2005 16:33, Gabor Grothendieck a écrit :
> 
> >Just one suggestion.  Maybe you could provide on a link on that
> >page to http://www.r-project.org .
> >
> >On 4/18/05, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
> >
> >
> >>Yes, it works for me now.  Thanks.  Very impressive I might add.
> >>
> >>On 4/18/05, Romain Francois <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >>>Oops :)
> >>>
> >>>That should be allright now.
> >>>
> >>>Romain
> >>>
> >>>Le 18.04.2005 13:52, Naji a écrit :
> >>>
> >>>
> >>>
> Hi Romain,
> 
> 
> Great job.. Thanks a lot.
> When pointing at the graph or the link (ie Kernel density estimator in R²,
> Perspective plot and contour plot, etc) the browser is sending back a SQL
> error (Safari, MacOSX3.8)
> 
> Erreur SQL!
> Unknown column 'qualification' in 'field list'
> 
> Best regards
> Naji
> 
> 
> Le 18/04/05 11:29, « Romain Francois » <[EMAIL PROTECTED]> a écrit :
> 
> 
> 
> 
> 
> >Hello useRs and helpRs,
> >
> >Some time ago, in a gallaxy far away (here is the thread :
> >http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46532.html ) we
> >discussed about a graph gallery showing the power of R in that domain. I
> >did some work around that, and there is a (pretty advanced) draft here :
> >
> >http://addictedtor.free.fr/graphiques/displayGallery.php
> >
> >For instance, there are some of my graphs, some of Eric Lecoutre's and
> >some coming from demo(graphics), demo(image), demo(persp) and so on.
> >
> >Pretty soon, I'll add the possibility to  :
> >- add graphs dynamically from the web
> >- give a mark to each graph (maybe we can do some stats :) )
> >- link R function to their help pages from http://finzi.psych.upenn.edu/R
> >- add references to publications
> >-  whatever
> >
> >Please take a look and tell me what should be improved. May the foRce be
> >with you.
> >
> >Romain.
> >
> >PS1 : Regarding graphs from demo(*), I wrote that author is R
> >Development Core Team, maybe those were done by a precise person in the
> >Core, in that case tell me and I'll change it.
> >
> >PS2 : Source code highlighting was done by the highlight software  : (
> >http://www.andre-simon.de/ ) suggested to me by Eric Lecoutre.
> >
> >
> >
> >
> >
> >
> >
> 
> --
>  ~ 
> ~~  Romain FRANCOIS - http://addictedtor.free.fr ~~
> Etudiant  ISUP - CS3 - Industrie et Services   
> ~~http://www.isup.cicrp.jussieu.fr/  ~~
>    Stagiaire INRIA Futurs - Equipe SELECT  
> ~~   http://www.inria.fr/recherche/equipes/select.fr.html~~
>  ~ 
> 
>

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


Re: [R] the graph gallery strikes back

2005-04-18 Thread Romain Francois
Hi,
I don't know about that web page, what is it ?
Romain
Le 18.04.2005 16:33, Gabor Grothendieck a écrit :
Just one suggestion.  Maybe you could provide on a link on that
page to http://www.r-project.org .
On 4/18/05, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
 

Yes, it works for me now.  Thanks.  Very impressive I might add.
On 4/18/05, Romain Francois <[EMAIL PROTECTED]> wrote:
   

Oops :)
That should be allright now.
Romain
Le 18.04.2005 13:52, Naji a écrit :
 

Hi Romain,
Great job.. Thanks a lot.
When pointing at the graph or the link (ie Kernel density estimator in R²,
Perspective plot and contour plot, etc) the browser is sending back a SQL
error (Safari, MacOSX3.8)
Erreur SQL!
Unknown column 'qualification' in 'field list'
Best regards
Naji
Le 18/04/05 11:29, « Romain Francois » <[EMAIL PROTECTED]> a écrit :

   

Hello useRs and helpRs,
Some time ago, in a gallaxy far away (here is the thread :
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46532.html ) we
discussed about a graph gallery showing the power of R in that domain. I
did some work around that, and there is a (pretty advanced) draft here :
http://addictedtor.free.fr/graphiques/displayGallery.php
For instance, there are some of my graphs, some of Eric Lecoutre's and
some coming from demo(graphics), demo(image), demo(persp) and so on.
Pretty soon, I'll add the possibility to  :
- add graphs dynamically from the web
- give a mark to each graph (maybe we can do some stats :) )
- link R function to their help pages from http://finzi.psych.upenn.edu/R
- add references to publications
-  whatever
Please take a look and tell me what should be improved. May the foRce be
with you.
Romain.
PS1 : Regarding graphs from demo(*), I wrote that author is R
Development Core Team, maybe those were done by a precise person in the
Core, in that case tell me and I'll change it.
PS2 : Source code highlighting was done by the highlight software  : (
http://www.andre-simon.de/ ) suggested to me by Eric Lecoutre.

 

 


--
 ~ 
~~  Romain FRANCOIS - http://addictedtor.free.fr ~~
Etudiant  ISUP - CS3 - Industrie et Services   
~~http://www.isup.cicrp.jussieu.fr/  ~~
   Stagiaire INRIA Futurs - Equipe SELECT  
~~   http://www.inria.fr/recherche/equipes/select.fr.html~~
 ~ 
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Barplot and colors for legend

2005-04-18 Thread Uwe Ligges
Werner Wernersen wrote:
Hi all!
One quick question: How do I get the standard colors
used by barplot? I have 
some stacked bars and would like to add a horizontal
legend via legend() but I 
don't know how to find the colors for the fills of the
legend points.

Thanks!
   Werner

Type
  barplot.default
and read the code:
for a vector: "grey",
for a matrix: grey(seq(0.3^2.2, 0.9^2.2, length = nrow(height))^(1/2.2))
Uwe Ligges
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Barplot and colors for legend

2005-04-18 Thread Werner Wernersen
Hi all!

One quick question: How do I get the standard colors
used by barplot? I have 
some stacked bars and would like to add a horizontal
legend via legend() but I 
don't know how to find the colors for the fills of the
legend points.

Thanks!
   Werner

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


Re: [R] the graph gallery strikes back

2005-04-18 Thread Gabor Grothendieck
Just one suggestion.  Maybe you could provide on a link on that
page to http://www.r-project.org .

On 4/18/05, Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
> Yes, it works for me now.  Thanks.  Very impressive I might add.
> 
> On 4/18/05, Romain Francois <[EMAIL PROTECTED]> wrote:
> > Oops :)
> >
> > That should be allright now.
> >
> > Romain
> >
> > Le 18.04.2005 13:52, Naji a écrit :
> >
> > >Hi Romain,
> > >
> > >
> > >Great job.. Thanks a lot.
> > >When pointing at the graph or the link (ie Kernel density estimator in R²,
> > >Perspective plot and contour plot, etc) the browser is sending back a SQL
> > >error (Safari, MacOSX3.8)
> > >
> > >Erreur SQL!
> > >Unknown column 'qualification' in 'field list'
> > >
> > >Best regards
> > >Naji
> > >
> > >
> > >Le 18/04/05 11:29, « Romain Francois » <[EMAIL PROTECTED]> a écrit :
> > >
> > >
> > >
> > >>Hello useRs and helpRs,
> > >>
> > >>Some time ago, in a gallaxy far away (here is the thread :
> > >>http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46532.html ) we
> > >>discussed about a graph gallery showing the power of R in that domain. I
> > >>did some work around that, and there is a (pretty advanced) draft here :
> > >>
> > >>http://addictedtor.free.fr/graphiques/displayGallery.php
> > >>
> > >>For instance, there are some of my graphs, some of Eric Lecoutre's and
> > >>some coming from demo(graphics), demo(image), demo(persp) and so on.
> > >>
> > >>Pretty soon, I'll add the possibility to  :
> > >>- add graphs dynamically from the web
> > >>- give a mark to each graph (maybe we can do some stats :) )
> > >>- link R function to their help pages from http://finzi.psych.upenn.edu/R
> > >>- add references to publications
> > >>-  whatever
> > >>
> > >>Please take a look and tell me what should be improved. May the foRce be
> > >>with you.
> > >>
> > >>Romain.
> > >>
> > >>PS1 : Regarding graphs from demo(*), I wrote that author is R
> > >>Development Core Team, maybe those were done by a precise person in the
> > >>Core, in that case tell me and I'll change it.
> > >>
> > >>PS2 : Source code highlighting was done by the highlight software  : (
> > >>http://www.andre-simon.de/ ) suggested to me by Eric Lecoutre.
> > >>
> > >>
> > >>
> > >
> > >
> > >
> > >
> > >
> > >
> >
> > --
> >  ~ 
> > ~~  Romain FRANCOIS - http://addictedtor.free.fr ~~
> > Etudiant  ISUP - CS3 - Industrie et Services   
> > ~~http://www.isup.cicrp.jussieu.fr/  ~~
> >    Stagiaire INRIA Futurs - Equipe SELECT  
> > ~~   http://www.inria.fr/recherche/equipes/select.fr.html~~
> >  ~ 
> >
> > __
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! 
> > http://www.R-project.org/posting-guide.html
> >
>

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


Re: [R] nls error in formula

2005-04-18 Thread Anaid Diaz
thank you, it worked.

Sylvia
--- Douglas Bates <[EMAIL PROTECTED]> wrote:
> Anaid Diaz wrote:
> > Hi,
> > I'm a new R user, with a lot of questions. At the
> > moment I'm stoped on an error traying to fit a
> model:
> > 
> > 
> >>x <- sandeel ## numeric data (2500-6)
> >>y <- Noss   ## numeric data  (0-1.2)
> >>A <- 0.8
> >>B <- 0.6
> >>C <- 1/4
> >>nls( y ~ A-B*exp(-C*x))
> > 
> > Error in match.call(definition, call, expand.dots)
> : 
> > .Primitive... is not a function
> > 
> > I'm not sure if the error is due to the formula
> sytax
> > or something else.
> > I'll appreciate any help
> > 
> > Sylvia
> 
> Use
> 
> nls(y ~ A -B*exp(-C*x), start = c(A = 0.8, B = 0.6,
> C = 1/4))
> 
> instead or, preferably,
> 
> nls(y ~ SSasymp(x, Asym, R0, lrc))
> 
> and read
> 
> ?SSasymp
> 
> for an interpretation of the estimated parameters.
> 

_
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. 
http://net.yahoo.com.mx

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


Re: [R] nls error in formula

2005-04-18 Thread Douglas Bates
Anaid Diaz wrote:
Hi,
I'm a new R user, with a lot of questions. At the
moment I'm stoped on an error traying to fit a model:

x <- sandeel ## numeric data (2500-6)
y <- Noss   ## numeric data  (0-1.2)
A <- 0.8
B <- 0.6
C <- 1/4
nls( y ~ A-B*exp(-C*x))
Error in match.call(definition, call, expand.dots) : 
.Primitive... is not a function

I'm not sure if the error is due to the formula sytax
or something else.
I'll appreciate any help
Sylvia
Use
nls(y ~ A -B*exp(-C*x), start = c(A = 0.8, B = 0.6, C = 1/4))
instead or, preferably,
nls(y ~ SSasymp(x, Asym, R0, lrc))
and read
?SSasymp
for an interpretation of the estimated parameters.
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] the graph gallery strikes back

2005-04-18 Thread Peter Dalgaard
Romain Francois <[EMAIL PROTECTED]> writes:

> Oops :)
> 
> That should be allright now.
> 
> Romain

Yep. You might want to antialias the small images though. And, btw,
just for fun you might want to include the real Maunga Whau among the
volcano pictures: http://www.biostat.ku.dk/~pd/auckland2000/maungawhau.jpg
You will notice that the real world is actually closer to pictures 25
and 26, but 27 looks more dangerous and volcano-like...

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

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


Re: [R] Generating a binomial random variable correlated with a

2005-04-18 Thread Giovanni Petris

You may generate a single standard normal random variable Z and set
X = (Z>x). According to back-of-the-envelope calculations, the two
have a correlation of

  exp(-x^2/2)/sqrt(2*pi*pnorm(x)*(1-pnorm(x)))

which goes from a maximum of about 0.79 at x=0 to 0 for x going to
infinity.

If you aim at a correlation of 0.7, this is how to go:

> rt <- uniroot(function(x) exp(-x^2/2)/sqrt(2*pi*pnorm(x)*(1-pnorm(x)))-0.7,
+ lower=0,upper=3)
> rt$root
[1] 0.841188
> x <- rnorm(1000)
> y <- as.numeric(x>rt$root)
> cor(x,y)
[1] 0.7069753

Best,
Giovanni

-- 

 __
[  ]
[ Giovanni Petris [EMAIL PROTECTED] ]
[ Department of Mathematical Sciences  ]
[ University of Arkansas - Fayetteville, AR 72701  ]
[ Ph: (479) 575-6324, 575-8630 (fax)   ]
[ http://definetti.uark.edu/~gpetris/  ]
[__]

> Date: Sun, 17 Apr 2005 11:52:49 +0100 (BST)
> From: [EMAIL PROTECTED] (Ted Harding)
> Sender: [EMAIL PROTECTED]
> Cc: r-help@stat.math.ethz.ch
> Precedence: list
> 
> On 16-Apr-05 Ashraf Chaudhary wrote:
> > Ted:
> > Thank you for your help. All I want is a binomial random
> > variable that is correlated with a normal random variable
> > with specified correlation. By linear I mean the ordinary
> > Pearson correlation. I tried the following two methods,
> > in each case the resulting correlation is substantially
> > less than the one specified.   
> > 
> > Method I: Generate two correlated normals (using Cholesky
> > decomposition method) and dichotomize one (0/1) to get the
> > binomial. Method II: Generate two correlated variables, one
> > binomial and one normal using the Cholesky decomposition methods.
> > 
> > Here is how I did:
> > 
> > X <- rnorm(100)  
> > Y <- rnorm(100)   
> > r<- 0.7
> > Y1 <- X*r+Y*sqrt(1-r**2) 
> > cor(X,Y1) # Correlated normals using Cholesky decomposition
> > cor(X>0.84,Y1)  # Method I
> > 
> >##
> > X1 <- rbinom(100,1,0.5)
> > Y2 <- X1*r+Y*sqrt(1-r**2)  
> > cor(X1,Y2); # Method II
> 
> Hello Ashraf,
> 
> The above more explicit explanation certainly helps to clarify
> your question! (I echo Bill's counsel to spell out essential
> detail).
> 
> I'll lead on from your "second method" above, which makes it
> explicit that, to each of your 100 values (Y) sampled from rnorm
> you are sampling from {0,1} to get one of your 100 binomial
> (n=1) variables (X1). However, in this second method you also
> create the derived variable Y2 = X1*r+Y*sqrt(1-r**2), and
> apparently you want this (Y2) to be the Normal variate which
> is correlated with X1.
> 
> Unfortunately, given the way Y2 is constructed, it does not
> have a Normal distribution. This is almost obvious from the
> fact that, conditional on the number of 1s in X1, the values
> of Y2 are a mixture of N(0,1-r^2) and N(r,1-r^2).
> 
> You can explore this in R by looking at the histogram of a
> much larger sample of Y2. Thus:
> 
>   r<- 0.7
>   Y <- rnorm(10)
>   X1 <- rbinom(10,1,0.5)
>   Y2 <- X1*r+Y*sqrt(1-r**2)
>   m<-mean(Y2) ; s<-sd(Y2)
>   hist(Y2,breaks=0.1*(-45:45))
>   lines(0.1*(-45:45),0.1*10*dnorm(0.1*(-45:45),m,s))
> 
> Do it once, and the fit looks pretty good. However, if you
> repeat the above commands several times, you will observe
> that, near the peak of the curve, there is a definite
> tendency for the peak of the histogram to lie below the peak
> of the fitted curve. This illustrates the fact that you are
> looking at a superposition of two Normal curves, with identical
> (since you have p=0.5 in the Binomial sample) proportions
> and variances, but slightly shifted relative to each other
> (by an amount r which is in magnitude less than 1). This
> superposition is flatter at the top than any single Normal
> curve would be, which is being reflected in the "deficiency"
> of the histogram relative to the fitted curve
> 
> You can also see this theoretically, since your Y2 is
> 
>   Y2 = A*X1 + B*Y
> 
> so that
> 
>   P[Y2 <= y] = p*P[B*Y <= y] + (1-p)*P[B*Y <= y - A]
> 
>  = p*P[Y <= y/B] + (1-p)*P[Y <= (y-A)/B]
> 
> where p is the Binomial P[X1 = 1].
> 
> Hence the density function of Y2 is the derivative of this
> w.r.to y, namely
> 
>   p*f(y/B)/B + (1-p)*f((y-A)/B)/B
> 
> where f(x) is the density function of the standard N(0,1).
> 
> While in the case of your example (see histograms) the
> distribution of Y2 might be close enough to Normal for
> practical purposes (but this depends on your practical
> purpose), it is nonetheless better to try to avoid the
> theoretical difficulty if possible.
> 
> So I'd suggest experimenting on the following lines.
> 
> 1. Let X1 be a sample of size N using rbinom(N,1,p)
>(where, in general, p need not be 0.5)
> 
> 2. Let Y be a sample of size N using rnorm(N,mu,sigma)
>(and again, in general, mu need not be 0 nor sigma 1).
> 
> This is 

[R] nls error in formula

2005-04-18 Thread Anaid Diaz
Hi,
I'm a new R user, with a lot of questions. At the
moment I'm stoped on an error traying to fit a model:

> x <- sandeel ## numeric data (2500-6)
> y <- Noss   ## numeric data  (0-1.2)
> A <- 0.8
> B <- 0.6
> C <- 1/4
> nls( y ~ A-B*exp(-C*x))
Error in match.call(definition, call, expand.dots) : 
.Primitive... is not a function

I'm not sure if the error is due to the formula sytax
or something else.
I'll appreciate any help

Sylvia


_
Do You Yahoo!?
La mejor conexión a internet y 25MB extra a tu correo por $100 al mes. 
http://net.yahoo.com.mx

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


Re: [R] generalized linear mixed models - how to compare?

2005-04-18 Thread Peter Spreeuwenberg
  Liset

 Dat moet lukken en hoe sneller je het anlevert hoe eerder je resultaten terug 
ziet.
Dus, Ik wacht af.


groet Peter S



Date sent:  Sun, 17 Apr 2005 18:07:28 +0100 (BST)
From:   Prof Brian Ripley <[EMAIL PROTECTED]>
To: Deepayan Sarkar <[EMAIL PROTECTED]>
Subject:Re: [R] generalized linear mixed models - how to 
compare?
Copies to:  r-help@stat.math.ethz.ch,
Nestor Fernandez <[EMAIL PROTECTED]>

> On Sun, 17 Apr 2005, Deepayan Sarkar wrote:
> 
> > On Sunday 17 April 2005 08:39, Nestor Fernandez wrote:
> 
> >> I want to evaluate several generalized linear mixed models, including
> >> the null model, and select the best approximating one. I have tried
> >> glmmPQL (MASS library) and GLMM (lme4) to fit the models. Both result
> >> in similar parameter estimates but fairly different likelihood
> >> estimates.
> >> My questions:
> >> 1- Is it correct to calculate AIC for comparing my models, given that
> >> they use quasi-likelihood estimates? If not, how can I compare them?
> >> 2- Why the large differences in likelihood estimates between the two
> >> procedures?
> >
> > The likelihood reported by glmmPQL is wrong, as it's the likelihood of
> > an incorrect model (namely, an lme model that approximates the correct
> > glmm model).
> 
> Actually glmmPQL does not report a likelihood.  It returns an object of 
> class "lme", but you need to refer to the reference for how to interpret 
> that.  It *is* support software for a book.
> 
> > GLMM uses (mostly) the same procedure to get parameter estimates, but as 
> > a final step calculates the likelihood for the correct model for those 
> > estimates (so the likelihood reported by it should be fairly reliable).
> 
> Well, perhaps but I need more convincing.  The likelihood involves many 
> high-dimensional non-analytic integrations, so I do not see how GLMM can 
> do those integrals -- it might approximate them, but that would not be 
> `calculates the likelihood for the correct model'.  It would be helpful to 
> have a clarification of this claim.  (Our experiments show that finding an 
> accurate value of the log-likelihood is difficult and many available 
> pieces of software differ in their values by large amounts.)
> 
> Further, since neither procedure does ML fitting, this is not a maximized 
> likelihood as required to calculate an AIC value.  And even if it were, 
> you need to be careful as often one GLMM is a boundary value for another, 
> in which case the theory behind AIC needs adjustment.
> 
> -- 
> Brian D. Ripley,  [EMAIL PROTECTED]
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel:  +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865 272595
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Stichting NIVEL / NETHERLANDS INSTITUTE OF PRIMARY HEALTH CARE
Peter Spreeuwenberg
P.O. Box 1568
3500  BN Utrecht
Netherland
E-mail   : [EMAIL PROTECTED]
Direct: +31-30-2729678
General   : +31-30-2729700
Fax   : +31-30-2729729
Web-site  http://www.nivel.nl 


DISCLAIMER__
This message contains information that may be privileged or\...{{dropped}}

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


Re: [R] R2.0.1 for Mac OS X 10.3 problem

2005-04-18 Thread Horacio Montenegro

 I have the same problem, in Windows, and I think
the .Rdata is not corrupted. Load R without loading
the.Rdata file - move or rename it. Then library(lme4)
and load the .Rdata - it should work.

cheers,
  Horacio


--
Horacio Montenegro
PhD Student in Genetics and Molecular Biology
Universidade Estadual de Campinas (Unicamp)
phone: +55 19 3788 1151


--- Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> It did not `break R': just rename your .RData which
> appears to have become 
> corrupted.
> 
> Please always start R with --vanilla before
> concluding it is broken.
> 
> On Mon, 18 Apr 2005, Greg Arnold wrote:
> 
> > This combination was operating satisfactorily
> until I tried updating lme4 and 
> > Matrix.  My attempts to do this ultimately broke
> R.  The R console appears 
> > briefly, then collapses.   I have tried
> downloading and reinstalling R 
> > without success.  Typing 'R' into Terminal gives
> the error message bring up 
> > the usual introduction, then the error message:
> > Error in methods:::mlistMetaName(mi, ns) :
> >The methods object name for "coerce" must
> include the name of the 
> > package that contains the generic function, but
> there is no generic function 
> > of this name
> > Fatal error: unable to restore saved data in
> .RData
> 
> -- 
> Brian D. Ripley, 
> [EMAIL PROTECTED]
> Professor of Applied Statistics, 
> http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel:  +44 1865
> 272861 (self)
> 1 South Parks Road, +44 1865
> 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865
> 272595
> 
>

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


Re: [R] the graph gallery strikes back

2005-04-18 Thread Gabor Grothendieck
Yes, it works for me now.  Thanks.  Very impressive I might add.

On 4/18/05, Romain Francois <[EMAIL PROTECTED]> wrote:
> Oops :)
> 
> That should be allright now.
> 
> Romain
> 
> Le 18.04.2005 13:52, Naji a écrit :
> 
> >Hi Romain,
> >
> >
> >Great job.. Thanks a lot.
> >When pointing at the graph or the link (ie Kernel density estimator in R²,
> >Perspective plot and contour plot, etc) the browser is sending back a SQL
> >error (Safari, MacOSX3.8)
> >
> >Erreur SQL!
> >Unknown column 'qualification' in 'field list'
> >
> >Best regards
> >Naji
> >
> >
> >Le 18/04/05 11:29, « Romain Francois » <[EMAIL PROTECTED]> a écrit :
> >
> >
> >
> >>Hello useRs and helpRs,
> >>
> >>Some time ago, in a gallaxy far away (here is the thread :
> >>http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46532.html ) we
> >>discussed about a graph gallery showing the power of R in that domain. I
> >>did some work around that, and there is a (pretty advanced) draft here :
> >>
> >>http://addictedtor.free.fr/graphiques/displayGallery.php
> >>
> >>For instance, there are some of my graphs, some of Eric Lecoutre's and
> >>some coming from demo(graphics), demo(image), demo(persp) and so on.
> >>
> >>Pretty soon, I'll add the possibility to  :
> >>- add graphs dynamically from the web
> >>- give a mark to each graph (maybe we can do some stats :) )
> >>- link R function to their help pages from http://finzi.psych.upenn.edu/R
> >>- add references to publications
> >>-  whatever
> >>
> >>Please take a look and tell me what should be improved. May the foRce be
> >>with you.
> >>
> >>Romain.
> >>
> >>PS1 : Regarding graphs from demo(*), I wrote that author is R
> >>Development Core Team, maybe those were done by a precise person in the
> >>Core, in that case tell me and I'll change it.
> >>
> >>PS2 : Source code highlighting was done by the highlight software  : (
> >>http://www.andre-simon.de/ ) suggested to me by Eric Lecoutre.
> >>
> >>
> >>
> >
> >
> >
> >
> >
> >
> 
> --
>  ~ 
> ~~  Romain FRANCOIS - http://addictedtor.free.fr ~~
> Etudiant  ISUP - CS3 - Industrie et Services   
> ~~http://www.isup.cicrp.jussieu.fr/  ~~
>    Stagiaire INRIA Futurs - Equipe SELECT  
> ~~   http://www.inria.fr/recherche/equipes/select.fr.html~~
>  ~ 
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

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


Re: [R] lmer question

2005-04-18 Thread Douglas Bates
Markus Bean wrote:
Hi --
I'm using lmer for binomial data. I am trying to
replicate estimates provided by Agresti (2002,
Categorical data analysis, Wiley) using abortion data
in table 10.13 (estimates provided in table 12.3 p.
505). 

I fit the same model using these three commands:
a1 <- lmer(resp ~ sex + option1 + option2 + (1|id),
data=abort,family=binomial, method = c("AGQ"))
a2 <- lmer(resp ~ sex + option1 + option2 + (1|id),
data=abort,family=binomial, method = c("Laplace"))
a3 <- lmer(resp ~ sex + option1 + option2 + (1|id),
data=abort,family=binomial, method = c("PQL"))
All three methods provide the exact same estimates
(which should not be the case), and the estimates are
incorrect. I know the data are correctly entered
because I obtain correct estimates with gllamm in
Stata.
I am I doing something wrong here in my commands, or
is the lmer module not implementing AGQ and Laplace
properly with this version?
The latter.  Actually it is not implementing them at all in this 
version.  I will upload a new release of the lme4 package later this 
week and insert appropriate messages.

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


Re: [R] the graph gallery strikes back

2005-04-18 Thread Romain Francois
Hello,
I'm not sure i got you right, i added a link to index on the top right 
corner of each page.
Is that what you meant ?

Romain
Le 18.04.2005 14:33, BXC (Bendix Carstensen) a écrit :
On my windows system, I cannot get back to the overview page
once I clicked on one of the items.
Is this yours or my problem?
Bendix
--
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2
DK-2820 Gentofte
Denmark
tel: +45 44 43 87 38
mob: +45 30 75 87 38
fax: +45 44 43 07 06
[EMAIL PROTECTED]
www.biostat.ku.dk/~bxc
--

 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Romain Francois
Sent: Monday, April 18, 2005 11:29 AM
To: RHELP; [EMAIL PROTECTED]
Subject: [R] the graph gallery strikes back

Hello useRs and helpRs,
Some time ago, in a gallaxy far away (here is the thread : 
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46532.html ) we 
discussed about a graph gallery showing the power of R in 
that domain. I 
did some work around that, and there is a (pretty advanced) 
draft here :

http://addictedtor.free.fr/graphiques/displayGallery.php
For instance, there are some of my graphs, some of Eric 
Lecoutre's and 
some coming from demo(graphics), demo(image), demo(persp) and so on.

Pretty soon, I'll add the possibility to  :
- add graphs dynamically from the web
- give a mark to each graph (maybe we can do some stats :) )
- link R function to their help pages from 
http://finzi.psych.upenn.edu/R
- add references to 
publications
-  whatever

Please take a look and tell me what should be improved. May 
the foRce be 
with you.

Romain.
PS1 : Regarding graphs from demo(*), I wrote that author is R 
Development Core Team, maybe those were done by a precise 
person in the 
Core, in that case tell me and I'll change it.

PS2 : Source code highlighting was done by the highlight 
software  : ( 
http://www.andre-simon.de/ ) suggested to me by Eric Lecoutre.

   

--
 ~ 
~~  Romain FRANCOIS - http://addictedtor.free.fr ~~
Etudiant  ISUP - CS3 - Industrie et Services   
~~http://www.isup.cicrp.jussieu.fr/  ~~
   Stagiaire INRIA Futurs - Equipe SELECT  
~~   http://www.inria.fr/recherche/equipes/select.fr.html~~
 ~ 
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] the graph gallery strikes back

2005-04-18 Thread Ales Ziberna
Great work!
Nice collection!
For me everything worked, although I did't click on all the graphs!
Thans!

- Original Message - 
From: "Romain Francois" <[EMAIL PROTECTED]>
To: "RHELP" ; <[EMAIL PROTECTED]>
Sent: Monday, April 18, 2005 11:29 AM
Subject: [R] the graph gallery strikes back


Hello useRs and helpRs,
Some time ago, in a gallaxy far away (here is the thread : 
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46532.html ) we discussed 
about a graph gallery showing the power of R in that domain. I did some 
work around that, and there is a (pretty advanced) draft here :

http://addictedtor.free.fr/graphiques/displayGallery.php
For instance, there are some of my graphs, some of Eric Lecoutre's and 
some coming from demo(graphics), demo(image), demo(persp) and so on.

Pretty soon, I'll add the possibility to  :
- add graphs dynamically from the web
- give a mark to each graph (maybe we can do some stats :) )
- link R function to their help pages from http://finzi.psych.upenn.edu/R
- add references to publications
-  whatever
Please take a look and tell me what should be improved. May the foRce be 
with you.

Romain.
PS1 : Regarding graphs from demo(*), I wrote that author is R Development 
Core Team, maybe those were done by a precise person in the Core, in that 
case tell me and I'll change it.

PS2 : Source code highlighting was done by the highlight software  : ( 
http://www.andre-simon.de/ ) suggested to me by Eric Lecoutre.

--
 ~ 
~~  Romain FRANCOIS - http://addictedtor.free.fr ~~
Etudiant  ISUP - CS3 - Industrie et Services   
~~http://www.isup.cicrp.jussieu.fr/  ~~
   Stagiaire INRIA Futurs - Equipe SELECT  
~~   http://www.inria.fr/recherche/equipes/select.fr.html~~
 ~ 
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html


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


[R] R-2.1.0 is released

2005-04-18 Thread Peter Dalgaard
I've rolled up R-2.1.0.tar.gz a short while ago. This version contains
several substantial changes and additions, perhaps most notably the
UTF8 and Internationalization changes. See the full list of changes
below.

You can get it from

http://cran.r-project.org/src/base/R-2/R-2.1.0.tar.gz

or wait for it to be mirrored at a CRAN site nearer to you. Binaries
for various platforms will appear in due course.
 
There is also a version split for floppies (does anyone use these any
more?). 

For the R Core Team

Peter Dalgaard

These are the md5sums for the freshly created files, in case you wish
to check that they are uncorrupted:

94d55d512a9ba36caa9b7df079bae19f  COPYING
d8045f3b8f929c1cb29a1e3fd737b499  COPYING.LIB
70447ae7f2c35233d3065b004aa4f331  INSTALL
8b78e12b100a6834fdada2dfaab98ab0  NEWS
88bbd6781faedc788a1cbd434194480c  ONEWS
4f004de59e24a52d0f500063b4603bcb  OONEWS
e7f92ef0c2bc5b772a83f42a5ed504c9  R-2.1.0.tar.gz
d45b1084f91fcfeebbb69cc2dd9ed6e1  R-2.1.0.tar.gz-split.aa
18b34d82302a68a86510da6e0dd9a193  R-2.1.0.tar.gz-split.ab
d242b365ed1398031ff26d31a6da9c1c  R-2.1.0.tar.gz-split.ac
b992e7d10baf662ede52a0c156f51d86  R-2.1.0.tar.gz-split.ad
a2c559b4b1c87f5815bec9e8e2b7bd31  R-2.1.0.tar.gz-split.ae
033ae9f596d74f9780f98c9b6cab31df  R-2.1.0.tar.gz-split.af
ed0fd6939e8e84b0a4a2a01d92cc7f96  R-2.1.0.tar.gz-split.ag
2d1379175456b308328d9af09e2726a3  R-2.1.0.tar.gz-split.ah
bbb8fd837e27c931b9921548ee4c5c28  R-2.1.0.tar.gz-split.ai
e7f92ef0c2bc5b772a83f42a5ed504c9  R-latest.tar.gz
56a780cdec835c5c598f8dfc0738f7f3  README


Here is the relevant bit of the NEWS file:


CHANGES IN R VERSION 2.1.0


USER-VISIBLE CHANGES

o   box plots {by boxplot() or bxp()} now have the median line three
times the normal line width in order to distinguish it from the
quartile ones.

o   Unix-alike versions of R can now be used in UTF-8 locales on
suitably equipped OSes.  See the internationalization section
below.

o   The meaning of 'encoding' for a connection has changed: See the
internationalization section below.

o   There has been some rationalization of the format of
warning/error messages, to make them easier to translate.
Generally names of functions and arguments are single-quoted,
and classes double-quoted.

o   Reading text files with embedded "\" (as in Windows file names)
may now need to use scan(* , allowEscapes = FALSE), see also below.


NEW FEATURES

o   %% now warns if its accuracy is likely to be affected by lack
of precision (as in 1e18 %% 11, the unrealistic expectation of
PR#7409), and tries harder to return a value in range when it is.

o   abbreviate() now warns if used with non-ASCII chars, as the
algorithm is designed for English words.

o   The default methods for add1() and drop1() check for changes
in the number of cases in use.

The "lm" and "glm" methods for add1() quoted the  model
on the original fitted values when using (with a warning) a
smaller set of cases for the expanded models.

o   Added alarm() function to generate a bell or beep or visual alert.

o   all/any() now attempt to coerce their arguments to logical, as
documented in the Blue Book.  This means e.g. any(list()) works.

o   New functions for multivariate linear models: anova.mlm(),
SSD(), estVar(), mauchley.test() (for sphericity).

vcov() now does something more sensible for "mlm" class objects.

o   as.data.frame.table() has a new argument 'responseName'
(contributed by Bill Venables).

o   as.dist() and cophenetic() are now generic, and the latter has a
new method for objects of class "dendrogram".

o   as.ts() is now generic.

o   binomial() has a new "cauchit" link (suggested by Roger Koenker).

o   chisq.test() has a new argument 'rescale.p'.  It is now possible
to simulate (slowly) the P value also in the 1D case
(contributed by Rolf Turner).

o   choose(n,k) and lchoose(.) now also work for arbitrary (real) n
in accordance with the general binomial theorem.  choose(*,k)
is more accurate (and faster) for small k.

o   Added colorRamp() and colorRampPalette() functions for color
interpolation.

o   colSums()/rowSums() now allow arrays with a zero-length extent
(requested by PR#7775).

o   confint() has stub methods for classes "glm" and "nls" that
invoke those in package MASS.  This avoids using the "lm"
method for "glm" objects if MASS is not attached.

confint() has a default method using asymptotic normality.

o   contr.SAS() has been moved from the 'nlme' package to the
'stats' package.

o   New function convertColors() maps between color spaces.
colorRamp() uses it.

o   The cov() function in the non-Pearson cases now ranks data after
   

Re: [R] the graph gallery strikes back

2005-04-18 Thread Romain Francois
Hello Hans,
For the moment, you can't put yourself the graph in it. I'll do it for you.
Just send me the source code and i'll put your graph when i found the 
time (probably tonight). You may also want to add comments on Andrew curves.

Romain
Le 18.04.2005 13:37, Hans Werner Borchers a écrit :
Dear Francois Romain,
thanks for providing the R Graphics Gallery. Actually, I would like to 
provide a graph of "Andrews curves", probably for the Iris data set.

Also, one could add some of the beautiful 3D pictures generated with 
the RGL package.

Unfortunately, it appears to be impossible to retrieve the code behind:
"Erreur SQL!
 Unknown column 'qualification' in 'field list'"
Best regards,  Hans Werner Borchers.


--
 ~ 
~~  Romain FRANCOIS - http://addictedtor.free.fr ~~
Etudiant  ISUP - CS3 - Industrie et Services   
~~http://www.isup.cicrp.jussieu.fr/  ~~
   Stagiaire INRIA Futurs - Equipe SELECT  
~~   http://www.inria.fr/recherche/equipes/select.fr.html~~
 ~ 
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] the graph gallery strikes back

2005-04-18 Thread Romain Francois
Oops :)
That should be allright now.
Romain
Le 18.04.2005 13:52, Naji a écrit :
Hi Romain,
Great job.. Thanks a lot.
When pointing at the graph or the link (ie Kernel density estimator in R²,
Perspective plot and contour plot, etc) the browser is sending back a SQL
error (Safari, MacOSX3.8)
Erreur SQL!
Unknown column 'qualification' in 'field list'
Best regards
Naji
Le 18/04/05 11:29, « Romain Francois » <[EMAIL PROTECTED]> a écrit :
 

Hello useRs and helpRs,
Some time ago, in a gallaxy far away (here is the thread :
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46532.html ) we
discussed about a graph gallery showing the power of R in that domain. I
did some work around that, and there is a (pretty advanced) draft here :
http://addictedtor.free.fr/graphiques/displayGallery.php
For instance, there are some of my graphs, some of Eric Lecoutre's and
some coming from demo(graphics), demo(image), demo(persp) and so on.
Pretty soon, I'll add the possibility to  :
- add graphs dynamically from the web
- give a mark to each graph (maybe we can do some stats :) )
- link R function to their help pages from http://finzi.psych.upenn.edu/R
- add references to publications
-  whatever
Please take a look and tell me what should be improved. May the foRce be
with you.
Romain.
PS1 : Regarding graphs from demo(*), I wrote that author is R
Development Core Team, maybe those were done by a precise person in the
Core, in that case tell me and I'll change it.
PS2 : Source code highlighting was done by the highlight software  : (
http://www.andre-simon.de/ ) suggested to me by Eric Lecoutre.
   



 


--
 ~ 
~~  Romain FRANCOIS - http://addictedtor.free.fr ~~
Etudiant  ISUP - CS3 - Industrie et Services   
~~http://www.isup.cicrp.jussieu.fr/  ~~
   Stagiaire INRIA Futurs - Equipe SELECT  
~~   http://www.inria.fr/recherche/equipes/select.fr.html~~
 ~ 
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Rcmdr's problem in East Asian Languages Version

2005-04-18 Thread Prof Brian Ripley
The issue here is not the `East Asian Languages Version' but the locale 
you are using, which you have not told us.  Try using the C locale or an 
English locale: Rcmdr works there for me.

Also be sure to tell us the version of the package (here Rcmdr) you are 
using.

The posting guide does ask you to report package-specific problems to the 
maintainer, and I have sent a more detailed reply to him copied to you.

On Mon, 18 Apr 2005, ronggui wrote:
maybe this is a problem specific to the East Asian Languages 
Version.when i reinstall R without checking the "Version for East Asian 
Languages" option ,it works.but if i install R with the "Version for 
East Asian Languages" option, it show the following error msg.

library(Rcmdr)
Loading required package: tcltk
Loading Tcl/Tk interface ... done
Error in parse(file, n, text, prompt) : syntax error on line 4857
Error: unable to load R code in package 'Rcmdr'
Error: package/namespace load failed for 'Rcmdr'
[ 2.1.0 beta ]
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] the graph gallery strikes back

2005-04-18 Thread Gabor Grothendieck
On 4/18/05, Romain Francois <[EMAIL PROTECTED]> wrote:
> Hello useRs and helpRs,
> 
> Some time ago, in a gallaxy far away (here is the thread :
> http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46532.html ) we
> discussed about a graph gallery showing the power of R in that domain. I
> did some work around that, and there is a (pretty advanced) draft here :
> 
> http://addictedtor.free.fr/graphiques/displayGallery.php
> 
> For instance, there are some of my graphs, some of Eric Lecoutre's and
> some coming from demo(graphics), demo(image), demo(persp) and so on.
> 
> Pretty soon, I'll add the possibility to  :
> - add graphs dynamically from the web
> - give a mark to each graph (maybe we can do some stats :) )
> - link R function to their help pages from http://finzi.psych.upenn.edu/R
> - add references to publications
> -  whatever
> 
> Please take a look and tell me what should be improved. May the foRce be
> with you.
> 
> Romain.
> 
> PS1 : Regarding graphs from demo(*), I wrote that author is R
> Development Core Team, maybe those were done by a precise person in the
> Core, in that case tell me and I'll change it.
> 
> PS2 : Source code highlighting was done by the highlight software  : (
> http://www.andre-simon.de/ ) suggested to me by Eric Lecoutre.
> 

When I click on any of the graphs or the title of a graph I get this:

Erreur SQL!

Unknown column 'qualification' in 'field list'

I am using Windows XP and Internet Explorer 6.0 (with service pack 2).

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


Re: [R] R2.0.1 for Mac OS X 10.3 problem

2005-04-18 Thread Prof Brian Ripley
It did not `break R': just rename your .RData which appears to have become 
corrupted.

Please always start R with --vanilla before concluding it is broken.
On Mon, 18 Apr 2005, Greg Arnold wrote:
This combination was operating satisfactorily until I tried updating lme4 and 
Matrix.  My attempts to do this ultimately broke R.  The R console appears 
briefly, then collapses.   I have tried downloading and reinstalling R 
without success.  Typing 'R' into Terminal gives the error message bring up 
the usual introduction, then the error message:
Error in methods:::mlistMetaName(mi, ns) :
   The methods object name for "coerce" must include the name of the 
package that contains the generic function, but there is no generic function 
of this name
Fatal error: unable to restore saved data in .RData
--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] how to use sink.number()

2005-04-18 Thread Prof Brian Ripley
On Mon, 18 Apr 2005, Michael S wrote:
Dear All R-helper,
my question is how to use sink.number.
if I want to  label the output was sinked by sink function how should I do ?
example:
zz <- file("c:\\sinktest1.txt",open="wt")
sink(zz)
g<- 1:10
cat(g,"\n")
f<-list(1:100)
h<-capture.output(f)
cat(h)
sink()
I want there are marks in "sinktest1.txt" files, let me know the number of 
output I get(in this example, there should be 2 mark or number ,becuase I 
using two cat function)
That is nothing to do with sink.number():
 'sink.number()' reports how many diversions are in use.
 'sink.number(type = "message")' reports the number of the
 connection currently being used for error messages.
If you don't understand that, please consult the references on the help 
page.

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


[R] Rcmdr's problem in East Asian Languages Version

2005-04-18 Thread ronggui
maybe this is a problem specific to the  East Asian Languages Version.when i 
reinstall R without checking the "Version for  East Asian Languages" option  
,it works.but if i install R with the  "Version for   East Asian Languages" 
option, it show the following error msg.

> library(Rcmdr)
Loading required package: tcltk
Loading Tcl/Tk interface ... done
Error in parse(file, n, text, prompt) : syntax error on line 4857
Error: unable to load R code in package 'Rcmdr'
Error: package/namespace load failed for 'Rcmdr'

> version
 _  
platform i386-pc-mingw32
arch i386   
os   mingw32
system   i386, mingw32  
status   beta   
major2  
minor1.0
year 2005   
month04 
day  16 
language R

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


[R] Invalid *.Rd in package {was "Rd.sty problems"}

2005-04-18 Thread Martin Maechler
> "Federico" == Federico Calboli <[EMAIL PROTECTED]>
> on Mon, 18 Apr 2005 10:33:22 +0100 writes:

Federico> I am trying to build a new R package to submit,
Federico> but it's failing to create a tex manual:

Federico> R CMD check Biodem
Federico> * checking for working latex ... OK
Federico> * using log directory
Federico> '/home/greatsage/Fede/R-packages/temp/Biodem.Rcheck'
Federico> * checking for file 'Biodem/DESCRIPTION' ... OK
Federico> * checking if this is a source package ... OK

Federico> * Installing *source* package 'Biodem' ...
Federico> ** R
Federico> ** data
Federico> ** help
 Building/Updating help pages for package 'Biodem'
Federico> Formats: text html latex example

Federico> * DONE (Biodem)

Federico> * checking package directory ... OK
. (everything OK)

Federico> * creating Biodem-manual.tex ... OK
Federico> * checking Biodem-manual.tex ... ERROR
Federico> LaTeX errors when creating DVI version.
Federico> This typically indicates Rd problems.
  
(and I think I have never seen another situation:  It will be a
 problem in of your  Biodem/man/*.Rd files !)

Federico> I cheked the log file in the .Rcheck dir, but it's
Federico> incomprehensible to me, so I simply copied and run
Federico> the tex file itself. The manual won't compile
Federico> lamenting it cannot find the Rd.sty file.

Federico> locate Rd.sty gives:
Federico> /usr/lib/R/share/texmf/Rd.sty

Federico> I am completely lost... any advice? do I have to
Federico> change some path? I am using R for Debian from the
Federico> latest .deb files for Sarge on x86 arch.

When 'R CMD check' latexs your file it adds something like
  /usr/lib/R/share/texmf/Rd.sty to the TEXINPUTS (path) used
and you could do so as well.

Alternatively, use 
   R CMD Rd2dvi 
directly.

If this doesn't help you, you may need to look at the latex
*.log file and find someone to whom it's not incomprehensible,
possibly by putting it up on the web asking for help on R-devel
{because the whole issue will have become too technical for R-help}.

Martin

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


[R] R2.0.1 for Mac OS X 10.3 problem

2005-04-18 Thread Greg Arnold
This combination was operating satisfactorily until I tried updating 
lme4 and Matrix.  My attempts to do this ultimately broke R.  The R 
console appears briefly, then collapses.   I have tried downloading and 
reinstalling R without success.  Typing 'R' into Terminal gives the 
error message bring up the usual introduction, then the error message:
Error in methods:::mlistMetaName(mi, ns) :
The methods object name for "coerce" must include the name of 
the package that contains the generic function, but there is no generic 
function of this name
Fatal error: unable to restore saved data in .RData

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


[R] Rd.sty problems.

2005-04-18 Thread Federico Calboli
Hi All,

I am trying to build a new R package to submit, but it's failing to
create a tex manual:

R CMD check Biodem
* checking for working latex ... OK
* using log directory
'/home/greatsage/Fede/R-packages/temp/Biodem.Rcheck'
* checking for file 'Biodem/DESCRIPTION' ... OK
* checking if this is a source package ... OK

* Installing *source* package 'Biodem' ...
** R
** data
** help
 >>> Building/Updating help pages for package 'Biodem'
 Formats: text html latex example
  Fst   texthtmllatex   example
  Laskertexthtmllatex   example
  Mal.eqtexthtmllatex   example
  N texthtmllatex   example
  P texthtmllatex   example
  Phi   texthtmllatex   example
  S texthtmllatex   example
  col.sto   texthtmllatex   example
  hedrick   texthtmllatex   example
  mal.cond  texthtmllatex   example
  mar.iso   texthtmllatex   example
  mtx.exp   texthtmllatex   example
  r.pairs   texthtmllatex   example
  raw.mig   texthtmllatex   example
  regional.rnd.iso  texthtmllatex   example
  rel.cond  texthtmllatex   example
  rel.phi   texthtmllatex   example
  rri   texthtmllatex   example
  sur.freq  texthtmllatex   example
  sur.inbr  texthtmllatex   example
  surnames  texthtmllatex   example
  sym.P texthtmllatex   example
  uri   texthtmllatex   example
  valleytexthtmllatex   example
* DONE (Biodem)

* checking package directory ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking package dependencies ... OK
* checking index information ... OK
* checking package subdirectories ... OK
* checking R files for syntax errors ... OK
* checking R files for library.dynam ... OK
* checking S3 generic/method consistency ... OK
* checking replacement functions ... OK
* checking foreign function calls ... OK
* checking Rd files ... OK
* checking for missing documentation entries ... OK
* checking for code/documentation mismatches ... OK
* checking Rd \usage sections ... OK
* creating Biodem-Ex.R ... OK
* checking examples ... OK
* creating Biodem-manual.tex ... OK
* checking Biodem-manual.tex ... ERROR
LaTeX errors when creating DVI version.
This typically indicates Rd problems.


I cheked the log file in the .Rcheck dir, but it's incomprehensible to
me, so I simply copied and run the tex file itself. The manual won't
compile lamenting it cannot find the Rd.sty file.

locate Rd.sty gives:
/usr/lib/R/share/texmf/Rd.sty

I am completely lost... any advice? do I have to change some path? I am
using R for Debian from  the latest .deb files for Sarge on x86 arch.

Regards,

Federico Calboli

-- 
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St Mary's Campus
Norfolk Place, London W2 1PG

Tel  +44 (0)20 7594 1602 Fax (+44) 020 7594 3193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com

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


[R] the graph gallery strikes back

2005-04-18 Thread Romain Francois
Hello useRs and helpRs,
Some time ago, in a gallaxy far away (here is the thread : 
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46532.html ) we 
discussed about a graph gallery showing the power of R in that domain. I 
did some work around that, and there is a (pretty advanced) draft here :

http://addictedtor.free.fr/graphiques/displayGallery.php
For instance, there are some of my graphs, some of Eric Lecoutre's and 
some coming from demo(graphics), demo(image), demo(persp) and so on.

Pretty soon, I'll add the possibility to  :
- add graphs dynamically from the web
- give a mark to each graph (maybe we can do some stats :) )
- link R function to their help pages from http://finzi.psych.upenn.edu/R
- add references to publications
-  whatever
Please take a look and tell me what should be improved. May the foRce be 
with you.

Romain.
PS1 : Regarding graphs from demo(*), I wrote that author is R 
Development Core Team, maybe those were done by a precise person in the 
Core, in that case tell me and I'll change it.

PS2 : Source code highlighting was done by the highlight software  : ( 
http://www.andre-simon.de/ ) suggested to me by Eric Lecoutre.

--
 ~ 
~~  Romain FRANCOIS - http://addictedtor.free.fr ~~
Etudiant  ISUP - CS3 - Industrie et Services   
~~http://www.isup.cicrp.jussieu.fr/  ~~
   Stagiaire INRIA Futurs - Equipe SELECT  
~~   http://www.inria.fr/recherche/equipes/select.fr.html~~
 ~ 
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] [R-pkgs] RWinEdt 1.7-0 released

2005-04-18 Thread Uwe Ligges
Dear useRs,
RWinEdt_1.7-0 has been released.
Windows users of R-2.1.0 (which is scheduled to be released today) who 
are going to use a translated (i.e. non-english) version of RGui 
together with WinEdt will have to upgrade.

It is not advisable to upgrade RWinEdt for R versions < 2.1.0.
RWinEdt can be used in form of an R package (e.g. by saying 
install.packages("RWinEdt") within R-2.1.0) and as a manually 
installable WinEdt Plug-In.

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


[R] Mac GUI Slow?

2005-04-18 Thread Samuel E. Kemp
Hi,

I have R version 2.0.1 on my PowerBook G4 1.5Ghz, 512RAM, running OS X 
10.3.9. I have noticed that the "official" R GUI runs considerably 
slower than R in the terminal and also JGR. Whilst the differences in 
speed are unimportant for simple parametric stats, it becomes a bit of 
a pig when doing non-parametric stats e.g. neural nets, feature 
selection algorithms.

In all my experiments I have set my CPU speed to "maximum" in system 
preferences. I have also looked at the CPU usage for each 
implementation: on average R in the terminal and JGR manage to get 98% 
of CPU usage, compared to only around 75% for the R GUI.

I guess my questions are:

1) Why the difference in speed when its on the same machine?
2) Is there any way of tweaking R GUI to make it run faster, a la R in 
the terminal?

Any help would be appreciated.

Best regards,

Sam.
[[alternative text/enriched version deleted]]

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


[R] how to use sink.number()

2005-04-18 Thread Michael S
Dear All R-helper,
my question is how to use sink.number.
if I want to  label the output was sinked by sink function how should I do ?
example:
zz <- file("c:\\sinktest1.txt",open="wt")
sink(zz)
g<- 1:10
cat(g,"\n")
f<-list(1:100)
h<-capture.output(f)
cat(h)
sink()
I want there are marks in "sinktest1.txt" files, let me know the number of 
output I get(in this example, there should be 2 mark or number ,becuase I 
using two cat function)

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