Re: [R] Install problem on Solaris 9

2005-04-20 Thread Prof Brian Ripley
You need to see the config.log for foreign. To do so, please 1) unpack src/library/Recommended/foreign.tgz in say /tmp 2) Run /path/to/R_HOME/bin/R CMD INSTALL /tmp/foreign 3) Look in /tmp/foreign/config.log HOWEVER, you still seem to have -m64 in foreign.ts.out: R is not going to have put that

Re: [R] Label / Tick under single Boxplot

2005-04-20 Thread Werner Wernersen
>>Hi! >> >>I am trying to get the tick / label under a stacked >>boxplot with only a single >>data row. With >=2 rows it works, but with a single >>one the tick resp. my class >>name is not printed below the boxplot. Can anybody >>point me to what am I doing >>wrong? >> >>For example: >>boxplot(

Re: [R] cross validation and parameter determination

2005-04-20 Thread Ramon Diaz-Uriarte
On Wednesday 20 April 2005 00:17, array chip wrote: > Hi all, > > In Tibshirani's PNAS paper about nearest shrunken > centroid analysis of microarrays (PNAS vol 99:6567), > they used cross validation to choose the amount of > shrinkage used in the model, and then test the > performance of the model

RE: [R] Help with predict.lm

2005-04-20 Thread Ted Harding
Sorry, I was doing this too late last night! All stands as before except for the calculation at the end which is now corrected as follows: On 19-Apr-05 Ted Harding wrote: [code repeated for reference] > The following function implements the above expressions. > It is a very crude approach to solvi

[R] results from sammon()

2005-04-20 Thread Domenico Cozzetto
Dear all, I'm trying to get a two dimensional embedding of some data using different meythods, among which princomp(), cmds(), sammon() and isoMDS(). I have a problem with sammon() because the coordinates I get are all equal to NA. What does it mean? Why the method fails in finding the coordinates?

[R] Put one random row dataset to first cell variable

2005-04-20 Thread Jan Sabee
Dear useR help, This is below my toy dataset, age married income gender young nolow female old yeslow female mid no high female young yes high female mid yes high female mid no medium female old no medium female young yes mediu

[R] Fits & splines

2005-04-20 Thread Eric-Olivier Le Bigot
Hello all, Do you know of convenient functions that can do: 1) a fit "f(x)" of data points with a spline, and *then* 2) weighted fits of other data points ** with a model of the form a*f(x-x0) **? [i.e., the goal is to find a and x0, ideally with their covariance matrix], and 3) if possible,

Re: [R] Put one random row dataset to first cell variable

2005-04-20 Thread Dimitris Rizopoulos
maybe something like this could be helpful f <- function(..., ref){ lis <- list(...) for(i in seq(along=lis)){ x <- lis[[i]] r <- match(ref[i], x) lis[[i]] <- x[c(r, seq(along=x)[-r])] } lis } # age <- c("young", "mid", "old") married <- c("no", "yes") incom

Re: [R] results from sammon()

2005-04-20 Thread Jari Oksanen
On Wed, 2005-04-20 at 10:35 +0200, Domenico Cozzetto wrote: > Dear all, > I'm trying to get a two dimensional embedding of some data using different > meythods, among which princomp(), cmds(), sammon() and isoMDS(). I have a > problem with sammon() because the coordinates I get are all equal to NA.

Thanks! (Was: Re: [R] R-2.1.0 is released)

2005-04-20 Thread Bjørn-Helge Mevik
I'd like to thank the developers in the Core Team for their great work! R has become an invaluable and indispensible tool for (at least) me, much thanks to the hard and good work of the Core Team. -- Bjørn-Helge Mevik __ R-help@stat.math.ethz.ch maili

Re: [R] Put one random row dataset to first cell variable

