Re: [R] manual R en español

2011-10-01 Thread pittjj
http://cran.r-project.org/doc/contrib/R-intro-1.1.0-espanol.1.pdf ? __ 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, mi

[R] Poor performance of "Optim"

2011-10-01 Thread yehengxin
I used to consider using R and "Optim" to replace my commercial packages: Gauss and Matlab. But it turns out that "Optim" does not converge completely. The same data for Gauss and Matlab are converged very well. I see that there are too many packages based on "optim" and really doubt if they can

Re: [R] Poor performance of "Optim"

2011-10-01 Thread Rubén Roa
-Original Message- From: r-help-boun...@r-project.org on behalf of yehengxin Sent: Sat 10/1/2011 8:12 AM To: r-help@r-project.org Subject: [R] Poor performance of "Optim" I used to consider using R and "Optim" to replace my commercial packages: Gauss and Matlab. But it turns out that "Op

Re: [R] Poor performance of "Optim"

2011-10-01 Thread Joshua Wiley
Is there a question or point to your message or did you simply feel the urge to inform the entire R-help list of the things that you consider? Josh On Fri, Sep 30, 2011 at 11:12 PM, yehengxin wrote: > I used to consider using R and "Optim" to replace my commercial packages: > Gauss and Matlab.  

Re: [R] Covariance-Variance Matrix and For Loops

2011-10-01 Thread sf1979
Hello again, sapply works. However it does not explicitly call a simplify function, but rather seems to handle the case within its own body of code. I should be able to figure out basically what simplify2array does from the code though. function (X, FUN, ..., simplify = TRUE, USE.NAMES = TRUE)

Re: [R] Help with cast/reshape

2011-10-01 Thread Daniel Malter
df2<-melt(df1) df3<-cast(df2,Index~Name) df3 HTH, Daniel Dana Sevak wrote: > > I realize that this is terribly basic, but I just don't seem to see it at > this moment, so I would very much appreciate your help. > > > How shall I transform this dataframe: > >> df1 >   Name Index Value > 1   

[R] Problem with logarithmic nonlinear model using nls() from the `stats' package

2011-10-01 Thread Casper Ti. Vector
Example: > f <- function(x) { 1 + 2 * log(1 + 3 * x) + rnorm(1, sd = 0.5) } > y <- f(x <- c(1 : 10)); y [1] 4.503841 5.623073 6.336423 6.861151 7.276430 7.620131 7.913338 8.169004 [9] 8.395662 8.599227 > nls(x ~ a + b * log(1 + c * x), start = list(a = 1, b = 2, c = 3), trace = > TRUE) 37.22954

Re: [R] Poor performance of "Optim"

2011-10-01 Thread Marc Girondot
Le 01/10/11 08:12, yehengxin a écrit : I used to consider using R and "Optim" to replace my commercial packages: Gauss and Matlab. But it turns out that "Optim" does not converge completely. What it means "completely" ? The same data for Gauss and Matlab are converged very well. I see that th

Re: [R] Returning vector of values shared across 3 vectors?

2011-10-01 Thread jim holtman
try this: > vec1 <- > c(4,5,6,7,8,9,10,11,12,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81) > vec2 <- c > (1,2,3,4,5,6,7,8,9,10,11,12,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66) > vec3 <- c (1,2,3,4,5,6

Re: [R] Poor performance of "Optim"

2011-10-01 Thread Spencer Graves
Have you considered the "optimx" package? I haven't tried it, but it was produced by a team of leading researchers in nonlinear optimization, including those who wrote most of "optim" (http://user2010.org/tutorials/Nash.html) years ago. There is a team actively working on this

Re: [R] Adding axis to an ellipse: "ellipse" package

2011-10-01 Thread Antoine
Dear Rolf, I tryed to follow your advices but the results I am getting seems still strange to me. See below an example of a matrix: datamat <- matrix(c(2.2, 0.4, 0.4, 2.8), 2, 2) plot(ellipse(datamat),type='l') eigenval <- eigen(datamat)$values eigenvect <- eigen(datamat)$vectors eigenscl <- eig

[R] Can I tell about someone's academic cheating

2011-10-01 Thread YuHong
Hello, Can I tell about someone¡¦s academic cheating behavior in the mailing list? For I knew this person through this R mailing list. Thanks! Regards, Hong Yu [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https:/

[R] class definition

2011-10-01 Thread Omphalodes Verna
Hi everybody! I have a matrix of class "myClass", for example: myMat <- matrix(rnorm(30), nrow = 6) attr(myMat, "class") <- "myClass" class(myMat) When I extract part of ''myMat'', the corresponding class ''myClass'' unfortunately disappear: myMat.p <- myMat[,1:2] class(myMat.p) Please for a

Re: [R] Can I tell about someone's academic cheating

2011-10-01 Thread Rubén Roa
-Original Message- From: r-help-boun...@r-project.org on behalf of YuHong Sent: Sun 10/2/2011 3:27 AM To: r-help@r-project.org Subject: [R] Can I tell about someone's academic cheating Hello, Can I tell about someone¡¦s academic cheating behavior in the mailing list? For I knew this per

Re: [R] Problem with logarithmic nonlinear model using nls() from the `stats' package

