Re: [R] Is this mailing list available on/as a news group?

2007-11-11 Thread Martin Waller
Gabor Grothendieck wrote: > Try: > > http://news.gmane.org/gmane.comp.lang.r.general Fantastic - perfect. Saves my inbox filling up! Thanks Martin __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the pos

[R] Removing dendrogram nodes with < 2 members

2007-11-11 Thread Jesse D Lecy
Greetings, I have a large dendrogram that I would like to use to extract groups. But any group with 2 or fewer members is not useful to me, so I would like to remove all of the nodes with less than 3 members from the dendrogram. 1) Is there a good way to iterate through a dendrogram list to ch

Re: [R] attribing frequency of "levels" to each matrix cell

2007-11-11 Thread David Winsemius
It worked. But this student of R is left wondering why or how. In particular the construction [.][.] was puzzling. I doubt that matters greatly, but I am using R in both a Mac (OSX 10.2 v 2.0.1) and WinXP (v 2.4.1.) I have broken it into what I think are its pieces: > table(my.mat)[-1] my.mat

[R] Multivariate time series

2007-11-11 Thread Giusy
Hello to everyone! I have a question for you..I need to predict multivariate time series, for example sales of 2 products related one to the other, having the 2 prices like inputs.. Is there in R a function to do it? I saw dse package but I didn't find what a I'm looking for.. Could anyone help me

[R] Removing axes / frame from plot()

2007-11-11 Thread Alex Park
R Help Feel sure there is a simple answer to this but answer has eluded me so far. NB. Using R 2.6.0. I am plotting a simple chart using plot(): plot(df, ylim=c(as.numeric(min(df)), as.numeric(max(df))), col="OliveDrab", xlab="", ylab="") What I would like to do is have this chart appear such

Re: [R] Produce graph that looks nice on screen and on paper

2007-11-11 Thread Deepayan Sarkar
On Nov 8, 2007 11:22 AM, Van Campenhout Bjorn <[EMAIL PROTECTED]> wrote: > On 11/6/07, Van Campenhout Bjorn <[EMAIL PROTECTED]> wrote: > >> Hi all, > >> > >> I made a dotplot() with lattice, which comes out nice on the graphics > >> device. I can save this as a eps using postscript() and inc

Re: [R] Removing axes / frame from plot()