2005-04-20 Thread Jan Sabee
Yes, this is exactly what I want. Many thanks and best regards, Jan Sabee On 4/20/05, Dimitris Rizopoulos <[EMAIL PROTECTED]> wrote: > maybe something like this could be helpful > > f <- function(..., ref){ > lis <- list(...) > for(i in seq(along=lis)){ > x <- lis[[i]] >

[R] how to get code of a .Internal() function?

2005-04-20 Thread Alban
Hello, I'm working with the function optim() from stats package, and inside this function is called the function .Internal(optim()) and I want to get the code of this function which would help me to understand why the Nelder-Mead algorithm doesn't converge with my data. I'm working under Windo

I: [R] results from sammon()

2005-04-20 Thread Domenico Cozzetto
Thanks for the attention paid to my rpoblem. Please find enclosed the matrix with my dissimilarities. This is the only case in which sammon(), from the MASS package, gives me this kind of problems. Domenico > > > -Messaggio originale- > > Da: Jari Oksanen [mailto:[EMAIL PROTECTED] > > Invi

Re: [R] how to get code of a .Internal() function?

2005-04-20 Thread Roger Bivand
On Wed, 20 Apr 2005, Alban wrote: > Hello, > > I'm working with the function optim() from stats > package, > and inside this function is called the function > .Internal(optim()) and I want to get the code of > this function which would help me to understand why > the Nelder-Mead algorithm doe

[R] expandable tree visualization

2005-04-20 Thread Zhesi He
Hi, Sorry if the answer is really simple. But I'm looking for a expandable tree visualisation (like file organisation with plus or minus sign on the left to expand the tree). As the file is quite big. ~12000 rows. and with possible 5 layers (so there are index numbers like 1.1.1.1.1 to make the

Re: [R] Put one random row dataset to first cell variable

2005-04-20 Thread Jim Lemon
Jan Sabee wrote: Dear useR help, This is below my toy dataset, age married income gender young nolow female old yeslow female mid no high female young yes high female mid yes high female mid no medium female old no medium female you

Re: [R] Help with predict.lm

2005-04-20 Thread Ted Harding
On 20-Apr-05 Mike White wrote: > Ted > Thank you for giving me so much of your time to provide > an explanation of the likelihood ratio approach to the > calibration problem. It has certainly provided me with a > new insight into this problem. I will check out the > references you mentioned to get

[R] heckit / tobit estimation

2005-04-20 Thread Arne Henningsen
Dear All, we (Ott Toomet and I) would like to add functions for maximum likelihood (ML) estimations of generalized tobit models of type 2 and type 5 (*see below) in my R package for microeconomic analysis "micEcon". So far we have called these functions "tobit2( )" and "tobit5( )". Are these

Re: [R] Put one random row dataset to first cell variable

2005-04-20 Thread Jan Sabee
Many thanks Jim. This is the others kind of a random row which I can use. Best wishes, Jan Sabee > Assumptions: > 1) the object is a data frame. > 2) all variables are factors (although I have CMA). > 3) you want a list containing vectors of the levels for each value in > which the first level is

[R] if(foo == TRUE) .. etc

2005-04-20 Thread Martin Maechler
> "Andy" == Andy Bunn <[EMAIL PROTECTED]> > on Tue, 19 Apr 2005 10:27:04 -0400 writes: . Andy> is.tuesday <- as.POSIXlt(Sys.time())$wday == 2 Andy> if (is.tuesday == T) { } . aaah, this really hurts my eyes or rather the brain behind! And it's by far not t

Re: [R] heckit / tobit estimation

2005-04-20 Thread Achim Zeileis
Arne: > we (Ott Toomet and I) would like to add functions for maximum > likelihood (ML) estimations of generalized tobit models of type 2 and > type 5 (*see below) in my R package for microeconomic analysis > "micEcon". So far we have called these functions "tobit2( )" and > "tobit5( )". Are the

Re: [R] if(foo == TRUE) .. etc

2005-04-20 Thread Peter Dalgaard
Martin Maechler <[EMAIL PROTECTED]> writes: > 'T' and 'F' instead of 'TRUE' and 'FALSE' - > which is against all recommendations, since > F <- TRUE > T <- FALSE > are valid statements, probably not common, but think what > happens when you accidentally have the equivalent of "T <- 0" > s

Re: [R] how to get code of a .Internal() function?

2005-04-20 Thread Duncan Murdoch
This is really an R-devel question, but R-help readers may have wondered about this. Alban wrote: Hello, I'm working with the function optim() from stats package, and inside this function is called the function .Internal(optim()) and I want to get the code of this function which would help me

Re: [R] if(foo == TRUE) .. etc

2005-04-20 Thread Achim Zeileis
On Wed, 20 Apr 2005 14:30:49 +0200 Martin Maechler wrote: > > "Andy" == Andy Bunn <[EMAIL PROTECTED]> > > on Tue, 19 Apr 2005 10:27:04 -0400 writes: > > . > Andy> is.tuesday <- as.POSIXlt(Sys.time())$wday == 2 > Andy> if (is.tuesday == T) { } > . > > aaah,

Re: [R] Label / Tick under single Boxplot

