[R] xyplot help

2008-07-21 Thread ae2356
I have a question about xyplot. Suppose I want to plot say a response variable y vs a predictor x within groups defined by a variable called z. And suppose I have another variable v=1,2 with two levels. I would use the following command to get a "spaghetti plot" with two panels defined by v. x

Re: [R] Sum efficiently from large matrix according to re-occuring levels of factor?

2008-07-21 Thread hadley wickham
Using Jim's index with my method gives you the best of both worlds: x <- matrix(sample(20, 1e6 * 3, replace = T), ncol = 3) system.time({ dataBreaks <- cumsum(c(0, (diff(x[, 2] + x[, 1] * max(x[, 2])) != 0))) # sum up column 3 and output the first two columns with the indices result <- lapply(spl

Re: [R] with lapply() how can you retrieve the name of the object

2008-07-21 Thread Andrew Yee
Thanks everyone for your suggestions (and sorry for the delay in the acknowledgement). Jorge and Jim, thanks for pointing out your approach. Andrew On Fri, Jul 18, 2008 at 7:02 PM, Jorge Ivan Velez <[EMAIL PROTECTED]>wrote: > > Dear Andrew, > > Following Jim Holtman' solution (thanks for pointe

Re: [R] confusion matrix in randomForest

2008-07-21 Thread Liaw, Andy
randomForest predictions are based on votes of individual trees, thus have little to do with error rates of individual trees. Andy > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Miklos Kiss > Sent: Saturday, July 19, 2008 10:47 PM > To: r-help@r-

Re: [R] Conditionally Updating Lattice Plots

2008-07-21 Thread Deepayan Sarkar
On 7/20/08, Bryan Hanson <[EMAIL PROTECTED]> wrote: > Hi All... > > I can¹t seem to find an answer to this in the help pages, archives, or > Deepayan¹s Lattice Book. > > I want to do a Lattice plot, and then update it, possibly more than once, > depending upon some logical options. Code below;

[R] experimental semivariogram

2008-07-21 Thread Alessandro
Hey all, I am a PhD student and I have a points dataset with X, Y and Z (height) to create a Kriging Map. I am finding the code in R to create experimental semivariogram, but I am a brand new in R and I did't find the code. Thank you Alessandro __ R

Re: [R] Using integrate

