Re: [R] ! arithmetic

2003-02-15 Thread David Richmond
you can create your own function: > fact <- function(n) prod(1:n) > fact(3) [1] 6 > fact(10) [1] 3628800 > fact(c(3,4)) [1] 6 Warning message: Numerical expression has 2 elements: only the first used in: 1:n fact() will work for scalars but doesn't do well with vectors. Dave Richmond On Satur

[R] [SUMMARY] Converting coef(lm) to SQL/VBA/etc

2003-02-15 Thread j+rhelp
Many thanks to all who helped with my question last week about how to take the output of lm() and turn it into code that can be run on systems without R (using SQL, C, etc). This is a summary of the answers, caveats, and a solution including a little Perl script I wrote to do this. Brian Ripley po

RE: [R] Help with tabs, and importing data

2003-02-15 Thread Marc Schwartz
>-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED]] On Behalf Of Alan Smith >Sent: Saturday, February 15, 2003 7:05 PM >To: [EMAIL PROTECTED] >Subject: [R] Help with tabs, and importing data > > >Hello, >I am new at using R and I am trying to import data from microarra

[R] multivariate sampling question again

2003-02-15 Thread Peng Zhang
Hi Thanks for replying my question! What really interested me is that the package providing some complex form sampling, such as wishart, multinomial, dirichlet. And others for example conditional beta distribution confining the random variable in the interval (a, b). Since these concept are widely

[R] RMySQL installation and loading errors

2003-02-15 Thread TyagiAnupam
Hi R users, I have been trying to install and use RMySQL on Windows98 for MySQL3.23.55-max using the pulldown menu. I am getting the following errors. I read the doc and some archived mails about a similar problem on unix like systems. Still can't get it to work. Some info below that may indica

[R] __stdcall funcitons called using .C() on win32 chokes

2003-02-15 Thread Jeff D. Hamann
I've developed a dll (win32) of a bunch of functions prototypes as: /* for building on *nix */ #ifndef WIN32 #define __stdcall /*nothing*/ #endif void __stdcall dbh_2_height( const unsigned long*func_idx, const unsigned long*metric, const unsigned long*species, const double

Re: [R] ! arithmetic

2003-02-15 Thread Marc Schwartz
Stan Markus wrote: Since "!" is a logical operator in R, how does one use it in its arithmetic sense, say to calculate x!/y!(N-y)! ? Thanks! Stan You can use gamma(x + 1) for x! or you can use the factorial() function in the gregmisc package on CRAN. See ?gamma for the former option. HTH,

[R] ! arithmetic

2003-02-15 Thread Stan Markus
Since "!" is a logical operator in R, how does one use it in its arithmetic sense, say to calculate x!/y!(N-y)! ? Thanks! Stan - [[alternate HTML version deleted]] __ [EMAIL PROTECTED] mailing list http://

[R] Rgui crash and Macro Magic

2003-02-15 Thread Day, Roger
A consistent Rgui crash (1062 on XP) I was experiencing seemed initially to be solved by following R Win FAQ 2.12: placing a generic microsoft msvcrt.exe in rw1062\bin. But the crash problem quickly reappeared. Exiting Macro Magic, a keyboard macro utility, did solve the problem, apparently perma

[R] create buttons dynamically