2005-04-20 Thread Martin Maechler
> "Marc" == Marc Schwartz <[EMAIL PROTECTED]> > on Tue, 19 Apr 2005 21:26:47 -0500 writes: Marc> On Wed, 2005-04-20 at 02:08 +0200, Werner Wernersen wrote: >> Hi! >> >> I am trying to get the tick / label under a stacked >> boxplot with only a single >> data r

Re: [R] if(foo == TRUE) .. etc

2005-04-20 Thread Rolf Turner
Martin Maechler wrote: > More generally, please, please, everyone : > > Replace > if (something == TRUE) > withif (something) > and > if (something.or.other == FALSE) > withif (!something.or.other) Amen! And right on! And you tell 'em!

Re: [R] heckit / tobit estimation

2005-04-20 Thread Arne Henningsen
On Wednesday 20 April 2005 14:31, Achim Zeileis wrote: > Arne: > > we (Ott Toomet and I) would like to add functions for maximum > > likelihood (ML) estimations of generalized tobit models of type 2 and > > type 5 (*see below) in my R package for microeconomic analysis > > "micEcon". So far we ha

[R] Tips for a longtime S-Plus user moving to R

2005-04-20 Thread Kevin E. Thorpe
Greetings. I have been using S-Plus for many years now (>13) and have recently started to use R as well. I have been interested in R for sometime, but until recently, have not been in a position to devote much time to it, but I digress. Besides some of the more technical differences between R

[R] Chi² - test for a distribution

2005-04-20 Thread Carsten Steinhoff
Hi all, I’ve to solve the following problem: I have a dataset with count data. For these data I’ve chosen some standard distributions (poisson, negBin, Bin) and have estimated the parameters. Now I want to execute a X²-Test of the contingency table vs. the parameterized distribution. Ok

Re: [R] heckit / tobit estimation

2005-04-20 Thread Arne Henningsen
On Wednesday 20 April 2005 14:48, you wrote: > For what it is worth, I agree fully with Achim's view of naming > conventions, and also feel that it would be nice to connect these > fitting methods with the survival stuff, just to cut down on the sense > that econometrics and biostatistics represe

[R] Anova - adjusted or sequential sums of squares?