2011-10-01 Thread Gabor Grothendieck
On Sat, Oct 1, 2011 at 5:28 AM, Casper Ti. Vector wrote: > Example: > >> f <- function(x) { 1 + 2 * log(1 + 3 * x) + rnorm(1, sd = 0.5) } >> y <- f(x <- c(1 : 10)); y >  [1] 4.503841 5.623073 6.336423 6.861151 7.276430 7.620131 7.913338 8.169004 >  [9] 8.395662 8.599227 >> nls(x ~ a + b * log(1 +

Re: [R] Problem with logarithmic nonlinear model using nls() from the `stats' package

2011-10-01 Thread Gabor Grothendieck
On Sat, Oct 1, 2011 at 9:27 AM, Gabor Grothendieck wrote: > On Sat, Oct 1, 2011 at 5:28 AM, Casper Ti. Vector > wrote: >> Example: >> >>> f <- function(x) { 1 + 2 * log(1 + 3 * x) + rnorm(1, sd = 0.5) } >>> y <- f(x <- c(1 : 10)); y >>  [1] 4.503841 5.623073 6.336423 6.861151 7.276430 7.620131 7.

Re: [R] Odd gridding pattern when plotting

2011-10-01 Thread Uwe Ligges
I think you found a bug introduced in R-2.13.x that has been fixed in R-2.13.2 which has been released yesterday. Best, Uwe Ligges On 30.09.2011 21:36, Balko, Justin wrote: Thanks, that kind of helps. However, some of my previous code uses functions like heatmap.2 which has multiple images

Re: [R] Problem with logarithmic nonlinear model using nls() from the `stats' package

2011-10-01 Thread Casper Ti. Vector
Ah, now I see... Thanks very much :) On Sat, Oct 01, 2011 at 09:27:34AM -0400, Gabor Grothendieck wrote: > On Sat, Oct 1, 2011 at 5:28 AM, Casper Ti. Vector > wrote: > Its linear given c so calculate the residual sum of squares using lm > (or lm.fit which is faster) given c and optimize over c: >

Re: [R] class definition

2011-10-01 Thread Uwe Ligges
On 01.10.2011 13:21, Omphalodes Verna wrote: Hi everybody! I have a matrix of class "myClass", for example: myMat<- matrix(rnorm(30), nrow = 6) attr(myMat, "class")<- "myClass" class(myMat) When I extract part of ''myMat'', the corresponding class ''myClass'' unfortunately disappear: myMat

Re: [R] Covariance-Variance Matrix and For Loops

2011-10-01 Thread R. Michael Weylandt
Surprising: must be newer update than I realizedanyways, here's the code if you want to add it manually: simplify2array <- function (x, higher = TRUE) { if (length(common.len <- unique(unlist(lapply(x, length > 1L) return(x) if (common.len == 1L) unlist(x,

Re: [R] Nearest neighbour in a matrix

2011-10-01 Thread Spartina
Hi, sorry for the late reply. I just wanted to thank both of you for your answers. They were helpful and also thank you for mentioning the website that has the tutorials which is a most helpful resource. Cheers, Léa -- View this message in context: http://r.789695.n4.nabble.com/Nearest-neighbou

Re: [R] Is the output of survfit.coxph survival or baseline survival?

2011-10-01 Thread David Winsemius
On Sep 30, 2011, at 9:31 PM, koshihaku wrote: Dear all, I am confused with the output of survfit.coxph. Someone said that the survival given by summary(survfit.coxph) is the baseline survival S_0, but some said that is the survival S=S_0^exp{beta*x}. Which one is correct? It may depend on

[R] error using ddply to generate means

2011-10-01 Thread Aidan Corcoran
Dear list, I encounter an error when I try to use ddply to generate means as follows: fun3<-structure(list(sector = structure(list(gics_sector_name = c("Financials", "Financials", "Materials", "Materials")), .Names = "gics_sector_name", row.names = structure(c("UBSN VX Equity", "LLOY LN Equity",

Re: [R] error using ddply to generate means

2011-10-01 Thread Dennis Murphy
Hi: Here's the problem: > str(fun3) 'data.frame': 4 obs. of 3 variables: $ sector:'data.frame': 4 obs. of 1 variable: ..$ gics_sector_name: chr "Financials" "Financials" "Materials" "Materials" $ bebitpcchg: num -0.567 0.996 NA -42.759 $ ticker: chr "UBSN VX Equity" "LLOY

Re: [R] Covariance-Variance Matrix and For Loops

2011-10-01 Thread sf1979
That's very helpful Michael, thank you. I will add it to the arsenal. -- View this message in context: http://r.789695.n4.nabble.com/Covariance-Variance-Matrix-and-For-Loops-tp3859441p3863098.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] error while using shapiro.test()

2011-10-01 Thread spicymchaggis101
Thank you very much! your response solved my issue. I needed to determine the probability of normality for word types per page. -- View this message in context: http://r.789695.n4.nabble.com/error-while-using-shapiro-test-tp3861535p3863205.html Sent from the R help mailing list archive at Nabbl

[R] Gstat - Installation Fail _ download source and compile help ...

2011-10-01 Thread Sandeep Patil
Hello I have been trying to install gstat on university's unix based system ( i am not familiar with many technical aspects of installation) but i am getting a particular error which i could not find a solution to online. Here is what the technical support guy mailed me back, i am sure someone who

[R] Create web applications to run R scripts

2011-10-01 Thread syrvn
Hello, is there anything similar to the Rwui package to create web applications to run R scripts? Many thanks, syrvn -- View this message in context: http://r.789695.n4.nabble.com/Create-web-applications-to-run-R-scripts-tp3863457p3863457.html Sent from the R help mailing list archive at Nabbl

Re: [R] Create web applications to run R scripts

2011-10-01 Thread Dirk Eddelbuettel
On Sat, Oct 01, 2011 at 11:34:47AM -0700, syrvn wrote: > Hello, > > is there anything similar to the Rwui package to create web applications to > run R scripts? There is an entire section of the R FAQ devoted to this. Dirk -- Three out of two people have difficulties with fractions. _

Re: [R] Printing an xtable with type = html

2011-10-01 Thread Juliet Hannah
Maybe some of the comments in this post may be informative to you: http://r.789695.n4.nabble.com/improve-formatting-of-HTML-table-td3736299.html On Wed, Sep 28, 2011 at 6:21 AM, David Scott wrote: > > I have been playing around with producing tables using xtable and the type = > "html" argument

Re: [R] Understanding the workflow between sweave, R and Latex

2011-10-01 Thread Michael Friendly
On 9/30/2011 9:08 AM, syrvn wrote: Hi Duncan, I use Eclipse and StatET plus TexClipse and Sweave which comes with the StatET package. So fore me it is basically one click as well to produce the pdf from the .Rnw file. I installed the MacTex live 2011 version on my computer and thought it might

Re: [R] Sum of Probabilities in a matrix...

2011-10-01 Thread Jim Silverton
Hi all, I have 2 columns in a mtrix, one of which is a column of probabilities and the other is simply a vector of integers. I want to sum all the probabilities with the same integer value and put it in a new column. For example, If my matrix is: 0.98 2 0.2 1 0.01 2 0.5 1 0.6 6 T

Re: [R] Poor performance of "Optim"

2011-10-01 Thread Daniel Malter
With respect, your statement that R's optim does not give you a reliable estimator is bogus. As pointed out before, this would depend on when optim believes it's good enough and stops optimizing. In particular if you stretch out x, then it is plausible that the likelihood function will become flat

Re: [R] Sum of Probabilities in a matrix...

2011-10-01 Thread Dennis Murphy
Let's make it a data frame instead: # Read the data from your post into a data frame named d: d <- read.table(textConnection(" 0.98 2 0.2 1 0.01 2 0.5 1 0.6 6")) closeAllConnections() # Use the ave() function and append the result to d: d$sumprob <- with(d, ave(V1, V2, FUN = sum))

[R] R Studio and Rcmdr/RcmdrPlugins

2011-10-01 Thread Erin Hodgess
Dear R People: Hope you're having a great weekend! Anyhow, I'm currently experimenting with R Studio on a web server, which is the best thing since sliced bread, Coca Cola, etc. My one question: there is a way to show plots. is there a way to show Rcmdr or its Plugins, please? I tried, but it

Re: [R] Adding axis to an ellipse: "ellipse" package

2011-10-01 Thread Rolf Turner
See comments in-line: On 01/10/11 23:26, Antoine wrote: Dear Rolf, I tryed to follow your advices but the results I am getting seems still strange to me. See below an example of a matrix: datamat<- matrix(c(2.2, 0.4, 0.4, 2.8), 2, 2) plot(ellipse(datamat),type='l') eigenval<- eigen(datamat)$v

Re: [R] Sum of Probabilities in a matrix...

2011-10-01 Thread Rolf Turner
On 02/10/11 14:06, Jim Silverton wrote: Hi all, I have 2 columns in a mtrix, one of which is a column of probabilities and the other is simply a vector of integers. I want to sum all the probabilities with the same integer value and put it in a new column. For example, If my matrix is: 0.98 2

Re: [R] Tobit Fixed Effects

2011-10-01 Thread Felipe Nunes
Any good news Arne? *Felipe Nunes* CAPES/Fulbright Fellow PhD Student Political Science - UCLA Web: felipenunes.bol.ucla.edu On Thu, Sep 29, 2011 at 5:10 AM, Arne Henningsen < arne.henning...@googlemail.com> wrote: > Hi Felipe > > On 25 September 2011 00:16, Felipe Nunes wrote: > > Hi Arne, >

[R] getting list of data.frame names

2011-10-01 Thread Erin Hodgess
Dear R People: This is probably a very simple question. I know that if I want to get a list of the classes of the objects in the workspace, I can do this: > sapply(ls(), function(x)class(get(x))) aa1.dfbd "list" "data.frame""integer""numer

Re: [R] getting list of data.frame names

2011-10-01 Thread Joshua Wiley
Hi Erin, Try this: names(which(sapply(.GlobalEnv, is.data.frame))) Cheers, Josh On Sat, Oct 1, 2011 at 8:37 PM, Erin Hodgess wrote: > Dear R People: > > This is probably a very simple question.  I know that if I want to get > a list of the classes of the objects in the workspace, I can do this

[R] Fitting 3 beta distributions

2011-10-01 Thread Nitin Bhardwaj
Hi, I want to fit 3 beta distributions to my data which ranges between 0 and 1. What are the functions that I can easily call and specify that 3 beta distributions should be fitted? I have already looked at normalmixEM and fitdistr but they dont seem to be applicable (normalmixEM is only for fittin

[R] deSolve - Function daspk on DAE system - Error

2011-10-01 Thread Vince
I'm getting this error on the attached code and breaking my head but can't figure it out. Any help is much appreciated. Thanks, Vince CODE: library(deSolve) Res_DAE=function(t, y, dy, pars) { with(as.list(c(y, dy, pars)), { res1 = -dS -dES-k2*ES res2 = -dP + k2*ES eq1 = Eo-E -ES

Re: [R] Entering data into a multi-way array?

2011-10-01 Thread Victoria_Stuart
I am trying to replicate the script, appended below. My data is in OOCalc files. The script (below) synthesizes a dataset (it serves as a "tutorial"), but I will need to get my data from OOCalc into R for use in that script (which uses arrays). I've worked my way through the script, and understa

Re: [R] Poor performance of "Optim"

2011-10-01 Thread yehengxin
Thank you for your response! But the problem is when I estimate a model without knowing the true coefficients, how can I know which "reltol" is good enough? "1e-8" or "1e-10"? Why can commercial packages automatically determine the right "reltol" but R cannot? -- View this message in context: h

Re: [R] Poor performance of "Optim"

2011-10-01 Thread yehengxin
What I tried is just a simple binary probit model. Create a random data and use "optim" to maximize the log-likelihood function to estimate the coefficients. (e.g. u = 0.1+0.2*x + e, e is standard normal. And y = (u > 0), y indicating a binary choice variable) If I estimate coefficient of "x

[R] Multivariate Laplace density

2011-10-01 Thread zerfetzen
Can anyone show how to calculate a multivariate Laplace density? Thanks. -- View this message in context: http://r.789695.n4.nabble.com/Multivariate-Laplace-density-tp3864072p3864072.html Sent from the R help mailing list archive at Nabble.com. __ R-he

Re: [R] Poor performance of "Optim"

2011-10-01 Thread yehengxin
Oh, I think I got it. Commercial packages limit the number of decimals shown. -- View this message in context: http://r.789695.n4.nabble.com/Poor-performance-of-Optim-tp3862229p3864271.html Sent from the R help mailing list archive at Nabble.com. _