2003-02-15 Thread Francisco do Nascimento Junior
Hi,is it right? for (i in 1:length(imagens)) { buts[i] <- tkbutton(tt, text=paste("Figure",i),command=function()show(i)) chk.g[i] <- tkcheckbutton(tt,text="Grafics", variable=grafs[i],command=function()(values[i] <- calcule(i) )) chk.f[i] <- tkcheckbutton(tt,

Re: [R] Change array size

2003-02-15 Thread Jason Turner
On Fri, Feb 14, 2003 at 09:51:38AM +, Poizot Emmanuel wrote: > Hi, > I would like to know if there is a way to change a vector of arbitrary size > to make it fits the nearest upper size multiple of a power of 2. Do you want to interpolate to a new shape, or zero-pad? If zero-padding is what y

[R] Help with tabs, and importing data

2003-02-15 Thread Alan Smith
Hello, I am new at using R and I am trying to import data from microarray experiments and analyze the data using the MAANOVA package and also bioconductor. I have searched this lists email archive and could not find the solution to my problem so hopefully members of this group can help me. OS=w

Re: [R] rownames as parameter in functions

2003-02-15 Thread Spencer Graves
How about the following: > anArray <- array(1:4, dim=c(2,2)) > dimnames(anArray) <- list(c("a", "b"), c("c", "d")) > anArray["a",] c d 1 3 > You can then pass a vector of character strings to the function, and subset the rows by "anArray[select.charvec,]". Alternatively, "anArray[select.charve

[R] rownames as parameter in functions

2003-02-15 Thread Johannes Schnitzler
Dear all, i want to give the names of columns of a data set (dat) as parameter to a function, in order to select single rows by the row names. I tried several ways. Like: the data set : dat A B C D E 1 2 3 1 6 1 4 5 2 4 .. .. .. .. .. the.col.names<-c("A","C") f<-function(par){sapp

Re: [R] logit regression / propensity scores in R

2003-02-15 Thread Frank E Harrell Jr
On Sat, 15 Feb 2003 12:54:22 -0800 (PST) Stan Markus <[EMAIL PROTECTED]> wrote: > > Dear All: > > what R function should be used for logit regression? glm()? And, more > > importantly, is there a function that would calculate the *probability of > > Y given X in the logit framework* (say for p

[R] logit regression / propensity scores in R

2003-02-15 Thread Stan Markus
Dear All: what R function should be used for logit regression? glm()? And, more importantly, is there a function that would calculate the *probability of Y given X in the logit framework* (say for propensity score calculation)? Thanks! Stan - [[

Re: [R] Perl on Windows XP for Rcmd build

2003-02-15 Thread ripley
You do need Windows Perl, but I have only tested ActiveState perl. Cygwin Perl wil not work: it does not understand the Windows paths. We've never seen a problem with ActiveState perl on XP. On 15 Feb 2003, Douglas Bates wrote: > Is there a recommended binary version of perl to use under Windows

Re: [R] Perl on Windows XP for Rcmd build

2003-02-15 Thread A.J. Rossini
Douglas Bates <[EMAIL PROTECTED]> writes: > Is there a recommended binary version of perl to use under Windows XP > for `Rcmd build'? The R FAQ for Windows just mentions "perl". I > think that Kevin Wang's document on R for Windows suggests ActiveState > perl but I have not been able to install

RE: [R] Perl on Windows XP for Rcmd build

2003-02-15 Thread Marc Schwartz
>-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED]] On Behalf Of Douglas Bates >Sent: Saturday, February 15, 2003 12:52 PM >To: [EMAIL PROTECTED] >Subject: [R] Perl on Windows XP for Rcmd build > > >Is there a recommended binary version of perl to use under >Windows X

Re: [R] (no subject)

2003-02-15 Thread Peter Dalgaard BSA
Peter Dalgaard BSA <[EMAIL PROTECTED]> writes: > This was discussed here in October. For the multivariate T you can use > >rmvt <- function(corr,df) > rmvnorm(n,sigma=corr)/sqrt(rchisq(n,df)/df) > > (R.Koenker, correcting my suggestion). I believe rmvnorm came from the > mvtnorm

Re: [R] (no subject)

2003-02-15 Thread Peter Dalgaard BSA
Peng Zhang <[EMAIL PROTECTED]> writes: > Hi, > > Are there some packages which can generate multi-normal, multi-t, etc > multivariate sampling? thanks! > > Best wishes, > Peng This was discussed here in October. For the multivariate T you can use rmvt <- function(corr,df) rmvnor

Re: [R] (no subject)

2003-02-15 Thread Jerome Asselin
For multivariate normal and t distribution, install and try package "mvtnorm". Then look for ?rmvnorm and ?rmvt. Jerome On Saturday 15 February 2003 10:48, Peng Zhang wrote: > Content-Length: 501 > Status: R > X-Status: N > > Hi, > > Are there some packages which can generate multi-normal, multi

Re: [R] how to do regression analysis for multiple dependent variablesat once

2003-02-15 Thread Thomas Lumley
On Sat, 15 Feb 2003, Jonathan Baron wrote: > > lm(cbind(d1,d2,d3,d4,d5)~x1*x2) > > This is because the dependent variable in lm() can be a matrix > instead of a vector. > > It says this in "In introduction to R" under "Formula for > statistical models." But I could not find this in the help page >

Re: [R] Type of multi-valued variable

2003-02-15 Thread Frank E Harrell Jr
On Sat, 15 Feb 2003 14:41:09 +0100 Fan <[EMAIL PROTECTED]> wrote: > Thanks to Frank for pointing out that. There're so many "misc" in the > package hmisc, I haven't yet explored all the functionalities ! > > The implementation of mChoice / summary() is very interesting, and it could > be a good

[R] Perl on Windows XP for Rcmd build

2003-02-15 Thread Douglas Bates
Is there a recommended binary version of perl to use under Windows XP for `Rcmd build'? The R FAQ for Windows just mentions "perl". I think that Kevin Wang's document on R for Windows suggests ActiveState perl but I have not been able to install it. I am running Windows XP Professional on a la

[R] (no subject)

2003-02-15 Thread Peng Zhang
Hi, Are there some packages which can generate multi-normal, multi-t, etc multivariate sampling? thanks! Best wishes, Peng *** Peng Zhang Department of Biostatistics Harvard School of Public Health 655 Huntington Avenue Boston, Massachusetts 02115

Re: [R] tests for spericity

2003-02-15 Thread ripley
I can guess you meant `sphericity', but you didn't tell us of what. Note that the `analysis of variance' is an algorithm to partition sums of squares, and that makes no such assumption. I suspect that you could do what you want in lme (package nlme), if you were able to specify it unambiguously.

Re: [R] RMySQL

2003-02-15 Thread r meeks
Thank you - it works great now. From: [EMAIL PROTECTED] To: r meeks <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: [R] RMySQL Date: Sat, 15 Feb 2003 17:14:50 + (GMT) dlltool is part of the compiler set, so that's where your troubles begin. However, the instructions are not those fo

[R] tests for spericity

2003-02-15 Thread Corey Moffet
Dear R-help, Does any one know of a function/package in R that will test the assumption of spericity in a split-plot analysis of variance? How are people dealing with this issue in R? With best wishes and kind regards I am Sincerely, Corey A. Moffet Support Scientist University of Idaho North

Re: [R] RMySQL

2003-02-15 Thread ripley
dlltool is part of the compiler set, so that's where your troubles begin. However, the instructions are not those for the binary install. All you need to do is to get RMySQL.zip from CRAN and put RMySQL/libs/libmysql.dll somewhere in your path. On Sat, 15 Feb 2003, r meeks wrote: > I don't know

Re: [R] print with no array index

2003-02-15 Thread Thomas W Blackwell
Hiroyuki - Function write() with "" as its second argument might do what you want. This function does not check the "dims" attribute of its first argument, so you have to set that explicitly. See help(write), help(format), help(cat). Seems unfortunate that help(print) does not point backw

Re: [R] RMySQL

2003-02-15 Thread Uwe Ligges
r meeks wrote: I don't know if this is the proper forum but here goes: I'm trying to install the RMySQL library under Windows XP. The instructions say to use reimp to create an R-compatible MySQL library file "libmysql.dll" but when I try to run reimp I get the error "reimp: dlltool: No such

RE: [R] print with no array index

2003-02-15 Thread Marc Schwartz
>-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED]] On Behalf Of Hiroyuki Kawakatsu >Sent: Saturday, February 15, 2003 10:45 AM >To: [EMAIL PROTECTED] >Subject: [R] print with no array index > > >hi, > >can someone tell me an easy way to print arrays interactively >wi

[R] RMySQL

2003-02-15 Thread r meeks
I don't know if this is the proper forum but here goes: I'm trying to install the RMySQL library under Windows XP. The instructions say to use reimp to create an R-compatible MySQL library file "libmysql.dll" but when I try to run reimp I get the error "reimp: dlltool: No such file or director

[R] print with no array index

2003-02-15 Thread Hiroyuki Kawakatsu
hi, can someone tell me an easy way to print arrays interactively without printing the array index? for example, instead of > print("foo",quote=FALSE) [1] foo i want foo thanks, h. Time series regression studies give no sign

Re: [R] ESRI shape file import and time-space models

2003-02-15 Thread Fan
For reading dBase file on Windows, one can use ODBC with the following wrapper function if fast loading is an important issue: odbc.dbase <- function(dbf.file, rownames=FALSE) { connstr <- paste("Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=", getwd(), sep="") o <- odbcDriverConn

Re: [R] Type of multi-valued variable

2003-02-15 Thread Fan
Thanks to Frank for pointing out that. There're so many "misc" in the package hmisc, I haven't yet explored all the functionalities ! The implementation of mChoice / summary() is very interesting, and it could be a good starting point for adding more functionalities on the class mChoice. I'm hav

Re: [R] how to do regression analysis for multiple dependent variables at once

2003-02-15 Thread Jonathan Baron
On 02/15/03 14:08, Hiroto Miyoshi wrote: >Dear R-users > >I have, say, 5 dependent variables, d1 to d5. >And I also have 2 independent variable x1, x2. >Suppose I need to do regression analyses for all >the dependent variables, using the same set >of independent variables, x1 and x2. > >How can I

[R] How to code a bootstrap version of the Wilcoxon-Mann-Whitney test (and variants)?

2003-02-15 Thread Strecker, Stefan
Hello, can someone please help me with coding a function for a bootstrap WMW test (package boot, R under Windows, version 1.6.2)? >From reading the RNews article on the boot package I understand that I have to supply >the boot command with a function to calculate the test statistic but I have

Re: [R] matrix from sequences

2003-02-15 Thread Roger Bivand
On Fri, 14 Feb 2003, Miha STAUT wrote: > >Hi, Miha: > > > >1. How do I get the GRASS library? "library(GRASS)" produced "Error in > >library(GRASS) : There is no package called `GRASS'" for me from R 1.6.2 > >for Windows. > > I do not know whether it exists for Windows or not, but look under: