Re: [R] file reading problem unique to windows. Err info: Error in file(file, ifelse(append, a, w)). cannot open the connection

2010-11-25 Thread Prof Brian Ripley
We don't have any of the information asked for in the posting guide, such as your version of R, reproducible example But please try R-patched, since this might be • download.file() could leave the destination file open if the URL was not able to be opened. (PR#14414) (If you

[R] how to find a row index in a matrix or a data frame ?

2010-11-25 Thread Luedde, Mirko
Dear all, this looks pretty much a standard problem, but I couldn't find a satisfying and understandable solution. (A) Given a data frame (or matrix), e.g. x - data.frame(A=c(1, 2, 2), B=c(4, 5, 5)) and a row of this data frame, e.g. r - c(2, 5) I need to find one row

Re: [R] how to find a row index in a matrix or a data frame ?

2010-11-25 Thread Eric Lecoutre
Mirko, Here is a solution - I am sure other R mentors would find a more efficient one x - data.frame(A=c(1, 2, 2), B=c(4, 5, 5)) x - rbind(x,x) r - c(2,5) (rowfind=apply(x,1,FUN=function(row,add){isTRUE(all.equal(row,add,check.attributes = FALSE))},add=r)) 1 2 3 4 5 6 FALSE TRUE TRUE

Re: [R] Problem with plotting diagnostics - Error in object$coefficients : $ operator is invalid for atomic vectors

2010-11-25 Thread Manderscheid Katharina
this problem seems to only exist in R 2.12.0 but not in R 2.11.1. any ideas? a bug? -- dr. katharina manderscheid soziologisches seminar universität luzern kasernenplatz 3 6000 luzern 7 tel. ++41 41 228 4657 web:

Re: [R] how to find a row index in a matrix or a data frame ?

2010-11-25 Thread Henrik Bengtsson
rows - which(apply(mapply(x, r, FUN===), MARGIN=1, FUN=all)); /H On Thu, Nov 25, 2010 at 1:59 AM, Luedde, Mirko mirko.lue...@sap.com wrote: Dear all, this looks pretty much a standard problem, but I couldn't find a satisfying and understandable solution. (A) Given a data frame (or matrix),

Re: [R] Running R from SAS

2010-11-25 Thread Eric Lecoutre
Ziad, Also you didn't mention which version of SAS and which modules. In case you are working with 9.2 and have at disposal IML, you can have a look at http://support.sas.com/documentation/cdl/en/imlsstat/63545/HTML/default/viewer.htm#statr_toc.htm Eric 2010/11/24 ziad.elmou...@tnsglobal.com

Re: [R] how to find a row index in a matrix or a data frame ?

2010-11-25 Thread Luedde, Mirko
Hi all, thank you for quick help. Any ideas on (better) efficiency (with other data types)? Best, Mirko -Ursprüngliche Nachricht- Von: henrik.bengts...@gmail.com [mailto:henrik.bengts...@gmail.com] Im Auftrag von Henrik Bengtsson Gesendet: Donnerstag, 25. November 2010 11:25 An:

Re: [R] how to find a row index in a matrix or a data frame ?

2010-11-25 Thread Henrique Dallazuanna
Try this: which((apply(x, 1, toString) %in% toString(r))) On Thu, Nov 25, 2010 at 7:59 AM, Luedde, Mirko mirko.lue...@sap.com wrote: Dear all, this looks pretty much a standard problem, but I couldn't find a satisfying and understandable solution. (A) Given a data frame (or matrix), e.g.

Re: [R] Help in improving the style of R plots

2010-11-25 Thread Duncan Murdoch
On 25/11/2010 5:38 AM, pilchat wrote: Dear all, I am running a MCMC on my data, and I want to plot the results of the simulation. I want to dedicate a page in the PS file for each element in my sample, and in each page I need to plot 8 quadrants. In attachment you find my first attemp (just

[R] \Sweaveopts error

2010-11-25 Thread John Maindonald
I have a file 4lmetc.Rnw, intended for inclusion in a LaTeX document, that starts: \SweaveOpts{engine=R, keep.source=TRUE} \SweaveOpts{eps=FALSE, prefix.string=snArt/4lmetc} The attempt to process the file through Sweave generates the error: Sweave(4lmetc) Writing to file 4lmetc.tex Processing

[R] Generalized linear models with categorical data

2010-11-25 Thread Diogo B. Provete
I got a question about using a GLZ with categorical x categorical data. Below there is a data set I want to know the influence of treatments (CONT, and LPS2H LPS24H) on the categories of pigmentation of the right testis of an amphibian. From these data, I used the function glm with binomial family

Re: [R] \Sweaveopts error

2010-11-25 Thread Duncan Murdoch
On 25/11/2010 6:34 AM, John Maindonald wrote: I have a file 4lmetc.Rnw, intended for inclusion in a LaTeX document, that starts: I think this may have been fixed in the patched version. Could you give it a try to confirm? If not, please send me a simplified version of the file, and I'll

[R] RODBC

2010-11-25 Thread Jorge Nieves
Hi, I am running the RODBC examples form the help guide. I am trying to UPDATE a table in an Access data base but I am having an error. library(RODBC) library(termstrc) path = getwd() setwd(getwd()) dbName = data.mdb pathdbname = paste(path,/,dbName,sep=) accesChannel =

Re: [R] Is there an equivalent to predict(..., type=linear) of a Proportional hazard model for a Cox model instead?

2010-11-25 Thread Ben Rhelp
I manage to achieve similar results with a Cox model as follows but I don't really understand why we have to take the inverse of the linear prediction with the Cox model and why we do not need to divide by the number of days in the year anymore? Am I getting a similar result out of pure luck?

Re: [R] looking for the RMySQL package for R 2.12.0 under XP

2010-11-25 Thread PtitBleu
Thank you for all your answers. I've looked at RODBC but it seems that you have to declare the database with the administration tools before using it . With RMySQL, you can do it directly in the R-script which is very convenient for me as I regularly treat new databases. For those who already

[R] difficulty setting the random = argument to lme()

2010-11-25 Thread Robert Kinley
My small brain is having trouble getting to grips with lme() I wonder if anyone can help me correctly set the random = argument to lme() for this kind of setup with (I think) 9 variance/covariance components ... Study.1 Study.2 ... Study.10

[R] t-stat for the coefficients of an ARIMA model

2010-11-25 Thread Samuel Le
Dear all, I am fitting a time series using the following command: Ts.arima-arima(x,c(2,1,2)) where x is a time series. What the function returns is perfectly fine but I was wondering if I could access to the t-stat of the coefficients I got from the arima function. Any help would be

Re: [R] how to find a row index in a matrix or a data frame ?

2010-11-25 Thread Gabor Grothendieck
On Thu, Nov 25, 2010 at 4:59 AM, Luedde, Mirko mirko.lue...@sap.com wrote: Dear all, this looks pretty much a standard problem, but I couldn't find a satisfying and understandable solution. (A) Given a data frame (or matrix), e.g.      x - data.frame(A=c(1, 2, 2), B=c(4, 5, 5))    and a

Re: [R] txtProgressBar strange behavior in R 2.12.0

2010-11-25 Thread Prof Brian Ripley
I've seen it, but not reliably enough to reproduce. The issue is that there isn't really support for '\r' (CR) in Rgui, and so it was sometimes getting junk characters. However, I think that this is probably fixed in R-patched = r53662, so please try an update in a day or two. On Mon, 22

Re: [R] Lifting Wavelet Transform

2010-11-25 Thread Mike Marchywka
( I'm top posting for clarity, hotmail decided not to original text and I'm not going to even try to outguess it LOL) I have a non-definitive negative answer : I found two packages but it isn't obvious either expose anything related to lifting. I haven't worked with these lately and so not

Re: [R] Filled contour plot showing labeled isolines?

2010-11-25 Thread Fiona Berryman
jt306 wrote: Is it possible to create a contour plot with the isolines labeled. I know you can do this with Matlab. Argh! I tried creating a filled contour plot, then using par(new=T), followed by overlaying the contour plot on top. However, the placement of the filled contour plot

Re: [R] Filled contour plot showing labeled isolines?

2010-11-25 Thread S Ellison
If you usre filled.contour, then use contour() as a part of the function supplied as the axis parameter, you can correctly overlay contours on the colour contour plot. Steve e -Original Message- From: Fiona Berryman f.berry...@wlv.ac.uk To: r-help@r-project.org Sent: 11/25/2010

[R] What to do if geoRglm results showed that a non-spacial model fits better?

2010-11-25 Thread Jimmy Martina
Hi R-floks: Working in geoRglm, it shows me, according to AIC criterion, that the non-spacial model describes the process in a better way. It's the first time that I'm facing up to. These are my results: OP2003Seppos.AICnonsp-OP2003Seppos.AICsp #[1] -4

Re: [R] Is there an equivalent to predict(..., type=linear) of a Proportional hazard model for a Cox model instead?

2010-11-25 Thread David Winsemius
On Nov 25, 2010, at 7:27 AM, Ben Rhelp wrote: I manage to achieve similar results with a Cox model as follows but I don't really understand why we have to take the inverse of the linear prediction with the Cox model Different parameterization. You can find expanded answer(s) in the

Re: [R] overlap cdf plots and add colors and etc

2010-11-25 Thread Peter Ehlers
On 2010-11-24 22:24, Roslina Zakaria wrote: Hi Jorge, I tried but still it does not work. Thank you for your time. Jorge's code works perfectly well. If you prefer lines() over plot(, add = TRUE), then use lines(): plot( ecdf(rnorm(15, sd=3)), verticals=TRUE, col=black)

Re: [R] How to change value of y axis from log relative Hazard to relative Hazard

2010-11-25 Thread David Winsemius
On Nov 25, 2010, at 2:00 AM, jsntxt wrote: http://r.789695.n4.nabble.com/file/n3058505/file.csv file.csv Hi, Rusers I have a problem in making a rcspline.plot with a Hmisc package. My data is in the upload attachment. My programme as follows: library(Hmisc)

[R] Applying function to elements of matrices in a list

2010-11-25 Thread statmobile
Hello R-help, Please cc me on all responses, as I only receive summary emails from this list. I'm wondering if anybody has any tips on how to accomplish this efficiently. I have a list of matrices, and I'm trying to get the mean of the [i,j]'th element of each matrix in a list. So if I

Re: [R] Applying function to elements of matrices in a list

2010-11-25 Thread Dimitris Rizopoulos
try this: Reduce(+, x) / length(x) Best, Dimitris On 11/25/2010 3:42 PM, statmobile wrote: Hello R-help, Please cc me on all responses, as I only receive summary emails from this list. I'm wondering if anybody has any tips on how to accomplish this efficiently. I have a list of matrices,

Re: [R] Applying function to elements of matrices in a list

2010-11-25 Thread statmobile
On 11/25/2010 09:44 AM, Dimitris Rizopoulos wrote: try this: Reduce(+, x) / length(x) Thanks Dimitris, that's very slick, I was unaware of this Reduce function. The issue, is that I actually wanted to do a trimmed mean, and if things prove possible even the median. Is there a way to apply

Re: [R] Is there an equivalent to predict(..., type=linear) of a Proportional hazard model for a Cox model instead?

2010-11-25 Thread Ben Rhelp
Hi David, Thank you for your reply. See below for more information. From: David Winsemius On Nov 25, 2010, at 7:27 AM, Ben Rhelp wrote: I manage to achieve similar results with a Cox model as follows but I don't really understand why we have to take the inverse of the linear

Re: [R] Help on running regression by grouping firms

2010-11-25 Thread Dennis Murphy
Hi: You could try something like this: For illustration, I'll use a data frame that was presented in a recent post to the ggplot2 group. The poster wanted regressions by individual, but you can add more than one grouping variable to the code I show below. It uses the plyr package. library(plyr)

Re: [R] Applying function to elements of matrices in a list

2010-11-25 Thread Peter Ehlers
On 2010-11-25 07:06, statmobile wrote: On 11/25/2010 09:44 AM, Dimitris Rizopoulos wrote: try this: Reduce(+, x) / length(x) Thanks Dimitris, that's very slick, I was unaware of this Reduce function. The issue, is that I actually wanted to do a trimmed mean, and if things prove possible

[R] help: program efficiency

2010-11-25 Thread randomcz
hey guys, I am working on a function to make a duplicated value unique. For example, the original vector would be like : a = c(2,1,1,3,3,3,4) I'll like to transform it into: a.nodup = 2, 1.01, 1.02, 3.01, 3.02, 3.03, 4 basically, find the duplicates and assign a unique value by adding a small

[R] moving xlabels in lattice

2010-11-25 Thread statquant2
Dear R users, I am trying to move the xlab string on my xyplot, without success, I would like it to shifted down, would one of you know a way ? Thanks for reading Colin -- View this message in context: http://r.789695.n4.nabble.com/moving-xlabels-in-lattice-tp3059092p3059092.html Sent from

[R] Spearman's Power

2010-11-25 Thread Lewis G. Dean
I am trying to get some idea of the power of the Spearman's Rank correlation I have carried out. Is there a way I can calculate power post-hoc? I know that confidence intervals are preferred by many people, but how do I generate those for a Spearman's? Thanks Lewis Dean [[alternative

[R] About searching criteria

2010-11-25 Thread Stephen Liu
Hi folks, I need to search the dataset on data with name on heading; Run conc density I look at ??help.search and could not resolve; help.search(pattern, fields = c(alias, concept, title) What shall I replace pattern? I suppose replacing alias, concept, title with Run, conc, density ?

Re: [R] moving xlabels in lattice

2010-11-25 Thread David Winsemius
On Nov 25, 2010, at 10:00 AM, statquant2 wrote: Dear R users, I am trying to move the xlab string on my xyplot, without success, I would like it to shifted down, would one of you know a way ? A quick and dirty way would be to stick a \n in front of your x-label. -- David Winsemius, MD

[R] t-stat for the coefficients of an ARIMA model

2010-11-25 Thread Samuel Le
Dear all, I am fitting a time series using the following command: Ts.arima-arima(x,c(2,1,2)) where x is a time series. What the function returns is perfectly fine but I was wondering if I could access to the t-stat of the coefficients I got from the arima function. Any help would be

Re: [R] moving xlabels in lattice

2010-11-25 Thread pilchat
Hi Colin, I wish I could do the same with a persp plot, since the labels overlap the ticks and the annotations. Unfortunately, I don't know the answer to your question, but I'll stay tuned on this thread. Good luck Gaetano On 11/25/2010 04:00 PM, statquant2 wrote: Dear R users, I am

Re: [R] help: program efficiency

2010-11-25 Thread Dimitris Rizopoulos
one way is the following: a - c(2,1,1,3,3,3,4) d - unlist(sapply(rle(a)$length, function (x) if (x 1) seq(0.01, by = 0.01, len = x) else 0)) a + d I hope it helps. Best, Dimitris On 11/25/2010 3:49 PM, randomcz wrote: hey guys, I am working on a function to make a duplicated value

[R] Is there an implementation for URL Encoding (/format) in R?

2010-11-25 Thread Tal Galili
Hello all, I would like some R function that can translate a string to a URL encoding (see here: http://www.w3schools.com/tags/ref_urlencode.asp) Is it implemented? (I wasn't able to find any reference to it) Thanks, Tal Contact

Re: [R] Generalized linear models with categorical data

2010-11-25 Thread Dennis Murphy
Hi: On Thu, Nov 25, 2010 at 3:53 AM, Diogo B. Provete dbprov...@gmail.comwrote: I got a question about using a GLZ with categorical x categorical data. Below there is a data set I want to know the influence of treatments (CONT, and LPS2H LPS24H) on the categories of pigmentation of the right

Re: [R] Is there an implementation for URL Encoding (/format) in R?

2010-11-25 Thread Gustavo Carvalho
?URLencode On Thu, Nov 25, 2010 at 3:53 PM, Tal Galili tal.gal...@gmail.com wrote: Hello all, I would like some R function that can translate a string to a URL encoding (see here: http://www.w3schools.com/tags/ref_urlencode.asp) Is it implemented? (I wasn't able to find any reference to it)

Re: [R] Is there an implementation for URL Encoding (/format) in R?

2010-11-25 Thread Romain Francois
Le 25/11/10 16:53, Tal Galili a écrit : Hello all, I would like some R function that can translate a string to a URL encoding (see here: http://www.w3schools.com/tags/ref_urlencode.asp) Is it implemented? (I wasn't able to find any reference to it) Thanks, Tal Perhaps ?URLencode -- Romain

Re: [R] t-stat for the coefficients of an ARIMA model

2010-11-25 Thread David Winsemius
On Nov 25, 2010, at 10:50 AM, Samuel Le wrote: Dear all, I am fitting a time series using the following command: Ts.arima-arima(x,c(2,1,2)) where x is a time series. What the function returns is perfectly fine but I was wondering if I could access to the t-stat of the coefficients I

Re: [R] Fast Two-Dimensional Optimization

2010-11-25 Thread Wonsang You
Thank you for your kind comments. I tried different algorithms such as BFGS, CG, and so on. However, the choice of algorithms was not effective on reducing computation time. Instead, your second suggestion of coding the gradient of minimization function was a little bit successful to reduce

Re: [R] About searching criteria

2010-11-25 Thread Henrique Dallazuanna
Try this: d - data() ne - new.env() data(list = grep(\\(, d$results[,'Item'], value = TRUE, invert = TRUE), envir = ne) out - eapply(ne, names) names(which(lapply(lapply(out, '%in%', c(Run, conc, density)), sum) == 3)) On Thu, Nov 25, 2010 at 1:38 PM, Stephen Liu sati...@yahoo.com wrote: Hi

Re: [R] moving xlabels in lattice

2010-11-25 Thread Peter Ehlers
On 2010-11-25 07:00, statquant2 wrote: Dear R users, I am trying to move the xlab string on my xyplot, without success, I would like it to shifted down, would one of you know a way ? Thanks for reading Colin Have a look at the possible height adjustments with

[R] aftreg vs survreg loglogistic aft model (different intercept term)

2010-11-25 Thread Immanuel
Hi, I'm estimating a loglogistic aft (accelerated failure time) model, just a simple plain vanilla one (without time dependent covariates), I'm comparing the results that I obtain between aftreg (eha package) and survreg(surv package). If I don't use any covariate the results are identical , if I

Re: [R] help: program efficiency

2010-11-25 Thread William Dunlap
If the input vector t is known to be ordered (or if you only care about runs of duplicated values, not all duplicated values) the following is pretty quick nodup3 - function (t) { t + (sequence(rle(t)$lengths) - 1)/100 } If you don't know if the the input will be ordered then ave() will do

Re: [R] Is there an equivalent to predict(..., type=linear) of a Proportional hazard model for a Cox model instead?

2010-11-25 Thread David Winsemius
On Nov 25, 2010, at 10:08 AM, Ben Rhelp wrote: Hi David, Thank you for your reply. See below for more information. From: David Winsemius On Nov 25, 2010, at 7:27 AM, Ben Rhelp wrote: I manage to achieve similar results with a Cox model as follows but I don't really understand why

Re: [R] Is there an implementation for URL Encoding (/format) in R?

2010-11-25 Thread Duncan Temple Lang
On 11/25/10 7:53 AM, Tal Galili wrote: Hello all, I would like some R function that can translate a string to a URL encoding (see here: http://www.w3schools.com/tags/ref_urlencode.asp) Is it implemented? (I wasn't able to find any reference to it) I expect there are several

Re: [R] difficulty setting the random = argument to lme()

2010-11-25 Thread Dennis Murphy
Hi Robert: It appears to me that you have a split-plot structure, so let me see if I have it right. The 'whole-plot' experiment looks like a replicated randomized block design - the studies are the blocks, the treatments A and B are the whole-plot treatments, each of which is assigned randomly

Re: [R] Lifting Wavelet Transform

2010-11-25 Thread Dennis Murphy
Hi: Package sos is a wonderful tool for this sort of question... library(sos) findFn('lifting wavelet transform') It returned nine possible matches in two packages, adlift and nlt. HTH, Dennis On Wed, Nov 24, 2010 at 8:46 PM, assaedi76 assaedi76 assaed...@yahoo.comwrote: Hi R users Thanks

Re: [R] delete-d jackknife

2010-11-25 Thread ufuk beyaztas
Thank you so much :) -- View this message in context: http://r.789695.n4.nabble.com/delete-d-jackknife-tp3058335p3059364.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Is there an equivalent to predict(..., type=linear) of a Proportional hazard model for a Cox model instead?

2010-11-25 Thread David Winsemius
I hit the send button on my second reply before I intended to. Since then I have noticed that the question I thought you were asking is not at all a good match to the Subject line of your message. There is a type =lp in predict.coxph and that is the linear predictor, although it is not a

[R] [libsvm] predict function error

2010-11-25 Thread zhliu.tju
Dear R users, There is a error message when I run the following code. It is used to load microarray data and use the top 1000 genes for training svm to classify test set . library(e1071) Loading required package: class f=read.table(F:\\lab\\ microarray analysis\\VEH LPS\\exprs.txt,

Re: [R] help: program efficiency

2010-11-25 Thread Mike Marchywka
Date: Thu, 25 Nov 2010 06:49:19 -0800 From: rando...@gmail.com To: r-help@r-project.org Subject: [R] help: program efficiency hey guys, I am working on a function to make a duplicated value unique. For example, the original vector would be

[R] R and R-related meetups at UCLA

2010-11-25 Thread Jan de Leeuw
UCLA Statistics is hosting three meetup groups that are either straight R (361 members) or R-related (GRASS, which interacts directly with R, and GPGPU, which will look at interfacing R with OpenMP, GCD, OpenCL, CUDA, ...) http://www.meetup.com/LAarea-R-usergroup

[R] Cumsum with a max and min value

2010-11-25 Thread henrique
I have a vector of values -1, 0, 1, say a - c(0, 1, 0, 1, 1, -1, -1, -1, 0, -1, -1) I want to create a vector of the cumulative sum of this, but I need to set a maximum and minimum value for the cumsum, for example: max_value - 2 min_value - -2 the expected result would be (0, 1,

[R] Go (back) from Rd to roxygen

2010-11-25 Thread Yihui Xie
Hi all, Since roxygen is a great help to document R packages, I am wondering if there exists an approach to go back from the raw Rd files to roxygen-documentation? E.g. turn \author{Somebody} into @author Somebody. This sounds ridiculous, but I believe it helps in the long term for me to maintain

[R] How to bin/average time points?

2010-11-25 Thread DonDolowy
Dear all, I am pretty new to R only having an introduction course, so please bare with me. I am doing my PhD at The Max Planck Institute of Immunobiology where I am analyzing some calorimetry data from some mice. I have a spreadsheet consisting of measurements of the respiratory exchange rate

Re: [R] Cumsum with a max and min value

2010-11-25 Thread Henrique Dallazuanna
Try this: ac - cumsum(a) ifelse(ac 2, max_value, ifelse(ac -2, min_value, ac)) On Thu, Nov 25, 2010 at 6:44 PM, henrique henri...@allianceasset.com.brwrote: I have a vector of values -1, 0, 1, say a - c(0, 1, 0, 1, 1, -1, -1, -1, 0, -1, -1) I want to create a vector of the

Re: [R] Problem with plotting diagnostics - Error in object$coefficients : $ operator is invalid for atomic vectors

2010-11-25 Thread Peter Ehlers
On 2010-11-25 02:25, Manderscheid Katharina wrote: this problem seems to only exist in R 2.12.0 but not in R 2.11.1. any ideas? a bug? Duncan *did* say that he was using R 2.12.0. So that's not likely to be the problem. Most of the time, when users claim that a problem exists in a new

[R] Apropos the day...

2010-11-25 Thread Dennis Murphy
Since today is American Thanksgiving, I want to thank: (a) R-core for all of their efforts to produce what is, IMHO, the best statistical software around, not simply for the convenience of doing more, better, quicker, but also because it changes the landscape in the way one

Re: [R] Is there an implementation for URL Encoding (/format) in R?

2010-11-25 Thread Tal Galili
Thank you Duncan, Romain and Gustavo for referring me to both: URLencode and curlEscape I see that both functions work great for English, but fail to provide with the proper translation for Hebrew characters. For example, the word שלום (Peace, in Hebrew) Should be this:

Re: [R] Apropos the day...

2010-11-25 Thread Spencer Graves
ditto. Spencer Graves On 11/25/2010 1:20 PM, Dennis Murphy wrote: Since today is American Thanksgiving, I want to thank: (a) R-core for all of their efforts to produce what is, IMHO, the best statistical software around, not simply for the convenience of doing more, better,

Re: [R] Apropos the day...

2010-11-25 Thread Paul
I'll second that. Paul Hurley. On 25/11/10 21:25, Spencer Graves wrote: ditto. Spencer Graves On 11/25/2010 1:20 PM, Dennis Murphy wrote: Since today is American Thanksgiving, I want to thank: (a) R-core for all of their efforts to produce what is, IMHO, the best statistical

[R] question about importing phylogenetic tree

2010-11-25 Thread Nora Szabo
Hello, I am trying to import a phylogenetic tree from Mesquite into R. When I use the read.nexus command I get the following message: Warning message: In matrix(x, ncol = 2, byrow = TRUE) : data length [589] is not a sub-multiple or multiple of the number of rows [295] A phylo object is

[R] coxph strange result

2010-11-25 Thread Bond, Stephen
The following fit does not make sense to me, please, correct me if I have a logical error. moddowsn Call: coxph(formula = Surv(start, stop, resp) ~ sn + matfac2, data = coxsn1, method = efron) coef exp(coef) se(coef) z p sn2 0.0497 1.051 0.02030 2.450

Re: [R] Help on running regression by grouping firms

2010-11-25 Thread Hadley Wickham
res - function(x) resid(x) ds_test$u - do.call(c, llply(mods, res)) I'd be a little careful with this, because there's no guarantee the results will by ordered in the same way as the input (and I'd also prefer ds_test$u - unlist(llply(mods, res)) or ds_test$u - laply(mods, res)) In your case,

Re: [R] discriminant function analysis

2010-11-25 Thread Chris Mcowen
Hi, I am not sure if it is more robust than a discriminant function but it is certainly capable if differentiating between species based on morphology. I used 12 measurements in my fish. What did your PCA results show? Unfortunately I haven't got round to publishing my data yet but I can

Re: [R] overlap cdf plots and add colors and etc

2010-11-25 Thread Roslina Zakaria
Hi Peter and Jorge, Finally, it works.  Thank you for your guidance. ## CDF plots par(mar=c(4,4,2,1.2),oma=c(0,0,0,0),xaxs=i, yaxs=i) plot(ecdf(dt1),verticals=TRUE, horizontals=TRUE,pch=46,do.p=FALSE, col.hor=1, col.vert=1,lwd=2,) lines(ecdf(dt2),verticals=TRUE,

Re: [R] coxph strange result

2010-11-25 Thread David Winsemius
On Nov 25, 2010, at 5:16 PM, Bond, Stephen wrote: The following fit does not make sense to me, please, correct me if I have a logical error. moddowsn Call: coxph(formula = Surv(start, stop, resp) ~ sn + matfac2, data = coxsn1, method = efron) coef exp(coef) se(coef)

Re: [R] Go (back) from Rd to roxygen

2010-11-25 Thread Duncan Murdoch
On 25/11/2010 3:45 PM, Yihui Xie wrote: Hi all, Since roxygen is a great help to document R packages, I am wondering if there exists an approach to go back from the raw Rd files to roxygen-documentation? E.g. turn \author{Somebody} into @author Somebody. This sounds ridiculous, but I believe it

Re: [R] How to bin/average time points?

2010-11-25 Thread sachinthaka . abeywardana
It would be something like this (might have to change the syntax a bit) bin_ave=0; while (i lenth(time)){ bin_ave[k]=mean(time(i:i+6)); k=k+1; i=i+6; } if your data is in a table format replace time with mytable$time. hope this helps, Sachin p.s. sorry about corporate

Re: [R] Cumsum with a max and min value

2010-11-25 Thread Gabor Grothendieck
On Thu, Nov 25, 2010 at 3:44 PM, henrique henri...@allianceasset.com.br wrote: I have a vector of values -1, 0, 1, say a - c(0, 1, 0, 1, 1, -1, -1, -1, 0, -1, -1) I want to create a vector of the cumulative sum of this, but I need to set a maximum and minimum value for the cumsum, for

[R] Installing RQuantLib on Win 7 64 Bit

2010-11-25 Thread Santosh Srinivas
Hello Group, I am trying out RQuantLib on a 64bit Win 7 machine. But running into installation errors install.packages(RQuantLib) Warning in install.packages(RQuantLib) : argument 'lib' is missing: using 'C:\Users\Tester\Documents/R/win64-library/2.11' Warning: unable to access index for

Re: [R] Cumsum with a max and min value

2010-11-25 Thread jim holtman
Does this do it; pmin(2, pmax(-2, cumsum(a))) [1] 0 1 1 2 2 2 1 0 0 -1 -2 On Thu, Nov 25, 2010 at 3:44 PM, henrique henri...@allianceasset.com.br wrote: I have a vector of values -1, 0, 1, say a - c(0, 1, 0, 1, 1, -1, -1, -1, 0, -1, -1) I want to create a vector of the

Re: [R] Go (back) from Rd to roxygen

2010-11-25 Thread Hadley Wickham
Since roxygen is a great help to document R packages, I am wondering if there exists an approach to go back from the raw Rd files to roxygen-documentation? E.g. turn \author{Somebody} into @author Somebody. This sounds ridiculous, but I believe it helps in the long term for me to maintain R

Re: [R] How to bin/average time points?

2010-11-25 Thread jim holtman
try this: # create times 9 minutes apart time - seq(as.POSIXct('2010-11-25 00:00'), by = '9 min', length = 480) mySamp - data.frame(time = time, value = sample(1:100, length(time), TRUE)) # add column to split by hour mySamp$hour - format(mySamp$time, '%Y-%m-%d %H:30') # compute the mean

Re: [R] How to bin/average time points?

2010-11-25 Thread Niels Richard Hansen
Hi Kevin Here is one way: yourData - c(0.730, 0.732, 0.743, 0.757,0.781, 0.731, 0.830, 0.832, 0.843, 0.857, 0.881, 0.831) nrGroups - 2 lengthGroups - 6 tapply(yourData, factor(rep(c(1,nrGroups), each = lengthGroups)), mean) and you will have to adjust the number of groups and if necessary

Re: [R] About searching criteria

2010-11-25 Thread Stephen Liu
Hi Henrique, Lot of thanks for your advice which is a little complicate to me. It involves multiple R commands: d - data() ne - new.env() data(list = grep(\\(, d$results[,'Item'], value = TRUE, invert = TRUE), envir = ne) out - eapply(ne, names) names(which(lapply(lapply(out, '%in%',

[R] How to unsubscribe to mailing list

2010-11-25 Thread jsntxt
How to unsubscribe to mailing list -- View this message in context: http://r.789695.n4.nabble.com/How-to-unsubscribe-to-mailing-list-tp3059708p3059708.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] get list index

2010-11-25 Thread Lorenzo Cattarino
Hi R-users, I have a list mylist - list(c(0.79, 0.92, 0.91, 0.86, 0.96, 0.96, 0.95, 0.94, 0.99), c(0.28, 0.45, 0.59, 0.69, 0.80, 0.87, 0.95, 0.94, 0.98), c(0.29, 0.39, 0.59, 0.69, 0.68, 0.80, 0.93, 0.95, 0.98)) Is there a way to find the index of the list element that contains the

Re: [R] get list index

2010-11-25 Thread Michael Bedward
Hello Lorezo, Try this... order(sapply(mylist, min))[1] Michael On 26 November 2010 11:23, Lorenzo Cattarino l.cattar...@uq.edu.au wrote: Hi R-users, I have a list mylist - list(c(0.79, 0.92, 0.91, 0.86, 0.96, 0.96, 0.95, 0.94, 0.99), c(0.28, 0.45, 0.59, 0.69, 0.80, 0.87, 0.95,

Re: [R] Installing RQuantLib on Win 7 64 Bit

2010-11-25 Thread Dirk Eddelbuettel
On 26 November 2010 at 07:05, Santosh Srinivas wrote: | Hello Group, | | I am trying out RQuantLib on a 64bit Win 7 machine. But running into | installation errors The error message is about as clear as it can get: | install.packages(RQuantLib) | | Warning in install.packages(RQuantLib) : |

Re: [R] overlap histogram and density

2010-11-25 Thread Roslina Zakaria
Hi Ted, Regarding your examples, is it possible to get a smooth line for the density which overlap with the histogram? Regards, Roslina From: ted.hard...@wlandres.net ted.hard...@wlandres.net To: r-help@r-project.org Sent: Fri, November 12, 2010 6:42:31 AM

Re: [R] Go (back) from Rd to roxygen

2010-11-25 Thread Yihui Xie
Awesome! Thanks a lot! Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iowa State University 2215 Snedecor Hall, Ames, IA On Thu, Nov 25, 2010 at 8:09 PM, Hadley Wickham had...@rice.edu wrote: Since roxygen is a great help to

[R] How to save a data set as .txt on fly?

2010-11-25 Thread Stephen Liu
Hi folks, Win7 64bit I tried to save DNase, a data set on database, as .txt file for future use with load. I can't do it on fly; save(DNase, file=C:/Users/satimis/Documents/aaa.txt) load(file=C:/Users/satimis/Documents/aaa.txt) aaa Error: object 'aaa' not found aaa.txt Error: object

Re: [R] How to save a data set as .txt on fly?

2010-11-25 Thread David Winsemius
On Nov 25, 2010, at 10:45 PM, Stephen Liu wrote: Hi folks, Win7 64bit I tried to save DNase, a data set on database, as .txt file for future use with load. I can't do it on fly; save(DNase, file=C:/Users/satimis/Documents/aaa.txt) load(file=C:/Users/satimis/Documents/aaa.txt) aaa

Re: [R] How to save a data set as .txt on fly?

2010-11-25 Thread Stephen Liu
Hi David, But you didn't try: DNase# which was after all the name of the object you saved. Sorry I don't follow. I can't do it with following steps: DNase save(DNase, file=C:/Users/satimis/Documents/dnase.txt) load(file=C:/Users/satimis/Documents/dnase.txt) dnase Error: object

Re: [R] \Sweaveopts error

2010-11-25 Thread John Maindonald
Yes, that has fixed the problem. (2010-11-24 r53659) Thanks. John Maindonald email: john.maindon...@anu.edu.au phone : +61 2 (6125)3473fax : +61 2(6125)5549 Centre for Mathematics Its Applications, Room 1194, John Dedman Mathematical Sciences Building (Building 27) Australian