2005-04-20 Thread michael watson \(IAH-C\)
Hi I am performing an analysis of variance with two factors, each with two levels. I have differing numbers of observations in each of the four combinations, but all four combinations *are* present (2 of the factor combinations have 3 observations, 1 has 4 and 1 has 5) I have used both anova(aov

Re: [R] Help with predict.lm

2005-04-20 Thread Mike White
Ted Thank you for giving me so much of your time to provide an explanation of the likelihood ratio approach to the calibration problem. It has certainly provided me with a new insight into this problem. I will check out the references you mentioned to get a better understanding of the statistics.

Re: [R] Label / Tick under single Boxplot

2005-04-20 Thread Marc Schwartz
On Wed, 2005-04-20 at 11:08 +0100, Prof Brian Ripley wrote: > On Wed, 20 Apr 2005, Werner Wernersen wrote: > > > I also tried to look into the source code of boxplot() > > but when I type "boxplot" > > R returns only > > > > function (x, ...) > > UseMethod("boxplot") > > > > > > instead of the fu

[R] results from sammon()

2005-04-20 Thread Domenico Cozzetto
Thanks for the attention paid to my rpoblem. Please find enclosed the matrix with my dissimilarities. This is the only case in which sammon(), from the MASS package, gives me this kind of problems. I'm using the implementation of sammon provided by the package MASS and the starting configuration is

RE: [R] Anova - adjusted or sequential sums of squares?

2005-04-20 Thread Liaw, Andy
> From: michael watson (IAH-C) > > Hi > > I am performing an analysis of variance with two factors, > each with two > levels. I have differing numbers of observations in each of the four > combinations, but all four combinations *are* present (2 of the factor > combinations have 3 observations,

Re: [R] Anova - adjusted or sequential sums of squares?

2005-04-20 Thread Douglas Bates
michael watson (IAH-C) wrote: Hi I am performing an analysis of variance with two factors, each with two levels. I have differing numbers of observations in each of the four combinations, but all four combinations *are* present (2 of the factor combinations have 3 observations, 1 has 4 and 1 has 5

[R] overlaying a contour line in a levelplot

2005-04-20 Thread Jorge Ahumada
Hello there, I am creating a series of images using levelplot but I also want to overlay a contour for a particular value as reference. Here is the levelplot command for the image: print(levelplot(d~x+y,data=t,cuts=20,scales=list(draw=F),xlab=NULL,ylab= NULL,col.regions=heat.colors(100)[100:1

RE: [R] Anova - adjusted or sequential sums of squares?

2005-04-20 Thread michael watson \(IAH-C\)
Thanks for the response. Answers to your questions in turn: My null hypothesis is that these is no difference between the treatment means. I guess that makes my alternative there is a difference. I understand all about interactions, and yes, there's an interaction term in my model. Moreover, i

[R] problem with RODBC

2005-04-20 Thread Dave Evens
Dear all, I'm reading data via the RODBC connection using odbcConnectExcel. I use sqlFetch(channel, "sheetx") to identify the correct tab. It appears to read the data without any problems. However, when I exact a portion of data - the row number specified is 1 less than in the actual excel file a

Re: [R] results from sammon()

2005-04-20 Thread Jari Oksanen
On Wed, 2005-04-20 at 12:35 +0200, Domenico Cozzetto wrote: > Thanks for the attention paid to my rpoblem. Please find enclosed > the matrix with my dissimilarities. This is the only case in > which sammon(), from the MASS package, gives me this kind of problems. > I'm using the implementation of s

RE: [R] problem with RODBC

2005-04-20 Thread michael watson \(IAH-C\)
> the row number specified is 1 less than in the actual excel file At a guess I'd say this is because the row 1 in excel is taken as the column heads for the data in R __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r

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

2005-04-20 Thread Luke Tierney
I hope to be making some substantial progress on this over summer. But I would not hold up any projects in anticipation of major R changes--the current recommended strategy of first writing something that is correct, profiling to find out where a performance problem is if there is one, and then (ma

RE: [R] Anova - adjusted or sequential sums of squares?

2005-04-20 Thread michael watson \(IAH-C\)
I guess the real problem is this: As I have a different number of observations in each of the groups, the results *change* depending on which order I specify the factors in the model. This unnerves me. With a completely balanced design, this doesn't happen - the results are the same no matter wh

Re: [R] overlaying a contour line in a levelplot

2005-04-20 Thread Deepayan Sarkar
On Wednesday 20 April 2005 09:16, Jorge Ahumada wrote: > Hello there, > > I am creating a series of images using levelplot but I also want to > overlay a contour for a particular value as reference. Here is the > levelplot command for the image: > > print(levelplot(d~x+y,data=t,cuts=20,scales=list(

[R] fSeries rsiTA. Need help to modify function

2005-04-20 Thread Neuro LeSuperHéros
fSeries rsiTA. Need help to modify function Hello, in fSeries, the rsiTA function is this: function (close, lag) { sumlag = function(x, lag) { xs = x for (i in 1:lag) { x1 = c(x[1], x[1:(length(x) - 1)]) xs = xs + x1 x = x1 } xs }

RE: [R] Anova - adjusted or sequential sums of squares?

2005-04-20 Thread John Fox
Dear Mick, The Anova() function in the car package will compute what are often called "type-II" and "-III" sums of squares. Without wishing to reinvigorate the sums-of-squares controversy, I'll just add that the various "types" of sums of squares correspond to different hypotheses. The hypothese

Re: [R] Anova - adjusted or sequential sums of squares?

2005-04-20 Thread Douglas Bates
Michael Watson (IAH-C) wrote: I guess the real problem is this: As I have a different number of observations in each of the groups, the results *change* depending on which order I specify the factors in the model. This unnerves me. With a completely balanced design, this doesn't happen - the resu

[R] Habituation model : several sequences in several sessions, should I use getGroups?

2005-04-20 Thread Laurent Fanchon
Dear all, I am looking at habituation of dogs trotting on a treadmill. Each record is made of 40 to 50 data for the same variable (for example Peak). I get each record at several minutes (1, 2 and 4) for each session. And I have 4 sessions of training (one session a week). The aim is to study th

[R] sam analysis question

2005-04-20 Thread lettieri
I'm running SAM in R package, I am analysing two affy array's groups data (two conditions in 3 separate pairs). I am using SAM starting from a filtered list containing 3000 genes but I had some problems. Infact when I analyze the delta table I have the number of the false positives that drasticall

Re: [R] Anova - adjusted or sequential sums of squares?

2005-04-20 Thread Peter Dalgaard
"michael watson (IAH-C)" <[EMAIL PROTECTED]> writes: > I guess the real problem is this: > > As I have a different number of observations in each of the groups, the > results *change* depending on which order I specify the factors in the > model. This unnerves me. With a completely balanced des

RE: [R] Anova - adjusted or sequential sums of squares?

2005-04-20 Thread Prof Brian Ripley
On Wed, 20 Apr 2005, michael watson (IAH-C) wrote: I guess what I want to know is if I use the type I sequential SS, as reported by R, on my factorial anova which is unbalanced, am I doing something horribly wrong? I think the answer is no. Sort of. You really should test a hypothesis at a time.

[R] Histogram

2005-04-20 Thread Mag. Ferri Leberl
Dear everybody! I am analysing data from an enquette. The answers are either A or B. How can I draw a histogram without transforming the data from characters to numbers? If the data are saved in a list M, hist(M[,1]) returns: Error in hist.default(M[, 1]) : `x' must be numeric Execution halted

[R] Keeping factors with zero occurrences in "table" output

2005-04-20 Thread Ravi Varadhan
Dear R group, I have a data frame which contains data on preferences on 7 items (ranks 1 through 7) listed by each participant. I would like to tabulate this in a 7x7 table where the rows would be the items and the columns would be the number of times that item received a particular rank.

RE: [R] Anova - adjusted or sequential sums of squares?

2005-04-20 Thread Thomas Lumley
On Wed, 20 Apr 2005, michael watson (IAH-C) wrote: I guess the real problem is this: As I have a different number of observations in each of the groups, the results *change* depending on which order I specify the factors in the model. This unnerves me. With a completely balanced design, this does

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

2005-04-20 Thread Jason Liao
Dear Prof. Tierney, Thank for very much for replying and we all appreciate what you have done for the R community. Currently I have been spoiled by R. I would love to be 100% R. I talked to Andy Liaw yesterday about how to make R faster. Maybe we need to explicitly declare variables in the critic

RE: [R] Anova - adjusted or sequential sums of squares?

2005-04-20 Thread Ted Harding
On 20-Apr-05 michael watson \(IAH-C\) wrote: > I guess the real problem is this: > > As I have a different number of observations in each of the > groups, the results *change* depending on which order I > specify the factors in the model. This unnerves me. With a > completely balanced design, thi

Re: [R] Histogram

2005-04-20 Thread Achim Zeileis
On Wed, 20 Apr 2005 17:37:04 +0200 Mag. Ferri Leberl wrote: > Dear everybody! > I am analysing data from an enquette. The answers are either A or B. > How can I draw a histogram without transforming the data from > characters to numbers? If the data are saved in a list M, hist(M[,1]) > returns: >

[R] problem with DCOM server in R 2.1.0

2005-04-20 Thread Adrian Dragulescu
Hello list, I just installed R 2.1.0. When I try to run the "Server 01 - Basic test" I get the error "Fatal error: unable to open the base package". Any solution? Thank you, Adrian Dragulescu __ R-help@stat.math.ethz.ch mailing list https://stat.eth

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

2005-04-20 Thread Luke Tierney
It is quite likely that we will move in a direction of supporting annotations or declarations of some sort as well--at least that is one of the things I am planning to investigate. I believe there is still some room for improvement without this, but larger improvements will I believe require some

Re: [R] Histogram

2005-04-20 Thread Peter Dalgaard
"Mag. Ferri Leberl" <[EMAIL PROTECTED]> writes: > Dear everybody! > I am analysing data from an enquette. The answers are either A or B. How can > I > draw a histogram without transforming the data from characters to numbers? If > the data are saved in a list M, hist(M[,1]) returns: > > Error

[R] newby trying to solve a system

2005-04-20 Thread Olivier ETERRADOSSI
Dear R-gurus, being very new to R, (as well as lazy and not too smart !) I have some problems (and get lost in the docs) trying to write something to find the 9 values (A1,B1,C1,A2,B2,C2C3) which are solutions of a 12 equations system of the form : > x1-(A1/(A1+B1+C1)) = 0 > y1-(B1/(A1+B1+C

RE: [R] Histogram

2005-04-20 Thread Liaw, Andy
> From: Mag. Ferri Leberl > > Dear everybody! > I am analysing data from an enquette. The answers are either > A or B. How can I > draw a histogram without transforming the data from > characters to numbers? If > the data are saved in a list M, hist(M[,1]) returns: > > Error in hist.default(M

Re: [R] Keeping factors with zero occurrences in "table" output

2005-04-20 Thread Achim Zeileis
On Wed, 20 Apr 2005 11:38:13 -0400 Ravi Varadhan wrote: > Dear R group, > > > > I have a data frame which contains data on preferences on 7 items > (ranks 1 through 7) listed by each participant. I would like to > tabulate this in a 7x7 table where the rows would be the items and the > column

RE: [R] Keeping factors with zero occurrences in "table" output

2005-04-20 Thread Wiener, Matthew
Ravi -- If you use table on a factor, you'll get 0's if appropriate: > table(sample(1:5, 10, replace = TRUE)) #no 2's, by chance 1 3 4 5 3 1 2 4 > table(sample(1:5, 20, replace = TRUE)) # no 6's here, so 6 doesn't show up 1 2 3 4 5 3 5 2 5 5 ## now make it a factor, and you get 0 3's an

[R] Special Offer from the Xandria Collection!

2005-04-20 Thread Xandria Collection
Free Shipping and SPRING FEVER Sale at Xandria.com Receive FREE SHIPPING on all orders placed using this link! (http://www.xandria.com/promo-pages/spring2005.asp?aid=SEL_042005) 2-day air orders will be a flat rate of $14 when using the FREE SHIPPING link. Just in case you missed it, April

RE: [R] Keeping factors with zero occurrences in "table" output

2005-04-20 Thread Liaw, Andy
If you make them into factors, the empty ones should show up: > f1 <- sample(1:7, 10, replace=TRUE) > f2 <- sample(1:6, 10, replace=TRUE) > table(f1, f2) f2 f1 1 2 3 5 6 1 0 0 1 0 0 2 0 0 1 0 0 3 0 0 2 1 0 4 0 1 0 0 1 5 1 1 0 0 0 7 0 0 0 1 0 > ff1 <- factor(f1, levels=1:7) > ff2 <-

[R] Package under R 2.1.0: package.rds

2005-04-20 Thread huan . huang
Hi everybody, I have trouble installing my own package under R 2.1.0 (it is fine under R 2.0.1). My OS is Windows NT. I installed my package 'mag' by using menu "Packages/Install package from local zip files". It's fine (html package description was updated). But when I typed in library(mag)

RE: [R] Keeping factors with zero occurrences in "table" output

2005-04-20 Thread Ravi Varadhan
Thanks very much to Achim Zeileis, Matt Weiner, and Andy Liaw for their solution. Declaring preferences as a "factor" worked! Best, Ravi. -- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division

[R] window closed

2005-04-20 Thread Yoko Nakajima
Hello, The editor of R will close after I enter the following commands. I do not know the reason at all. When does this happen? I would very appreciate it if you could let me know. Sincerely. = gam <- matrix(scan("C:/Documents and Settings/Yoko N/Desktop/R/sas2.txt"), ncol = 29) Read 38413

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

2005-04-20 Thread Nestor Fernandez
Dear all, Thanks for the responses to this post. I understand that the topic still requires more research. However, I am a non-statistician in a desperate need to analyze my ecological data with the currently available tools. Please excuse again my non-expert question: Would I commit a huge mista

[R] A question about function behavior

2005-04-20 Thread Jorge Ahumada
Hello, I have been trying to figure this one out, but don't seem to go anywhere. I have a function like this: a = function(t) { max(0,t+1) } very simple, but if I pass a vector of n values to this function I expect n evaluations of max and instead I get only one value (the largest value of them

RE: [R] Histogram

2005-04-20 Thread Neuro LeSuperHéros
As Achim said, I would use a barplot instead of an hist. Here's how I would do it: vect<-c("a","b","a","b","b","b","a","a","a") a<-length(vect[vect=="a"]) b<-length(vect[vect=="b"]) barplot(c(a,b),names.arg=(c("A","B"))) Neuro the Super Hero From: "Mag. Ferri Leberl" <[EMAIL PROTECTED]> Reply-To: [

Re: [R] problem with DCOM server in R 2.1.0

2005-04-20 Thread Prof Brian Ripley
This is the wrong list for DCOM questions. Please check the archives: you are not the first to use the wrong list (although it is rare). Or just look at the html page where you got the server. On Wed, 20 Apr 2005, Adrian Dragulescu wrote: I just installed R 2.1.0. When I try to run the "Server

Re: [R] newby trying to solve a system

2005-04-20 Thread Spencer Graves
Have you considered multiplying the first set of equations by the denominator to convert them to something like the following: x1*(A1+B1+C1)-A1=0. This will give you 12 equations in 9 unknowns. For this, "lm" will give you the least squares solution. If the system has a singl

Re: Thanks! (Was: Re: [R] R-2.1.0 is released)

2005-04-20 Thread Spencer Graves
Permit me to echo Bjørn-Helge Mevik's thanks. I've been telling people that R is rapidly becoming the platform of choice for new statistical algorithm development for many reasons. * First, it gives someone almost instant access to many of the leading international experts in s

RE: [R] window closed

2005-04-20 Thread Liaw, Andy
> From: Yoko Nakajima > > Hello, > > The editor of R will close after I enter the following > commands. I do not know the reason at all. When does this > happen? I would very appreciate it if you could let me know. > > Sincerely. > = > gam <- matrix(scan("C:/Documents and Settings/Yoko >

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

2005-04-20 Thread Peter Dalgaard
Luke Tierney <[EMAIL PROTECTED]> writes: > Vectorized operations in R are also as fast as compiled C (because > that is what they are :-)). A compiler such as the one I'm working on > will be able to make most difference for non-vectorizable or not very > vectorizable code. It may also be able t

Re: [R] A question about function behavior

2005-04-20 Thread A.J. Rossini
Perhaps by using apply? What do you think that max(0,c(1,2,3,4)+1) should return? On 4/20/05, Jorge Ahumada <[EMAIL PROTECTED]> wrote: > Hello, > > I have been trying to figure this one out, but don't seem to go > anywhere. I have a function like this: > > a = function(t) { > > max(0,t+1

RE: [R] A question about function behavior

2005-04-20 Thread Liaw, Andy
> From: Jorge Ahumada > > Hello, > > I have been trying to figure this one out, but don't seem to go > anywhere. I have a function like this: > > a = function(t) { > > max(0,t+1) > > } > > very simple, but if I pass a vector of n values to this function I > expect n evaluations of max and i

RE: [R] A question about function behavior

2005-04-20 Thread McGehee, Robert
Sure. Here are three ways. Using pmax() is probably the most elegant. a <- function(t) { pmax(t + 1, 0) } OR a <- function(t) { sapply(t + 1, max, 0) } OR a <- function(t) { t <- t + 1 t[which(t < 0)] <- 0 t } -Original Message- From: Jorge Ahu

RE: [R] A question about function behavior

2005-04-20 Thread davidr
?pmax David L. Reiner -Original Message- From: Jorge Ahumada [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 20, 2005 12:03 PM To: r-help@stat.math.ethz.ch Subject: [R] A question about function behavior Hello, I have been trying to figure this one out, but don't seem to go anywhere.

[R] Re: your unsubscribe request

2005-04-20 Thread Lyris ListManager
As you requested, you have been unsubscribed from 'xandriaselect'. --- Return-Path: <[EMAIL PROTECTED]> Received: from wproxy.gmail.com ([64.233.184.201]) by lyris.xandria.com with SMTP (Lyris ListManager WIN32 version 7.0b); Wed, 20 Apr 2005 11:45:52 -0800 Received: by wproxy.gmail.com with SMT

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

2005-04-20 Thread Prof Brian Ripley
On Wed, 20 Apr 2005, Nestor Fernandez wrote: Dear all, Thanks for the responses to this post. I understand that the topic still requires more research. However, I am a non-statistician in a desperate need to analyze my ecological data with the currently available tools. Please excuse again my non

Re: [R] A question about function behavior

2005-04-20 Thread Alexandre Brito
I think you want this: b<- function(t) {pmax(0,t+1)} alex - Original Message - From: "Jorge Ahumada" <[EMAIL PROTECTED]> To: Sent: Wednesday, April 20, 2005 6:02 PM Subject: [R] A question about function behavior > Hello, > > I have been trying to figure this one out, but don't seem

[R] Assign factor and levels inside function

2005-04-20 Thread Tim Howard
R-help, After cogitating for a while, I finally figured out how to define a data.frame column as factor and assign the levels within a function... BUT I still need to pass the data.frame and its name separately. I can't seem to find any other way to pass the name of the data.frame, rather than th

RE: [R] Anova - adjusted or sequential sums of squares? - An example

2005-04-20 Thread Berton Gunter
Folks: At the great risk of having my ignorance publicly displayed, let me say: 1) I enjoyed and learned from the discussion; 2) I especially enjoyed WNV's paper linked by BDR -- I enjoyed both the wisdom of the content and the elegance and humor of style. Good writing is a rare gift. Anyway, I

Re: [R] A question about function behavior

2005-04-20 Thread Sundar Dorai-Raj
Jorge Ahumada wrote on 4/20/2005 12:02 PM: Hello, I have been trying to figure this one out, but don't seem to go anywhere. I have a function like this: a = function(t) { max(0,t+1) } very simple, but if I pass a vector of n values to this function I expect n evaluations of max and instead I ge

Re: [R] A question about function behavior

2005-04-20 Thread Jorge Ahumada
Thank you very much for all the answers. pmax works great! Jorge On Apr 20, 2005, at 1:55 PM, Alexandre Brito wrote: I think you want this: b<- function(t) {pmax(0,t+1)} alex - Original Message - From: "Jorge Ahumada" <[EMAIL PROTECTED]> To: Sent: Wednesday, April 20, 2005 6:02 PM Subject:

Re: [R] A question about function behavior

2005-04-20 Thread Romain Francois
Hello Consider ?pmax instead of max a <- function(t){ pmax(0,t+1) } a( c(1,2,-4,2)) Romain Le 20.04.2005 19:02, Jorge Ahumada a écrit : Hello, I have been trying to figure this one out, but don't seem to go anywhere. I have a function like this: a = function(t) { max(0,t+1) } very simple, but if

RE: [R] Assign factor and levels inside function

2005-04-20 Thread Liaw, Andy
Wouldn't it be easier to do this? > levels(y$one) <- seq(1, 9, by=2) > y$one [1] 1 1 3 3 5 7 attr(,"levels") [1] 1 3 5 7 9 Andy > From: Tim Howard > > R-help, > After cogitating for a while, I finally figured out how to define a > data.frame column as factor and assign the levels within a fun

Re : Thanks! (Was: Re: [R] R-2.1.0 is released)

2005-04-20 Thread Naji
Some thoughts: * As it's free (no guarantee) and 'matrix oriented' (all the details can be accessed), R user has (sic) better control of what he's doing. In my opinion, R is a better learning tool than others * No doubt that the intangible asset of R is the R users and their commitment to share hel

Re: [R] Package under R 2.1.0: package.rds

2005-04-20 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: Hi everybody, I have trouble installing my own package under R 2.1.0 (it is fine under R 2.0.1). My OS is Windows NT. I installed my package 'mag' by using menu "Packages/Install package from local zip files". It's fine (html package description was updated). But when I

Re: Re : Thanks! (Was: Re: [R] R-2.1.0 is released)

2005-04-20 Thread roger bos
Even though R is free, that doesn't mean its not possible to support it financially. There is a provision for useRs to "join" the foundation for a very small annual fee. I stumbled on this a few months ago and immediately joined because I think I benefit tremendously from using R. Check out the

[R] Clipboard size?

2005-04-20 Thread Chris Bergstresser
Hi all -- I have a matrix of doubles (roughly 30x80) which I'd like to copy to the clipboard. However, as the following shows: > dm = matrix(runif(30 * 80), nrow = 80) > write.table(dm, "clipboard", sep = "\t") Warning message: clipboard buffer is full and output lost Is there any way to i

Re: [R] Clipboard size?

2005-04-20 Thread Rich FitzJohn
Hi Chris, >From ?file: Clipboard: ... When writing to the clipboard, the output is copied to the clipboard only when the connection is closed or flushed. There is a 32Kb limit on the text to be written to the clipboard. This can be raised by using e.g. 'file("clipboard-128")' o

RE: [R] Histogram

2005-04-20 Thread Mulholland, Tom
Of course Andy meant hist.factor(f) In particular you should note that Andy uses the table function to "transform ... the data from characters to numbers" Tom > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Liaw, Andy > Sent: Thursday, 21 April 2005

RE: [R] problem with RODBC

2005-04-20 Thread Mulholland, Tom
Well you have not given us anything to go on really. Are there more than 94 columns? Does each column have a valid fieldname? RODBC is not guaranteed to work in every possible scenario. If you have a look through the list you will find there are specific limitations which are not immediately app

RE: [R] Histogram

2005-04-20 Thread Mulholland, Tom
Mea Culpa I did copy and paste your code to make sure it was an error. I'll go and do it again before I reply. It worked as you expected it to. So I located where I had done it and this is what I found > f <- factor(sample(c("A", "B"), 50, replace=TRUE)) > hist(f) Error in hist.default(f) : 'x

[R] local average

2005-04-20 Thread Jens Hainmueller
Hello, probably this isn't hard, but I can't get R to do this. Thanks for your help! Assume I have a matrix of two covariates: n<- 1000 Y<- runif(n) X<- runif(n,min=0,max=100) data <- cbind(Y,X) Now, I would like to compute the local average of Y for each X interval 0-1, 1-2, 2-3, .

RE: [R] local average

2005-04-20 Thread Zhen Pang
a<-sapply(1:100,function(x)mean(Y[Xx-1])) b<-sapply(1:100,function(x)median(Y[Xx-1])) From: "Jens Hainmueller" <[EMAIL PROTECTED]> To: "R-Help" Subject: [R] local average Date: Wed, 20 Apr 2005 23:43:41 -0400 Hello, probably this isn't hard, but I can't get R to do this. Thanks for your help! Ass

  1   2   >