2008-07-21 Thread Duncan Murdoch
On 21/07/2008 4:56 PM, Ayman Oweida wrote: I have a function, say: f<-function(x) exp(x) and I would like to obtain the integration of the function while adding a few operations within the integration (I need point-by-point integration), say: t<-seq(0,40, by=1) z<-array(0,length(t)) for (i in

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-21 Thread Frank E Harrell Jr
Michal Figurski wrote: Frank, "How does bootstrap improve on that?" I don't know, but I have an idea. Since the data in my set are just a small sample of a big population, then if I use my whole dataset to obtain max likelihood estimates, these estimates may be best for this dataset, but far

Re: [R] Large number of dummy variables

2008-07-21 Thread Doran, Harold
Well, yes and no. In R there really isn't a need to create the model matrix because this is done in R from the factors. But, to implement this computational trick Alan is asking about, it requires that he first create the full, dense model matrix and the do the time-demeaning on that matrix. If

Re: [R] Large number of dummy variables

2008-07-21 Thread Douglas Bates
On Mon, Jul 21, 2008 at 5:45 PM, Bert Gunter <[EMAIL PROTECTED]> wrote: > Unless I'm way off base, dummy variable are never needed (nor are desirable) > in R; they should be modelled as factors instead. AN INTRO TO R might, and > certainly V&R's MASS and others will, explain this in more detail. B

Re: [R] Large number of dummy variables

2008-07-21 Thread Bert Gunter
Unless I'm way off base, dummy variable are never needed (nor are desirable) in R; they should be modelled as factors instead. AN INTRO TO R might, and certainly V&R's MASS and others will, explain this in more detail. -- Bert Gunter Genentech, Inc. -Original Message- From: [EMAIL PROTECT

Re: [R] Large number of dummy variables

2008-07-21 Thread Doran, Harold
Well, at the risk of entering a debate I really don't have time for (I'm doing it anyway) why not consider a random coefficient model? If your response has anything like, "well, random effects and fixed effects are correlated and so the estimates are biased but OLS is consistent and unbiased via an

[R] Large number of dummy variables

2008-07-21 Thread Alan Spearot
Hello, I'm trying to run a regression predicting trade flows between importers and exporters. I wish to include both year-importer dummies and year-exporter dummies. The former includes 1378 levels, and the latter includes 1390 levels. I have roughly 100,000 total observations. When I'm using

Re: [R] name returned by lapply

2008-07-21 Thread Tony Plate
If you return the value as named list, you get your answer using unlist(res, recursive=F): > res <- lapply(1:2, function(i) {val <- list(i); names(val) <- paste("Hugo", i, sep="_"); return(val)}) > unlist(res, rec=F) $Hugo_1 [1] 1 $Hugo_2 [1] 2 > Antje wrote: Oh true, this would solve the

[R] how to draw multiples curses (for given formulae) in lattice

2008-07-21 Thread John Smith
Dear R Users, Could you please write a piece of code to draw Figure 5.9 of "Mixed-Effects Models in S and S-Plus"? Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PL

[R] y-axis number format on plot, barplot etc.

2008-07-21 Thread Bill Cunliffe
I am trying to change the number format shown on the y-axis from scientific 5e05, to 500,000 etc. Does anyone know how to do this? Is there something I can add as an argument to barplot, or would it be through par? barplot(data$Value, names.arg = as.vector(data$Field), main=strTitle)

Re: [R] Control parameter of the optim( ): parscale

2008-07-21 Thread Ben Bolker
Zornitsa Luleva gmail.com> writes: > I am using the L-BFGS-B method of the mle2() function to estimate the values > of 6 parameters. mle2 uses the methods implemented in optim. As I got it > from the descriptions available online, one can use the parscale > parameter to tell R somehow what the va

[R] Using integrate

2008-07-21 Thread Ayman Oweida
I have a function, say: f<-function(x)  exp(x) and I would like to obtain the integration of the function while adding a few operations within the integration (I need point-by-point integration), say: t<-seq(0,40, by=1) z<-array(0,length(t)) for (i in 1:40){ z[i] <- integrate ( f *  (t [i+1] -

[R] Table of tables?

2008-07-21 Thread Rolf Turner
I have occasion to want to produce a ``table of tables''. I.e. I have a number of subjects; to each subject there corresponds a 4 x 5 table of numbers. I would like to arrange these tables into a (say) 4 x 4 array. I would also like (said he, wistfully) to have each of these 16 tables in the a

Re: [R] avoid loop with three-dimensional array

2008-07-21 Thread Charles C. Berry
On Mon, 21 Jul 2008, Michela Cameletti wrote: Dear R user, I'm trying to find a solution for optimizing my code. I have to run a 50.000 iteration long simulation and it is absolutely necessary to have an optimized code. What you have is just a quadratic form, so t( y ) %*% A %*% y will do it.

Re: [R] Howto Restart A Function with Try-Error Catch

2008-07-21 Thread Patrick Connolly
On Mon, 21-Jul-2008 at 10:12PM +0900, Gundala Viswanath wrote: |> Hi all, |> |> I have a function - let's call it "myfunction". This function is based |> on some random |> number generator. Now, once in a while the function will break/crash depending |> on the random number it generate inside th

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-21 Thread Doran, Harold
Well, here is a good source--wikipedia. http://en.wikipedia.org/wiki/Bootstrapping_(statistics) From: Áõ½Ü [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2008 3:56 PM To: Doran, Harold Cc: Michal Figurski; Frank E Harrell Jr;

Re: [R] Parameter names in nls

2008-07-21 Thread Rolf Turner
On 22/07/2008, at 3:49 AM, [EMAIL PROTECTED] wrote: Dear R-help, Could you please examine the following code, and see if I have discovered a bug or not, or am just doing something silly. I am trying to create a package to do fish stock assessment using the nls() function to fit the model

Re: [R] Editor fpr Mac OS

2008-07-21 Thread Rolf Turner
On 22/07/2008, at 5:39 AM, Angelo Scozzarella wrote: Hi, is there a good editor for Mac Os? Yes; vi[m]. cheers, Rolf Turner ## Attention:\ This e-mail message is privileged a

Re: [R] Coefficients of Logistic Regression from bootstrap - how

2008-07-21 Thread Ted Harding
There is one aspect for which bootstrap or re-sampling is useful, which is not provided by maximum likelihood estimation (and the usual MLE estimates of SEs of the coefficients. That is, that the SEs of the coefficients are conditional on the values of the covariates in the sample. The only random

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-21 Thread 刘杰
Hi Doran, Maybe I am wrong, but I think bootstrap is a general resampling method which can be used for different purposes...Usually it works well when you do not have a presentative sample set (maybe with limited number of samples). Therefore, I am positive with Michal... P.S., overfitting, in my

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-21 Thread Doran, Harold
> I used bootstrap to virtually increase the size of my > dataset, it should result in estimates more close to that > from the population - isn't it the purpose of bootstrap? No, not really. The bootstrap is a resampling method for variance estimation. It is often used when there is not an easy

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-21 Thread Michal Figurski
Frank, "How does bootstrap improve on that?" I don't know, but I have an idea. Since the data in my set are just a small sample of a big population, then if I use my whole dataset to obtain max likelihood estimates, these estimates may be best for this dataset, but far from ideal for the whol

Re: [R] vector help

2008-07-21 Thread Dimitris Rizopoulos
try this: paste(test, collapse = "-") Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://pe

Re: [R] lattice with bwplot

2008-07-21 Thread Henrique Dallazuanna
Maybe you can use split argument in plot.trellis. See ?print.trellis. On Mon, Jul 21, 2008 at 2:28 PM, Roberts, Kyle <[EMAIL PROTECTED]> wrote: > Dear All, > > How come par(mfrow=c(1,2)) works with boxplot, but not with bwplot? > > This works > par(mfrow=c(1,2)) > boxplot(dv~index, depend)

Re: [R] vector help

2008-07-21 Thread Jorge Ivan Velez
Try this: test=c("Geneset=HSA04910_INSULIN_SIGNALING_PATHWAY","157","20") paste(test, collapse="-",sep="") HTH, Jorge On Mon, Jul 21, 2008 at 2:49 PM, Rajasekaramya <[EMAIL PROTECTED]> wrote: > > hi > > I have vector test. It has 3 elements. I want to join the three into one > vector. > "Gene

Re: [R] Editor fpr Mac OS

2008-07-21 Thread Don MacQueen
Check the archives of the r-sig-mac mailing list. People have made suggestions there. -Don At 7:39 PM +0200 7/21/08, Angelo Scozzarella wrote: Hi, is there a good editor for Mac Os? Thank Angelo Scozzarella __ R-help@r-project.org mailing list htt

Re: [R] vector help

2008-07-21 Thread Henrique Dallazuanna
Try: paste(test, collapse='-') On Mon, Jul 21, 2008 at 3:49 PM, Rajasekaramya <[EMAIL PROTECTED]> wrote: > > hi > > I have vector test. It has 3 elements. I want to join the three into one > vector. > "Geneset=HSA04910_INSULIN_SIGNALING_PATHWAY-157- 20". > how can i do it. > > > >> class(test) >

Re: [R] Editor fpr Mac OS

2008-07-21 Thread Hans W. Borchers
Angelo Scozzarella tiscali.it> writes: > > Hi, > is there a good editor for Mac Os? We had the same discussion in December 2007 and again in June 2008. Please consider the recommendations given in these threads. My personal favorite: TextMate , though commercial, is exc

[R] vector help

2008-07-21 Thread Rajasekaramya
hi I have vector test. It has 3 elements. I want to join the three into one vector. "Geneset=HSA04910_INSULIN_SIGNALING_PATHWAY-157- 20". how can i do it. > class(test) [1] "character" > test [1] "Geneset=HSA04910_INSULIN_SIGNALING_PATHWAY" "157"

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-21 Thread Frank E Harrell Jr
Michal Figurski wrote: Hello all, I am trying to optimize my logistic regression model by using bootstrap. I was previously using SAS for this kind of tasks, but I am now switching to R. My data frame consists of 5 columns and has 109 rows. Each row is a single record composed of the follow

[R] lattice with bwplot

2008-07-21 Thread Roberts, Kyle
Dear All, How come par(mfrow=c(1,2)) works with boxplot, but not with bwplot? This works par(mfrow=c(1,2)) boxplot(dv~index, depend) boxplot(dv~index, depend2) This does not work par(mfrow=c(1,2)) bwplot(index~dv, depend) bwplot(index~dv, depend2) Thanks, Kyle ***

[R] Control parameter of the optim( ): parscale

2008-07-21 Thread Zornitsa Luleva
Hi everybody, I am using the L-BFGS-B method of the mle2() function to estimate the values of 6 parameters. mle2 uses the methods implemented in optim. As I got it from the descriptions available online, one can use the parscale parameter to tell R somehow what the values of the estimated paramete

Re: [R] Mclust - which cluster is each observation in?

2008-07-21 Thread Julian Burgos
Well, you are dealing with probability based clustering, so for each bird you will get a probability of belonging to each cluster. If your clusters are well defined, then each bird should have a very high probability of belonging to one of the clusters. You can get this probability matrix fro

[R] Editor fpr Mac OS

2008-07-21 Thread Angelo Scozzarella
Hi, is there a good editor for Mac Os? Thank Angelo Scozzarella __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minim

Re: [R] asp and ylim

2008-07-21 Thread Greg Snow
Look at the squishplot function in the TeachingDemos package (probably not the best named function around, but somewhat descriptive and noone has suggested a better one): > x <- runif(100) > y <- runif(100) > squishplot( xlim=c(0,1), ylim=c(0.5, 0.7), asp=1 ) > plot(x,y, xlim=c(0,1), ylim=c(0.5,

Re: [R] Output Nicely formatted tables from R

2008-07-21 Thread Abhijit Dasgupta
Please look at http://biostat.mc.vanderbilt.edu/twiki/pub/Main/StatReport/latexFineControl.pdf for ways to do fine control of tabular data formatting via Sweave. Bill Cunliffe wrote: Hi there, I've spent a while searching for ways of outputting table data from R in presentable formats, su

Re: [R] TeachingDemos question: my.symbols() alignment problems in complicated layout

2008-07-21 Thread Greg Snow
The original poster also contacted me offline and now has a copy of my.symbols that works with layout (instead of resetting all the graphical parameters, it only resets the ones it changes). The fixed version will be in the next release of the package, or anyone who would like a copy before the

Re: [R] portfolio optimization problem - use R

2008-07-21 Thread José Augusto Jr.
You could try the fPortfolio package. Wish helps. jamaj 2008/7/21, fzp2008 <[EMAIL PROTECTED]>: > > How to use R to solve the optimisaton problem > > Minimize: > ½*w^T*omega*w+mu^T*w+c^T(w-w0) for w>w0 long position > ½*w^T*omega*w+mu^T*w-c^T(w-w0) for w > W: is the update weight of portfolio >

[R] Mclust - which cluster is each observation in?

2008-07-21 Thread cnagy
I'm trying to test a method of identifying individuals (birds) based on measured data (their calls). I have test data from known individual birds, and I am using the Mclust package to see if the program can correctly identify which calls come from different birds. So far, mclust has correctly

[R] Output Nicely formatted tables from R

2008-07-21 Thread Bill Cunliffe
Hi there, I've spent a while searching for ways of outputting table data from R in presentable formats, such as colored backgrounds for column headings, bold fonts etc. It appears that this is not possible, but I would be interested to learn if in fact there was a way of achieving this. Ma

[R] portfolio optimization problem - use R

2008-07-21 Thread fzp2008
How to use R to solve the optimisaton problem Minimize: ½*w^T*omega*w+mu^T*w+c^T(w-w0) for w>w0 long position ½*w^T*omega*w+mu^T*w-c^T(w-w0) for whttp://www.nabble.com/portfolio-optimization-problem---use-R-tp18570399p18570399.html Sent from the R help mailing list archive at Nabble.com. ___

[R] avoid loop with three-dimensional array

2008-07-21 Thread Michela Cameletti
Dear R user, I'm trying to find a solution for optimizing my code. I have to run a 50.000 iteration long simulation and it is absolutely necessary to have an optimized code. I have to do this operation *sum_t ( t(X_t) %*% A %*% X_t )* where X_t is a (d*k) matrix which changes in time and A is a co

Re: [R] dev2bitmap error, 'gs' cannot be found

2008-07-21 Thread Prof Brian Ripley
WHat OS is this (please do read the posting guide)? The posting guide also asks you to read the help: it says You will need 'ghostscript': the full path to the executable can be set by the environment variable 'R_GSCMD'. (If this is unset the command '"gs"' is used, which will wor

Re: [R] manipulate a matrix2

2008-07-21 Thread Jon Hak
That's awesome!! I was trying to use the tri function, but not successfully. -Original Message- From: jim holtman [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2008 10:10 AM To: Jon Hak Cc: r-help@r-project.org Subject: Re: [R] manipulate a matrix2 Will this do it for you: > ?print.

Re: [R] manipulate a matrix2

2008-07-21 Thread jim holtman
Will this do it for you: > ?print.default > x [,1] [,2] [,3] [,4] [,5] [1,]16 11 16 21 [2,]27 12 17 22 [3,]38 13 18 23 [4,]49 14 19 24 [5,]5 10 15 20 25 > x[upper.tri(x)] <- NA > x [,1] [,2] [,3] [,4] [,5] [1,]1 NA

[R] Parameter names in nls

2008-07-21 Thread rhelp . 20 . trevva
Dear R-help, Could you please examine the following code, and see if I have discovered a bug or not, or am just doing something silly. I am trying to create a package to do fish stock assessment using the nls() function to fit the modelled stock size to the various pieces of information that w

[R] dev2bitmap error, 'gs' cannot be found

2008-07-21 Thread Boel Brynedal
Dear List, I am using the bioconductor package Category to do some gene enrichment analysis, and usually save my KEGGmnplot's using a dev2bitmap command. This has worked just fine, until suddenly earlier today I got this error-message: > dev2bitmap("04610_080721.jpg",type="jpeg", height = 10, wi

Re: [R] Creation of png=problems

2008-07-21 Thread Richard Pearson
Romain You might get a fuller answer from others, but one thing you could try is using bitmap() rather than png(). Cheers Richard. Romain wrote: Hi everybody, I am currently working with R and I would like to create jpeg graphs with it. I am working on Windows and Unix but I would like t

Re: [R] manipulate a matrix2

2008-07-21 Thread Jon Hak
The vegan matrix produces values of similarity between sample sites. Because the matrix uses the same samples for the row names and the column header it has duplicates on either side of the base diagonal (below). 3 7 8 11 12 3 0 0.6 1 0.3 0.

Re: [R] On creating grouped data set.

2008-07-21 Thread jim holtman
Can you provide an example of what you are asking for. There are various ways of partitioning a dataframe based on some criteria. Is this what you are asking? A before/after example would be helpful. On Mon, Jul 21, 2008 at 6:32 AM, Dong-hyun Oh <[EMAIL PROTECTED]> wrote: > Dear UseRs, > > I wo

[R] xyplot: distance between axis and axis-label gets wrong

2008-07-21 Thread Sebastian Weber
Hi! I just started reading the wonderful Lattice book and I finally found a quite elegant solution for nicer log-ticks. However, there are some problems with the spacing between the axis label and the axis tick marks. It seems that lattice estimates the space wich gets used by the labels before it

Re: [R] manipulate a matrix2

2008-07-21 Thread jim holtman
I am not familiar with the vegdist function. What defines a duplicate in the matrix? There are ways if identifying if more than one row meets the criteria duplicates and then removing them. Can you give an illustration of what you mean with a before/after data representation. On Mon, Jul 21, 20

Re: [R] Time Series - Long Memory Estimation

2008-07-21 Thread Fotis Papailias
thanks for the reply. right, there are some functions in Rmetrics concerning long memory, however the estimator I am searching for is not included. {For anyone who's interested in long memory, the Rmetrics package-collection offers pretty much the same as several other packages do separately. Actu

[R] Creation of png=problems

2008-07-21 Thread Romain
Hi everybody, I am currently working with R and I would like to create jpeg graphs with it. I am working on Windows and Unix but I would like to be able to create graphs (jpeg, png, bitmap...) under Unix. I am working on Solaris version 8. The documentation for R states that the latest versio

[R] Avoid loop with three-dimensional array

2008-07-21 Thread Michela Cameletti
Dear R users, I'm trying to find a solution for optimizing my code. I have to run a 50.000 iteration long simulation and it is absolutely necessary to have an optimized code. I have to do this operation *sum_t ( t(X_t) %*% A %*% X_t )* where X_t is a (d*k) matrix which changes in time and A is a c

Re: [R] How to solve systems of nonlinear equations in R?

2008-07-21 Thread Ravi Varadhan
Also take a look at the package "BB" for solving nonlinear systems. Ravi. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Berend Hasselman Sent: Saturday, July 19, 2008 7:45 AM To: r-help@r-project.org Subject: Re: [R] How to solve systems of nonlinear eq

[R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-21 Thread Michal Figurski
Hello all, I am trying to optimize my logistic regression model by using bootstrap. I was previously using SAS for this kind of tasks, but I am now switching to R. My data frame consists of 5 columns and has 109 rows. Each row is a single record composed of the following values: Subject_name

Re: [R] Subsetting data by date

2008-07-21 Thread Gabor Grothendieck
You need to review all the items I already mentioned. The % codes are in ?strptime so just use those appropraite to your format. The R manuals, the books listed here: http://www.r-project.org/doc/bib/R-publications.html and the Contributed Documentation: http://cran.r-project.org/other-docs.htm

Re: [R] Subsetting data by date

2008-07-21 Thread John Kane
?subset is one of several ways. You don't need a loop. Loops are BAD in R :) --- On Mon, 7/21/08, Williams, Robin <[EMAIL PROTECTED]> wrote: > From: Williams, Robin <[EMAIL PROTECTED]> > Subject: Re: [R] Subsetting data by date > To: "Gabor Grothendieck" <[EMAIL PROTECTED]> > Cc: R-help@r-proj

Re: [R] Subsetting data by date

2008-07-21 Thread John Kane
Here are a few very simple notes I wrote up for someone a little while ago. They may be a bit of help. R documentation is fairly confusing. The Help is almost alwas very complete but not necessarily easy to understand for neophite. :) Probably the first thing to do is to look into getting a de

Re: [R] Subsetting data by date

2008-07-21 Thread Williams, Robin
And following on from my original question: In another file I have the dates in numeric format, (ddmmyy). How could I extract the data between 01/05/97 and 30/09/97, etc? Do I need to implement some sort of loop? Robin Williams Met Office summer intern - Health Forecasting [EMAIL PROTECTED]

Re: [R] Subsetting data by date

2008-07-21 Thread Williams, Robin
Thanks very much for this. The dates are in fact in 3-character form (i.e. sep and not sept). Any suggestions as to where one can start to learn the R language? Up until now, I have only entered simple commands in the terminal. Best wishes, Robin Williams Met Office summer intern - Health For

Re: [R] Subsetting data by date

2008-07-21 Thread Gabor Grothendieck
Continuing on, to just get points from May to Sep mo <- as.numeric(format(time(z), "%m")) z.summer <- z[mo >= 5 & mo <= 9] If in your case z is multivariate rather than univariate (as it is in our example) then it would be: z.summer <- z[mo >= 5 & mo <= 9, ] On Mon, Jul 21, 2008 at 9:55 AM, Gabo

Re: [R] manipulate a matrix2

2008-07-21 Thread Jon Hak
Thanks Jim, that was exactly what I was after. On a second note, do you have any insight into pulling out the duplicates in this type of matrix? I thought that was what the upper=FALSE is in: csv.dis <- vegdist(csv.m, method='jaccard', binary=FALSE, diag=FALSE, upper=FALSE). I just need either th

Re: [R] TeachingDemos question: my.symbols() alignment problems in complicated layout

2008-07-21 Thread maria
Hi Hadley and Paul, thank you a lot for the suggestions... However, i had also emailed Greg Snow (author of my.symbols() function) personally... and Greg has emailed me back with a fixed version of the my.symbols() function -- to be included in the next release -- that works without a hitch with

[R] alternate usage of soil.texture (plotrix)

2008-07-21 Thread Dylan Beaudette
Hi, I have used the soil.texture() function from the plotrix package many times and am very pleased that such a function exists in R. I have a slightly different need this time, and need some pointers on how to accomplish it. Instead of plotting single symbols on the triangle, I would like to outli

[R] help with integrate function

2008-07-21 Thread Brown, Andrew A
Hi I've used the integrate function to do numerical integration and was wondering exactly how the algorithm works. It states that it is adaptive quadrature, does anyone know how the sampling points and weights are chosen, and what transformation is used to convert infinite intervals into finite on

[R] Cross correlation significance test

2008-07-21 Thread Nora Hanson
Dear All, I am doing some cross-correlation analyses on environmental data and wonder if there is a way to get R to compute a test of significance for these? Thanks for your help, Nora -- Nora Hanson Gatty Marine Institute Sea Mammal Research Unit University of St. Andrews St. Andrews Fife KY1

[R] fama-macbeth

2008-07-21 Thread Denise Xifara
Hi all, I was wondering whether there is a standard method to carry out fama-macbeth regressions in R. I have spent the last few hours looking around the help pages but nothing seems to be written about this. Thanks a lot! [[alternative HTML version deleted]]

[R] Time Series - Long Memory Estimation

2008-07-21 Thread Fotis Papailias
Dear R-Users, I am doing a research on Time Series, especially on the estimation of the fractional exponent in long memory time series (for those who know). However there are three estimators already built-in the fracdiff package (GPH, Sperio, MLE) I was wondering if there is someone who had used

[R] On creating grouped data set.

2008-07-21 Thread Dong-hyun Oh
Dear UseRs, I would like to know the way to create grouped data set such as Oats data.frame in nlme package. Specifically, I need to create a grouped data set with PBIB data.frame in SASmixed package. Any help? Looking forward to hearing from you. Best,

[R] A question on the quandratic programming

2008-07-21 Thread Yunlei.Hu
Dear all I have a optimization problem as follows. And would appreaciated if someone can give me the reply soon. I aim to optimize the portfolio in considering the transaction cost. Hence the objective function is: Min: 1/2 w^T* omega*w-mu^T*w-c^T*(w-w0) when w[i]>wo[i] 1/2 w^T

Re: [R] Subsetting data by date

2008-07-21 Thread Gabor Grothendieck
Try this: Lines <- "Date,Temp 1-Apr-1997,50 3-Sept-2001,60" library(zoo) # function to reduce 4 char mos to 3 char convert.date <- function(x, format) as.Date(sub("(-...).-", "\\1-", x), format) # z <- read.zoo("myfile.csv", header = TRUE, sep = ",", FUN = convert.date, format = "%d-%b-%Y") z <

Re: [R] asp and ylim

2008-07-21 Thread Martin Maechler
> "DE" == David Epstein <[EMAIL PROTECTED]> > on Mon, 21 Jul 2008 14:32:47 +0100 writes: DE> A really great answer to my concerns! I'll get hold of the Paul DE> Murrell book, and see how far I can get. DE> On 21 Jul, 2008, at 10:48, Martin Maechler wrote: >> Play aro

Re: [R] asp and ylim

2008-07-21 Thread David Epstein
A really great answer to my concerns! I'll get hold of the Paul Murrell book, and see how far I can get. On 21 Jul, 2008, at 10:48, Martin Maechler wrote: Play around resizing your graphics window.. This is very instructive, with an 'asp = .' using "traditional graphics" plot(). OK, but I don

[R] Subsetting data by date

2008-07-21 Thread Williams, Robin
Hi all, Firstly I appologise if this question has been answered previously, however searching of the archives and the internet generally has not yielded any results. I am looking in to the effects of summer weather conditions (temperature, humidity etc), on the incidences of a breathing dis

[R] Cross correlation significance test

2008-07-21 Thread Nora Hanson
Dear All, I am doing some cross-correlation analyses on environmental data and wonder if there is a way to get R to compute a test of significance for these? Thanks for your help, Nora -- Nora Hanson Gatty Marine Institute Sea Mammal Research Unit University of St. Andrews St. Andrews Fife KY1

Re: [R] drawing segments through points with pch=1

2008-07-21 Thread Paulo Barata
Dear Mr. Epstein, This is another solution, two commands have been added to your own code: y=c(1.21,0.51,0.14,1.62,-0.8,0.72,-1.71,0.84,0.02,-0.12) ybar=mean(y) ll=length(y); ybarv=rep(ybar,ll) x=1:ll plot(x,ybarv,pch=1) segments(x[1],ybar,x[ll],ybar) ## cover the points with other points compl

[R] Howto Restart A Function with Try-Error Catch

2008-07-21 Thread Gundala Viswanath
Hi all, I have a function - let's call it "myfunction". This function is based on some random number generator. Now, once in a while the function will break/crash depending on the random number it generate inside the function. To avoid the problem, what I intend to do is the following: 1. Catch

Re: [R] Getting plot axes where they should be!

2008-07-21 Thread Ted Harding
On 21-Jul-08 12:43:47, Duncan Murdoch wrote: > On 7/21/2008 8:13 AM, (Ted Harding) wrote: >> Hi Folks, >> I've been digging for the solution to this for several >> hours now. If there is a solution, it must be one of the >> worst "needle-in-a-haystack" examples in R documentation! >> >> Essentiall

Re: [R] Getting plot axes where they should be!

2008-07-21 Thread Ted Harding
On 21-Jul-08 12:25:32, Marc Schwartz wrote: > on 07/21/2008 07:13 AM (Ted Harding) wrote: >> Hi Folks, >> I've been digging for the solution to this for several >> hours now. If there is a solution, it must be one of the >> worst "needle-in-a-haystack" examples in R documentation! >> >> Essentiall

Re: [R] Getting plot axes where they should be!

2008-07-21 Thread Duncan Murdoch
On 7/21/2008 8:13 AM, (Ted Harding) wrote: Hi Folks, I've been digging for the solution to this for several hours now. If there is a solution, it must be one of the worst "needle-in-a-haystack" examples in R documentation! Essentially, I want to make an x-y plot in which the X-axis really is the

Re: [R] Getting plot axes where they should be!

2008-07-21 Thread Marc Schwartz
on 07/21/2008 07:13 AM (Ted Harding) wrote: Hi Folks, I've been digging for the solution to this for several hours now. If there is a solution, it must be one of the worst "needle-in-a-haystack" examples in R documentation! Essentially, I want to make an x-y plot in which the X-axis really is th

[R] Getting plot axes where they should be!

2008-07-21 Thread Ted Harding
Hi Folks, I've been digging for the solution to this for several hours now. If there is a solution, it must be one of the worst "needle-in-a-haystack" examples in R documentation! Essentially, I want to make an x-y plot in which the X-axis really is the X-axis (i.e. its vertical position is at y=0

[R] Time Series - Long Memory Estimation

2008-07-21 Thread Fotis Papailias
Dear R-Users, I am doing a research on Time Series, especially on the estimation of the fractional exponent in long memory time series (for those who know). However there are three estimators already built-in the fracdiff package (GPH, Sperio, MLE) I was wondering if there is someone who had used

Re: [R] Erro: cannot allocate vector of size 216.0 Mb

2008-07-21 Thread José Augusto Jr.
Dear all, Thank you by your attention. 1) I'm using a Core 2 Duo CPU with 2MB physical memory and Windows Vista 2) The main function, that´s causing the error, is embedd(x=data,d,t). 3) The time series that i´m using has 1.000.000 observations of real numbers. 4) Sometimes the function works, so

Re: [R] par("din") vs dev.size()

2008-07-21 Thread Prof Brian Ripley
I don't see why you think it is 'odd'. par() is working with the current working copy of the internal pars, and that is only updated when you plot. It refers to the current state of the device. At least if the display list is turned on, a screen device will replot when it is resized, obviousl

Re: [R] CART and CHAID

2008-07-21 Thread Achim Zeileis
On Mon, 21 Jul 2008, Chua Siang Li wrote: Thanks, yes, understand that PARTY offers a lot lot more than CHAID. mmm, allow me to rephrase it. If I am looking for something similar to CART (to grow tree and prune back) and CHAID (using sig test to stop the tree), I can use RPART and PARTY

Re: [R] drawing segments through points with pch=1

2008-07-21 Thread Martin Maechler
> "DE" == David Epstein <[EMAIL PROTECTED]> > on Sun, 20 Jul 2008 15:40:34 +0100 writes: DE> What I don't like about type="b", also suggested by Paul DE> Smith, is that the segments do not go right up to the DE> little circles---a gap is left, which I don't like. The gap

Re: [R] asp and ylim

2008-07-21 Thread Martin Maechler
> "DE" == David Epstein <[EMAIL PROTECTED]> > on Mon, 21 Jul 2008 09:42:35 +0100 writes: DE> Maybe what I am missing is how to set the "device DE> region" mentioned in Brian's email. Play around resizing your graphics window.. This is very instructive, with an 'asp = .' using

Re: [R] sampling from a list of values while excluding one

2008-07-21 Thread Juliane Struve
This works great, thank you for your help ! Dr. Juliane Struve Environmental Scientist 10, Lynwood Crescent Sunningdale SL5 0BL 01344 620811 --- On Mon, 21/7/08, jim holtman <[EMAIL PROTECTED]> wrote: > From: jim holtman <[EMAIL PROTECTED]> > Subject: Re: [R] sampling from a list of values whil

[R] fama-macbeth

2008-07-21 Thread Denise Xifara
Hi all, I was wondering whether there is a standard method to carry out fama-macbeth regressions in R. I have spent the last few hours looking around the help pages but nothing seems to be written about this. Thanks a lot! [[alternative HTML version deleted]]

Re: [R] sampling from a list of values while excluding one

2008-07-21 Thread jim holtman
Here is one way of doing it by removing the element from the vector > # exclude the 3rd element of the vector > sample((1:10)[-3], 10, TRUE) [1] 4 5 7 10 2 10 10 7 7 1 > On Mon, Jul 21, 2008 at 5:10 AM, Juliane Struve <[EMAIL PROTECTED]> wrote: > Dear list, > > > I am trying to sample fr

Re: [R] CART and CHAID

2008-07-21 Thread Chua Siang Li
Thanks, yes, understand that PARTY offers a lot lot more than CHAID. mmm, allow me to rephrase it. If I am looking for something similar to CART (to grow tree and prune back) and CHAID (using sig test to stop the tree), I can use RPART and PARTY respectively? And are there any mo

  1   2   >