2007-11-11 Thread Duncan Murdoch
On 11/11/2007 11:49 AM, Alex Park wrote: > R Help > > Feel sure there is a simple answer to this but answer has eluded me so far. > > NB. Using R 2.6.0. > > I am plotting a simple chart using plot(): > > plot(df, ylim=c(as.numeric(min(df)), as.numeric(max(df))), col="OliveDrab", > xlab="", ylab

Re: [R] Multivariate time series

2007-11-11 Thread Christofer
U might look at Vector Auto regression model. Try library(mAr) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Giusy Sent: Sunday, November 11, 2007 10:11 PM To: r-help@r-project.org Subject: [R] Multivariate time series Hello to everyone! I have a quest

Re: [R] Multivariate time series

2007-11-11 Thread Frank Schmid
You may want to have a look at the vars package Frank Giusy schrieb: > Hello to everyone! > I have a question for you..I need to predict multivariate time series, for > example sales of 2 products related one to the other, having the 2 prices > like inputs.. > Is there in R a function to do it? I

Re: [R] attribing frequency of "levels" to each matrix cell

2007-11-11 Thread Gabor Grothendieck
On Nov 11, 2007 11:23 AM, David Winsemius <[EMAIL PROTECTED]> wrote: > It worked. But this student of R is left wondering why or how. In > particular the construction [.][.] was puzzling. I doubt that > matters greatly, but I am using R in both a Mac (OSX 10.2 v 2.0.1) and > WinXP (v 2.4.1.) > > I

[R] State-space model estimation with EM

2007-11-11 Thread adschai
Hi - I follow some references and now implement my own state-space model estimation. I have a question. In case, my equations are like this: y(t) = Ax(t)+Bu(t)+eps(t) # observation eq x(t) = Cx(t-1)+Du(t)+eta(t) # state eq Using EM, after backward recursion, you will use the smoothed state estim

[R] Stopwords in tm package

2007-11-11 Thread Filipe Almeida
Hi to all, I need to append/delete stopwords from the list that i can use from de TM package. I use Portuguese stopwords. When i see the list of stopwords using >stopwords("portuguese") I have some words with special characters like this: "verdadeiro""você" "vocês""vos" I t

Re: [R] How to more efficently read in a big matrix

2007-11-11 Thread affy snp
Hi Gabor, I replaced multiple spaces with a single one and tried the code you suggested. I got: > library(sqldf) Loading required package: RSQLite Loading required package: DBI Loading required package: gsubfn Loading required package: proto > source("http://sqldf.googlecode.com/svn/trunk/R/sqldf

[R] Extracting Number from Output of Coef()

2007-11-11 Thread Peter Lauren
I obtain the coefficients of a nonlinear function thus. -- m=nls(y ~ a + b*x + c*x^2 + d*x^3 + e*exp(x)+f*log(x)+g*log2(x), start = list(a = 0, b = 1, c = 1, d=1, e=1, f=1, g=1)) c=coef(m) --- However, when I look at

Re: [R] Extracting Number from Output of Coef()

2007-11-11 Thread Ben Bolker
Peter Lauren wrote: > > I obtain the coefficients of a nonlinear function > thus. > -- > m=nls(y ~ a + b*x + c*x^2 + d*x^3 + > e*exp(x)+f*log(x)+g*log2(x), start = list(a = 0, b = > 1, c = 1, d=1, e=1, f=1, g=1)) > > c=coef(m) > -

[R] Non-crossing Nonparametric quantile regressions

2007-11-11 Thread paulbegc
I've been looking for ways to calculate a large number (100) of non-crossing Nonparametric quantile regressions on large populations (1000+). Can the quantreg package in R ensure the non-crossing property? If not, do you know any alternative? Thank you, Paulbegc -- View this message in con

Re: [R] Multivariate integration with infinite limits

2007-11-11 Thread Rolf Turner
On 11/11/2007, at 1:43 AM, Uwe Ligges wrote: > Paul Smith wrote: >> Dear All, >> >> Can R perform multivariate integration with infinite limits of >> integration? > > No, R does numerical (not symbolical) calculations, hence it can never > perform integration (not even univariate) with infinite

Re: [R] Non-crossing Nonparametric quantile regressions

2007-11-11 Thread roger koenker
On Nov 11, 2007, at 2:20 PM, paulbegc wrote: > > I've been looking for ways to calculate a large number (100) of non- > crossing > Nonparametric quantile regressions on large populations (1000+). > > Can the quantreg package in R ensure the non-crossing property? You can estimate a (reasonably)

Re: [R] interpretation for multiple regression

2007-11-11 Thread Rolf Turner
On 10/11/2007, at 3:48 AM, Irene Mantzouni wrote: > Dear all, > > probably this is quite clear for most of you but for me it is a > headache... > > I am regressing response A against the continuous covariate B and > the relationship is clearly quadratic. > When I add a second covariate B, the

[R] using RSperl with "tree" package

2007-11-11 Thread Rachana Jain
Hello, I am trying to use the "tree" package in R with RSperl. I have generated a regression tree using the "tree" package in R and saved it in a file say "RegTree_2.Rdata" If I use the predict function from R command line, it works fine. However, I want to use it from within perl using RSperl

[R] using RSperl with "tree" package

2007-11-11 Thread rachanaj
Hello, I am trying to use the "tree" package in R with RSperl. I have generated a regression tree using the "tree" package in R and saved it in a file say "RegTree_2.Rdata" If I use the predict function from R command line, it works fine. However, I want to use it from within perl using RSperl

[R] how to emerge two tables by taking the ave.

2007-11-11 Thread affy snp
Dear list, I am new to R and very inexperienced. Sorry for the trouble. I have two txt files and want to merge them by taking the average. More specifically, for example, the txt file1, with row names and column names, consists of 238000 rows and 196 columns. Each column corresponds to a sample. T

Re: [R] interpretation for multiple regression

2007-11-11 Thread Daniel Malter
Hi, maybe I don't understand your question correctly, but I don't see a reason why there should be a significant interaction term at all. To the question why you regression is linear in B and C: your regressor B is linear (in B), i.e. B= 1B. your regressor C is some quadratic function of B, i.e.

Re: [R] from XPPro to Linux what distribution to use for R ?

2007-11-11 Thread Dirk Eddelbuettel
On 10 November 2007 at 13:41, Uwe Ligges wrote: | [EMAIL PROTECTED] wrote: [...] | I'd recommend to compile your version of R yourself from sources. It's | easy, just follow the R Installation and Administration manual. I think you need a more nuanced view than to always recommend compilation fr

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread jim holtman
Here is one way of doing it: > x [,1] [,2] [,3] [1,]246 [2,]12 NA [3,]46 NA > y [,1] [,2] [,3] [1,] NA44 [2,]22 NA [3,]122 > z <- mapply(function(a,b)mean(c(a,b), na.rm=TRUE), x, y) > dim(z) <- dim(x) > z [,1] [,2] [,3]

Re: [R] How to more efficently read in a big matrix

2007-11-11 Thread Gabor Grothendieck
On Nov 11, 2007 2:28 PM, affy snp <[EMAIL PROTECTED]> wrote: > Hi Gabor, > > I replaced multiple spaces with a single one and tried > the code you suggested. I got: > > > library(sqldf) > Loading required package: RSQLite > Loading required package: DBI > Loading required package: gsubfn > Loading

[R] Largest N Values Efficiently?

2007-11-11 Thread David Katz
What is the most efficient alternative to x[order(x)][1:n] where length(x)>>n? I also need the positions of the mins/maxs perhaps by preserving names. Thanks for any suggestions. -- View this message in context: http://www.nabble.com/Largest-N-Values-Efficiently--tf4788033.html#a13697535 Sent

Re: [R] using RSperl with "tree" package

2007-11-11 Thread Duncan Temple Lang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rachana Jain wrote: > Hello, > > I am trying to use the "tree" package in R with RSperl. > > I have generated a regression tree using the "tree" package in R and saved it > in a file say "RegTree_2.Rdata" > > If I use the predict function from R

Re: [R] Largest N Values Efficiently?

2007-11-11 Thread Gabor Grothendieck
You can apply 1:n to order(x) so you don't wind up subscripting x by every element in order(x). o <- head(order(x), n) # positions x[o] A completely different approach, if X is a data frame with d as a data column is this where the row names give the positions (don't know about speed): > library

[R] how to run a linux syntax within an R script?

2007-11-11 Thread Christian Salas
Is it possible to run a linux syntax (i.e. like i was at a linux terminal) from an R code? Just one example: Let say that I have an R code with hist(rnorm(100)) dev.copy2eps(file="Dnormal.eps") and then within the same R code, i want to convert the file 'Dnormal.eps' to 'Dnormal.pdf'. This can

Re: [R] how to run a linux syntax within an R script?

2007-11-11 Thread Rolf Turner
?system On 12/11/2007, at 2:28 PM, Christian Salas wrote: > Is it possible to run a linux syntax (i.e. like i was at a linux > terminal) from an R code? > > Just one example: > Let say that I have an R code with > > hist(rnorm(100)) > dev.copy2eps(file="Dnormal.eps") > > and then within the same

Re: [R] how to run a linux syntax within an R script?

2007-11-11 Thread Christian Salas
thanks, I got it! --- Christian SalasE-mail:[EMAIL PROTECTED] PhD studenthttp://environment.yale.edu/salas School of Forestry & Environmental Studies Tel: +1-(203)-432 51

Re: [R] help with lasso2 package

2007-11-11 Thread Berwin A Turlach
G'day Diana, On Fri, 9 Nov 2007 11:48:15 -0800 (PST) <[EMAIL PROTECTED]> wrote: > #general least squares model works fine > > glm.F <- glm(modF, data = F2, family = gaussian) glm() fits generalised linear models which are different from general(ised) least squares models. The latter can be fi

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread affy snp
Hi Jim, Thanks a lot! I am wondering why I ended up getting the result as follows: > x<-read.table(file="x.txt",header=TRUE,row.names=1,na.strings = "NA") Warning message: In read.table(file = "x.txt", header = TRUE, row.names = 1, na.strings = "NA") : incomplete final line found by readTableHe

[R] graphical parameters and acf

2007-11-11 Thread David Kaplan
Hi, I'm plotting 5 autocorrelation plots on one page. Using par(mfrow=c(3,2)) everything comes out fine. However, for each plot, it prints a title on top of each plot that says Series followed by the variable name used in the plot. I want to suppress those titles, but I also want a general

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread jim holtman
What did your text files look like? It would appear that there was not a line feed on the last line of the file. Also what does 'str' of x and y show? It appears that one is a data frame and one is a matrix. That might be causing some of the problems. On Nov 11, 2007 10:30 PM, affy snp <[EMAIL

Re: [R] Largest N Values Efficiently?

2007-11-11 Thread jim holtman
Try: sort(x, partial=n)[1:n] On Nov 11, 2007 6:43 PM, David Katz <[EMAIL PROTECTED]> wrote: > > What is the most efficient alternative to x[order(x)][1:n] where > length(x)>>n? > I also need the positions of the mins/maxs perhaps by preserving names. > > Thanks for any suggestions. > -- > View t

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread affy snp
Hi,Jim. I created two txt files as: x.txt id b1 b2 b3 a1 246 a2 12 NA a3 46 NA y.txt idb1 b2 b3 a1 NA44 a2 22 NA a3 122 I tried it one more time but got different z: > x<-read.table(file="x.txt",header=TRUE,row.names=1,na.strings = "NA")

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread jim holtman
Here is the way to read the data and convert it. Your data was a dataframe with the first column being the id: > x <- read.table(textConnection("id b1 b2 b3 + a1 246 + a2 12 NA + a3 46 NA"), header=TRUE) > y <- read.table(textConnection("idb1 b2 b3 + a1 NA44

Re: [R] graphical parameters and acf

2007-11-11 Thread Gabor Grothendieck
Try this: par(mfrow = 1:2) acf(cbind(" " = 1:10)) acf(cbind(" " = 1:10)) par(mfrow=c(1,1)) par(mfrow=c(1,1), oma=c(0,0,1,0)) mtext("My Title", 3, outer = TRUE, cex = par("cex.main")) Please provide reproducible code next time as requested in last line of every message to r-help. On Nov 11, 2007

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread affy snp
Hi Jim, However, the real file has 238000 row ids and 196 column ids. How could I read the file first and then convert it to a matrix? Allen On Nov 11, 2007 11:02 PM, jim holtman <[EMAIL PROTECTED]> wrote: > Here is the way to read the data and convert it. Your data was a > dataframe with the f

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread jim holtman
Should be the exact same way. Are the columns all numeric? I assume they would have to be if you are taking averages. What I sent should work as is if the first column is coming in as the 'id' and all the rest are numeric. If you want, you can send me a subset of the data (e.g., 20 rows of each

Re: [R] how to emerge two tables by taking the ave.

2007-11-11 Thread affy snp
Thanks Jim. It works. I need to specify row.names as missing and then get rid of the first column to make it as a matrix. x<-read.table(file="x.txt",header=TRUE,row.names=NULL,na.strings = "NA") x <- as.matrix(x[,-1]) y<-read.table(file="y.txt",header=TRUE,row.names=NULL,na.strings = "NA") y

Re: [R] Problem with a non-factor, non-numeric variable in a data.frame

2007-11-11 Thread Alun Pope
Unfortunately it is not quite as simple as this. It seems (to me) that the change to the behaviour of as.numeric() in the latest release means that the advice given in FAQ 7.10 (and the help) is incorrect when the factor levels are integers. The following example illustrates: > x1 <- c(1:4,4,4,4

[R] how to randomize a vector

2007-11-11 Thread leffgh
I have a vector whose length is nearly 70 thousand. I need randomize it for 1000 times . for randomizing , I mean ,the elements of the vector remain intact while their order in the vector get changed randomly. I have written a function which seems to be able to solve short vectors , but waste a l

Re: [R] Largest N Values Efficiently?

2007-11-11 Thread Prof Brian Ripley
What is 'x' here? What type? Does it contain NAs? Are there ties? R's ordering functions are rather general, and you can gain efficiency by ruling some of these out. See ?sort, look at the 'partial' argument, including the comments in the Details. And also look at ?sort.list. sort.int(x)

Re: [R] how to randomize a vector

2007-11-11 Thread Prof Brian Ripley
?sample On Sun, 11 Nov 2007, leffgh wrote: > > I have a vector whose length is nearly 70 thousand. > I need randomize it for 1000 times . > for randomizing , I mean ,the elements of the vector remain intact while > their order in the vector get changed randomly. > I have written a function which

Re: [R] Problem with a non-factor, non-numeric variable in a data.frame

2007-11-11 Thread Prof Brian Ripley
I don't know what you mean by 'the latest release', but R does not behave this way in a vanilla session in 2.6.0 or R-patched. Had you given the 'at a minimum' information asked for in the posting guide, we might have been able to deduce what the problem is. I get > x1 <- c(1:4,4,4,4) > f <-

Re: [R] how to randomize a vector

2007-11-11 Thread Frede Aakmann Tøgersen
Why didn't you do this in R? > help.search("random sample") Help files with alias or concept or title matching 'random sample' using fuzzy matching: sample(base)Random Samples and Permutations Type 'help(FOO, package = PKG)' to inspect entry 'FOO(PKG) TITLE'. > See ?sample, e.g

Re: [R] Largest N Values Efficiently?

2007-11-11 Thread Frede Aakmann Tøgersen
On my system >system.time(x1 <- sort(x,decreasing=TRUE)[1:1000]) user system elapsed 0.030.000.03 whereas > system.time(x1 <- x[order(x)][1:1000]) user system elapsed 0.110.000.11 I.e. using sort is about 30 times faster. Best regards Frede Aakmann Tøgersen

Re: [R] how to randomize a vector

2007-11-11 Thread leffgh
oh, thank you , I used the "sample"function to generate new subordinates but never think that it can directly act on the vector . thank you very much. Frede Aakmann Tøgersen wrote: > > Why didn't you do this in R? > >> help.search("random sample") > Help files with alias or concept or titl

[R] help on drawing a tree with "ape"?

2007-11-11 Thread Hua Li
Dear all, I'm using the "ape" package in R and want to draw a phylogenetic tree with not only the tip labels but also some labels for the edges. e.g. Mark the edge AB as "m" in the tree ABC. Couldn't find a way to do that. Can someone help? Thanks, Hua ___