Re: [R] how to set chart output size in rgl (surface3d)?

2010-04-30 Thread Mandy Xu
i tried using your suggestion but still can't manipulate the dimensions such that the chart fills the whole window. i've attached the picture i get when i tried your suggested method. as you can see, there's still a lot of white space around it. is there anyway i can: a) output to png ONLY the 3d

Re: [R] Re :reading large file

2010-04-30 Thread John Ramey
You should also check out the functions head() and tail(). For instance, if you type head(bmtrend), the first few rows of your data will be displayed. Also, if you type tail(bmtrend), then the last few rows will be displayed. -- John A. Ramey, M.S. Ph.D. Candidate Department of Statistical Scie

[R] Solving equation

2010-04-30 Thread Shant Ch
Hello, I want to solve: x*(3^x)*log(4)-x*log(4/3)-(3^x)+1=0 for x. I used the following code, uniroot(function(x) x*(3^x)*log(4)-x*log(4/3)-(3^x)+1, lower = -2, upper = 2, tol = 0.001 ) While using this I am getting the following error. Can anyone please help me out. Error in uniroot(function

[R] installing R2.11 on RHEL5.3

2010-04-30 Thread V N
I am trying to install R2.11 on RHEL5.3. The main code and base packages compile fine and get installed to \usr\local\R211 (which I set using --prefix). I would like to install a set of contrib packages (car, ggplot2, etc.) also to the same location. Once R is fired up, I can do install.packages()

[R] 3D Surface plot

2010-04-30 Thread abotaha
Dear All, I want to create a surface plot from the data. My data set is consists of x, y and z data. I plotted in very easy way by Excel worksheet as shown in the attached picture. I did some steps in R, but I cannot have the same plot as in Excel worksheet's figure. the R code is x <- c(-

[R] Resize Graphics Window

2010-04-30 Thread Sigal Blay
Need way to resize an existing graphics window. This should be applicable across platforms (as part of a package). Context: function1() draws main plot (I'm using grid), function2() adds smaller plot above main plot, but this one can sometimes overflow the original graphics window area. Thanks

Re: [R] Re :reading large file

2010-04-30 Thread Mohan L
On Sat, May 1, 2010 at 11:55 AM, Tal Galili wrote: > Hi Mohan, > Check: > > dim(bmtrend) > > If the output is like the dimension of your data, then it would appear you > succeeded in reading in the data :) > Yes . You are right. It reads all the data. Thanks you. Mohan L [[alternativ

Re: [R] Re :reading large file

2010-04-30 Thread Tal Galili
Hi Mohan, Check: dim(bmtrend) If the output is like the dimension of your data, then it would appear you succeeded in reading in the data :) Best, Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Rea

[R] Re :

2010-04-30 Thread Mohan L
Hi All, I am new to R and the mailing list. I have a data file (.xls) format with little bit large (16 column,35000 rows ) data file. I am trying to read this file for calculation. I have converted the file into .csv format and read like that : > bmtrend <- read.csv(file="simple.csv",head=TRUE,

[R] Re :reading large file

2010-04-30 Thread Mohan L
On Sat, May 1, 2010 at 11:02 AM, Mohan L wrote: > Hi All, > > I am new to R and the mailing list. > > I have a data file (.xls) format with little bit large (16 column,35000 > rows ) data file. I am trying to read this file for calculation. I have > converted the file into .csv format and read l

[R] select subset of data according to date range

2010-04-30 Thread Carol Gao
Dear R lists, Would anyone help me with setting data frames according to the date? X.RIC Date.G. Time.G. GMT.Offset Type Price VolumeTime 1 QAN.AX 01-DEC-2008 00:00:28.611 11 Trade 2.28105 2008-12-01 11:00:28.611 2 QAN.AX 01-DEC-2008 00:00:43.155

Re: [R] What is the best way to have "R" output tables in an MS Word format?

2010-04-30 Thread Frank E Harrell Jr
On 04/30/2010 05:45 PM, Marc Schwartz wrote: On Apr 30, 2010, at 5:13 PM, Max Gunther wrote: Dear "R" list, Our statisticians usually give us results back in a PDF format. I would like to be able to copy and past tables from "R" output directly into a Microsoft Word table since this will save

Re: [R] how to set chart output size in rgl (surface3d)?

2010-04-30 Thread Duncan Murdoch
On 30/04/2010 9:01 PM, Mandy Xu wrote: i tried using your suggestion but still can't manipulate the dimensions such that the chart fills the whole window. i've attached the picture i get when i tried your suggested method. as you can see, there's still a lot of white space around it. is there an

Re: [R] What is the best way to have "R" output tables in an MS Word format?

2010-04-30 Thread David Scott
Greg Snow wrote: When I work with clients who want to cut and paste to word or powerpoint I usually use the odfWeave package, set up a template file with the tables and graphs (possibly other output), then I run that through odfWeave and then use openoffice to save the results as a word file that

[R] access http directories requiring authentication across platforms

2010-04-30 Thread Joshua Wiley
Hello R users, I am trying to read files from a website that requires authentication. I have been working with url() to to open a connection in Windows. For example: setInternet2(TRUE) con <- url(description="http://myusername:mypassw...@www.somesite.com/myfile.txt";, open="r") open(con) read.

Re: [R] What is the best way to have "R" output tables in an MS Word format?

2010-04-30 Thread David Scott
Greg Snow wrote: When I work with clients who want to cut and paste to word or powerpoint I usually use the odfWeave package, set up a template file with the tables and graphs (possibly other output), then I run that through odfWeave and then use openoffice to save the results as a word file that

Re: [R] how to set chart output size in rgl (surface3d)?

2010-04-30 Thread Mandy Xu
i tried using your suggestion but still can't manipulate the dimensions such that the chart fills the whole window. i've attached the picture i get when i tried your suggested method. as you can see, there's still a lot of white space around it. is there anyway i can: a) output to png ONLY the 3d

Re: [R] drop last character in a names'vector

2010-04-30 Thread Sebastian Kruk
Sorted! Thanks everybody! 2010/4/30 Marc Schwartz : > Dang ityou are right Greg. > > names <- c("ABC", "ABCD", "ABCDE", "ABCDEF") > >> substr(names, 1, nchar(names) - 1) > [1] "AB"    "ABC"   "ABCD"  "ABCDE" > > > and...that is faster than using gsub(). > > > Thanks for catching thatnow i

Re: [R] Flattening and unflattening symmetric matrices

2010-04-30 Thread Bert Gunter
Note the "diag" argument of upper.tri(). Thus: x <- A[upper.tri(A,diag=TRUE)] Then to recreate A from x: A <- matrix(0, 4, 4) A[upper.tri(A,dia=TRUE)] <- X A <- A+t(A) diag(A) <- diag(A)/2 (I grant that the division may cause slight floating point precision error) Bert Gunter Genentech

Re: [R] QIC for GEE

2010-04-30 Thread Gabor Grothendieck
The yags package has QIC. Try library(yags) example(yags) SPRUJ On Fri, Apr 30, 2010 at 6:34 PM, Sachi Ito wrote: > Hi, > > I'm using 'geepack' to run Generalized Estimating Equations.  I'm aware that > I can use anova to compare two models, but would it be possible to test QIC > on R?  It se

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread Greg Snow
I did not understand enough of the rest of your question to give any better response than others have given. Looking back at your previous posts, there is one suggestion that I can make that may help. You can use the approx or approxfun functions to approximate an inverse, just generate a bunc

Re: [R] drop last character in a names'vector

2010-04-30 Thread Marc Schwartz
Dang ityou are right Greg. names <- c("ABC", "ABCD", "ABCDE", "ABCDEF") > substr(names, 1, nchar(names) - 1) [1] "AB""ABC" "ABCD" "ABCDE" and...that is faster than using gsub(). Thanks for catching thatnow it's time for cawfee Marc On Apr 30, 2010, at 6:28 PM, Greg Sno

Re: [R] drop last character in a names'vector

2010-04-30 Thread Greg Snow
No, substr is vectorized, you just have a typo, you are using a different vector for nchar than you are subsetting. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.or

Re: [R] Trouble using Ecdf () from the Hmisc library

2010-04-30 Thread Peter Ehlers
On 2010-04-30 15:48, Prasenjit Kapat wrote: Hello: [Kindly Cc when replying] The question in a nutshell is this: Is there a more robust alternative to Ecdf ()? The details: I've used Ecdf () _a lot_ over the past few years and I have learned to live with its warnings. But I am running short o

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread Kyeong Soo (Joseph) Kim
I have already learned a lot from the list, both technical and not, and cannot thank enough for those valuable suggestions. In fact, as said in my previous posts, I got really critical help and advices, which really addresses the issues I have. By the way, there is one point or two in your post I

Re: [R] Periodic regression - lunar percent cover

2010-04-30 Thread Greg Snow
You have the correct general idea, but it looks like lp may have already been transformed to be in the range 0-1 rather than number of days, if that is the case then you don't need to dived by 29. Again. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@

Re: [R] as.environment Error

2010-04-30 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Greg Snow > Sent: Friday, April 30, 2010 4:04 PM > To: mailing-l...@gmx.net; r-help@r-project.org > Subject: Re: [R] as.environment Error > > I don't know what is specifically ca

Re: [R] understanding behavior of "merge"

2010-04-30 Thread Greg Snow
So does each person have multiple rows and you want to sample the set of rows? The usual approach that I take is to split them into a list, sample from the list, the put the list back together, for example: tmp1 <- split(as.data.frame(state.x77), state.division) tmp2 <- sample(tmp1, replace=TRU

Re: [R] Flattening and unflattening symmetric matrices

2010-04-30 Thread Peter Ehlers
On 2010-04-30 15:26, Nicholas Andrews wrote: Here's an easy question: I'd like to convert a symmetric matrix to a vector composed of the upper.tri() part of it plus the diagonal, and convert it back again. What's the best way to achieve this? I'm wondering if there are some built in functions t

Re: [R] as.environment Error

2010-04-30 Thread Greg Snow
I don't know what is specifically causing the error, but I think that you will be happier in the long run (and probably short run) if you abandon the use of assign and <<- and instead use lists. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org

Re: [R] What is the best way to have "R" output tables in an MS Word format?

2010-04-30 Thread Bert Gunter
odfWeave might be a less daunting option here, as it can output results in some .doc formats. I have no idea how well tables would survive the translations, however. -- Bert Bert Gunter Genentech Nonclinical Statistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help

Re: [R] drop last character in a names'vector

2010-04-30 Thread Marc Schwartz
On Apr 30, 2010, at 5:44 PM, Sebastian Kruk wrote: > Hi, i have a vector filled with names: > > [1] Alvaro Adela ... > [25] Beatriz Berta ... > ... > [10] ... > > I would like to drop last character in every name. > > I use the next program: > > for (i in 1:10) { >

Re: [R] What is the best way to have "R" output tables in an MS Word format?

2010-04-30 Thread Greg Snow
When I work with clients who want to cut and paste to word or powerpoint I usually use the odfWeave package, set up a template file with the tables and graphs (possibly other output), then I run that through odfWeave and then use openoffice to save the results as a word file that I can send to t

Re: [R] drop last character in a names'vector

2010-04-30 Thread Greg Snow
The nchar and substring functions are both vectorized, you can do something like: > substring(state.name, 1, nchar(state.name)-1) And it should be much faster. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original M

Re: [R] What is the best way to have "R" output tables in an MS Word format?

2010-04-30 Thread Marc Schwartz
On Apr 30, 2010, at 5:13 PM, Max Gunther wrote: > Dear "R" list, > > Our statisticians usually give us results back in a PDF format. I would like > to be able to copy and past tables from "R" output directly into a Microsoft > Word table since this will save us tons of time, be more accurate to >

Re: [R] Flattening and unflattening symmetric matrices

2010-04-30 Thread David Winsemius
On Apr 30, 2010, at 5:26 PM, Nicholas Andrews wrote: Here's an easy question: I'd like to convert a symmetric matrix to a vector composed of the upper.tri() part of it plus the diagonal, and convert it back again. What's the best way to achieve this? I'm wondering if there are some built in f

[R] drop last character in a names'vector

2010-04-30 Thread Sebastian Kruk
Hi, i have a vector filled with names: [1] Alvaro Adela ... [25] Beatriz Berta ... ... [10] ... I would like to drop last character in every name. I use the next program: for (i in 1:10) {                           largo <- nchar(names[i]-1)                           names[i] <- substri

Re: [R] What is the best way to have "R" output tables in an MS Word format?

2010-04-30 Thread Frank E Harrell Jr
On 04/30/2010 05:13 PM, Max Gunther wrote: Dear "R" list, Our statisticians usually give us results back in a PDF format. I would like to be able to copy and past tables from "R" output directly into a Microsoft Word table since this will save us tons of time, be more accurate to minimize human

Re: [R] confused on model.frame evaluation

2010-04-30 Thread Marc Schwartz
On Apr 30, 2010, at 4:57 PM, Erik Iverson wrote: > >> I'm sure it's not a bug, but could someone point to a thread or offer some >> gentle advice on what's happening? I think it's related to: >> test <- data.frame(name1 = 1:5, name2 = 6:10, test = 11:15) >> eval(expression(test[c("name1", "name

Re: [R] What is the best way to have "R" output tables in an MS Word format?

2010-04-30 Thread Barry Rowlingson
On Fri, Apr 30, 2010 at 11:13 PM, Max Gunther wrote: > Dear "R" list, > > Our statisticians usually give us results back in a PDF format. I would like > to be able to copy and past tables from "R" output directly into a Microsoft > Word table since this will save us tons of time, be more accurate

[R] QIC for GEE

2010-04-30 Thread Sachi Ito
Hi, I'm using 'geepack' to run Generalized Estimating Equations. I'm aware that I can use anova to compare two models, but would it be possible to test QIC on R? It seems that there were similar questions a couple of years ago, but the question has not been answered yet. I'd appreciate if someo

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread Greg Snow
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Kyeong Soo (Joseph) Kim > Sent: Friday, April 30, 2010 4:10 AM > To: kMan > Cc: r-help@r-project.org > Subject: Re: [R] Curve Fitting/Regression with Multiple Observations [snip

Re: [R] What is the best way to have "R" output tables in an MS Word format?

2010-04-30 Thread David Winsemius
On Apr 30, 2010, at 6:13 PM, Max Gunther wrote: Dear "R" list, Our statisticians usually give us results back in a PDF format. I would like to be able to copy and past tables from "R" output directly into a Microsoft Word table since this will save us tons of time, be more accurate to min

[R] What is the best way to have "R" output tables in an MS Word format?

2010-04-30 Thread Max Gunther
Dear "R" list, Our statisticians usually give us results back in a PDF format. I would like to be able to copy and past tables from "R" output directly into a Microsoft Word table since this will save us tons of time, be more accurate to minimize human copying errors and help us update data in our

[R] Power Law Fitting

2010-04-30 Thread Thomas Bschorr
Hi, I am looking for an more automated way to fit functions of the form y~a*x^b+c to given data, for example x<-c(0.36,0.63,0.90,1.166,1.43, 1.70, 1.96, 2.23) y<-c(9.0,9.62,10.11,10.53,10.9, 11.25, 11.56, 11.86) I tried for example with nls, which did only work with really good initial guessed

Re: [R] Curve Fitting

2010-04-30 Thread Gabor Grothendieck
You can use nls2 to try many starting values. It works just like nls but: - if you give it a two row data frame as the start value it will create a grid between the upper and lower values of each parameter and then run an optimization starting at each such point on the grid returning the best - i

Re: [R] confused on model.frame evaluation

2010-04-30 Thread Erik Iverson
I'm sure it's not a bug, but could someone point to a thread or offer some gentle advice on what's happening? I think it's related to: test <- data.frame(name1 = 1:5, name2 = 6:10, test = 11:15) eval(expression(test[c("name1", "name2")])) eval(expression(interco[c("name1", "test")])) scra

[R] confused on model.frame evaluation

2010-04-30 Thread Erik Iverson
Hello! I'm reading through a logistic regression book and using R to replicate the results. Although my question is not directly related to this, it's the context I discovered it in, so here we go. Consider these data: interco <- structure(list(white = c(1, 1, 0, 0), male = c(1, 0, 1, 0),

Re: [R] Curve Fitting

2010-04-30 Thread apjaworski
Thomas, I think the issue of having reasonable starting values is inherent in all nonlinear optimization problems (unless they have some additional properties like convexity, for example). Using a different algorithm may or may not help. In fact, a vast majority of existing algorithms guaran

[R] Trouble using Ecdf () from the Hmisc library

2010-04-30 Thread Prasenjit Kapat
Hello: [Kindly Cc when replying] The question in a nutshell is this: Is there a more robust alternative to Ecdf ()? The details: I've used Ecdf () _a lot_ over the past few years and I have learned to live with its warnings. But I am running short on time and patience now [*] Here is a reproduc

[R] RMySQL and dates

2010-04-30 Thread BrettGinsburg
I am trying to read and write database tables that have a date field in them. I am constructing a data.frame, then using dbWriteTable to create the table and dbReadTable to read it. >datatbl<-data.frame( dates, trialnum, fooddel, ethdel, trialtime, trialtype, deliveries, food, ethanol, fcumr

[R] Flattening and unflattening symmetric matrices

2010-04-30 Thread Nicholas Andrews
Here's an easy question: I'd like to convert a symmetric matrix to a vector composed of the upper.tri() part of it plus the diagonal, and convert it back again. What's the best way to achieve this? I'm wondering if there are some built in functions to do this easily. I can encode fine: v <- c(d

Re: [R] apply question

2010-04-30 Thread Giovanni Azua
Hello David, On Apr 30, 2010, at 11:00 PM, David Winsemius wrote: > Note: Loops may be just as fast or faster than apply calls. > How come!? is this true also for other similar functions: lapply, tapply and sapply? Then the only advantage of these above is only syntactic sugar? >> >> indices

Re: [R] apply question

2010-04-30 Thread David Winsemius
On Apr 30, 2010, at 4:52 PM, Giovanni Azua wrote: Hello, I have a bootstrap implementation loop that I would like to replace by a faster "batch operator". The loop is as follows: for (b in 1:B) { indices <- sample(1:N, size=N, replace=TRUE) # sample n elements with replacement theta_s

[R] apply question

2010-04-30 Thread Giovanni Azua
Hello, I have a bootstrap implementation loop that I would like to replace by a faster "batch operator". The loop is as follows: for (b in 1:B) { indices <- sample(1:N, size=N, replace=TRUE) # sample n elements with replacement theta_star[b,] = statistic(data,indices) # exe

[R] Curve Fitting

2010-04-30 Thread Thomas Bschorr
I am having troubles in fitting functions of the form y~a*x^b+c to data, for example x<-c(0.1,0.36,0.63,0.90,1.166,1.43, 1.70, 1.96, 2.23) y<-c(8.09,9.0,9.62,10.11,10.53,10.9, 11.25, 11.56, 11.86) I tried for example with nls, which did only work with really good initial guessed values. Any su

[R] How to use apply or tapply to calculat the sum of squared residuals

2010-04-30 Thread Xu, Roy
Dear all, I have a time series data X and want to calculate the sum of squared residuals (SSR) at each time point. SSR at time point m consists of two parts. The first part is the sum of squared residuals for all time points before m, and the second part is the sum of squared residuals for all

Re: [R] reduce size of pdf

2010-04-30 Thread Greg Snow
You could use pch='.' (assuming pairs, don't know if you used that or splom or something else). For lots of points you may want to look at the hexbin package (bioconductor). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > ---

Re: [R] Likelihood ratio based confidence intervals for logistic regression

2010-04-30 Thread Peter Ehlers
On 2010-04-30 12:42, jh556 wrote: Some quick googling suggests that they are the same thing. Thanks for the help! And note that profile likelihood CIs are produced by default on glm objects, i.e. R uses MASS's confint.glm for glm objects. confint.default(your model) let's you compare with Wa

Re: [R] Likelihood ratio based confidence intervals for logistic regression

2010-04-30 Thread jh556
Some quick googling suggests that they are the same thing. Thanks for the help! -- View this message in context: http://r.789695.n4.nabble.com/Likelihood-ratio-based-confidence-intervals-for-logistic-regression-tp2077303p2077354.html Sent from the R help mailing list archive at Nabble.com. ___

[R] ROC curve in randomForest

2010-04-30 Thread Changbin Du
require(randomForest) rf.pred<-predict(fit, valid, type="prob") > rf.pred[1:20, ] 0 1 16 0. 1. 23 0.3158 0.6842 43 0.3030 0.6970 52 0.0886 0.9114 55 0.1216 0.8784 75 0.0920 0.9080 82 0.4332 0.5668 120 0.2302 0.7698 128 0.1336 0.8664 147 0.4272 0.5728 148 0.0490 0.9510

Re: [R] re.findall equivalent?

2010-04-30 Thread Albert-Jan Roskam
Dear Gabor, Thank you! I already suspected that this works differently in R because even simple examples gave results that were, to me, unexpected. Strapply is a very useful function. Cheers!! Albert-Jan ~~ All right, but

Re: [R] Likelihood ratio based confidence intervals for logistic regression

2010-04-30 Thread Erik Iverson
jh556 wrote: I'm applying logistic regression to a moderate sized data set for which I believe Wald based confidence intervals on B coefficients are too conservative. Some of the literature recommends using confidence intervals based on the likelihood ratio in such cases, but I'm having diffic

Re: [R] Interaction terms in logistic regression using glm

2010-04-30 Thread Andrew Miles
Thanks for this, Kjetil. I see that I was getting interpretation and estimation confused. My apologies on not including the paper title. For the benefit of those who read this post after me, it is: Ai, Chunrong, and Edward C. Norton. 2003. "Interaction Terms in Logit and Probit Models." E

Re: [R] Interaction terms in logistic regression using glm

2010-04-30 Thread Greg Snow
The Predict.Plot and TkPredict functions in the TeachingDemos package can also help with visualizing what the model means and the effect of the different terms. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Me

Re: [R] Compact Patricia Trees (Tries)

2010-04-30 Thread Gabor Grothendieck
What do you care if its optimal or not. If is fast enough for your application that is all that matters. If its not then you will likely have to code it yourself. On Fri, Apr 30, 2010 at 2:09 PM, Richard R. Liu wrote: > Gabor, > > Thanks for the hint to use charmatch.  It is faster than what I

[R] Likelihood ratio based confidence intervals for logistic regression

2010-04-30 Thread jh556
I'm applying logistic regression to a moderate sized data set for which I believe Wald based confidence intervals on B coefficients are too conservative. Some of the literature recommends using confidence intervals based on the likelihood ratio in such cases, but I'm having difficulty locating a

Re: [R] Compact Patricia Trees (Tries)

2010-04-30 Thread Richard R. Liu
Gabor, Thanks for the hint to use charmatch. It is faster than what I was doing, but I suspect it might still be suboptimal. I have a list of words, and I want to know which of those exactly or partially match one word. By the very description of charmatch's arguments, the second being

Re: [R] deriving mean from specific cases

2010-04-30 Thread Christos Argyropoulos
I would recommend the following : a) create new factor variables out of the original factor variables (Condition_1, Condition_2, ..., Condition_n) to reflect the analyses that you want to do. The builtin function "interaction" will do this for any number of factors b) use the "summary"

Re: [R] R package compilation in windows

2010-04-30 Thread Uwe Ligges
It works fine for us, hence you need to tell us where you have not followed the manual "R Installation and Administration" step by step. It is also helpful to see how you called "CHECK" and id your package installs at all. Uwe Ligges On 30.04.2010 17:53, John Lande wrote: dear R user, I

[R] ggplot2 legend how?

2010-04-30 Thread Giovanni Azua
Hello, I have just ordered the "ggplot2: Elegant Graphics for Data Analysis (Use R)" but while it arrives :) can anyone please show me how to setup and add a simple legend to a ggplot? This is my use case, I need a legend showing CI "Classic", "Own bootstrap", "R bootstrap": library(ggplot2)

Re: [R] Upgrade process for libraries: can I use installed.packages on an old installation followed by install.packages in a new one

2010-04-30 Thread Greg Snow
There exists a set of batchfiles for windows (they have been mentioned several times on this list before, searching the archives should give you their location) that will move or copy the installed packages from the folder for an old R installation to the folder for your new installation without

Re: [R] Is it possible to transform a factor to a number like this way?

2010-04-30 Thread Greg Snow
This is a Frequently Asked Question, so frequently in fact that it is found in the FAQ along with a couple of answers and discussion of their merits. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- >

Re: [R] tis: cannot alter subset when input matrix contains NAs

2010-04-30 Thread Gabor Grothendieck
Here is a workaround: for(i in 1:nrow(x)) x[i, x[i, ] > 0] <- 0 On Fri, Apr 30, 2010 at 11:10 AM, Abiel X Reinhart wrote: > When using the tis time series package (v1.9), I cannot select or alter a > subset of a time series when the time series is created from a matrix and the > matrix contain

Re: [R] Problem with format(,"%G-%V") - Segfault

2010-04-30 Thread Duncan Murdoch
On 30/04/2010 1:17 PM, Matthias Rieber wrote: Hi, I've some problems with the new R version converting date to year-week: R version 2.11.0 (2010-04-22) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 > load("test.data.R") > str(test.data) Class 'Date' num [1

Re: [R] Lattice Groups

2010-04-30 Thread Deepayan Sarkar
On Thu, Apr 29, 2010 at 6:15 PM, Santosh wrote: > Richard, > Thanks for your email. I am not looking for that kind of plot as you had > suggested. I would like to see overlaid boxplots. Deepayan had earlier shown > the method of overlay of boxplots (using panel.groups=panel.bwplot)... > > I have s

[R] deriving mean from specific cases

2010-04-30 Thread Ruijie
Hi all, I have a large dataset that has >10k entries. The dataset is stored in a dataframe with the headers: SubID Condition1 Condition2 Result1 Result2 There are multiple entries for a given SubID(Subject ID). Condition 1 has 3 levels and condition2 has 2 levels (therefore there are 6 possible

Re: [R] how is xerror calculated in rpart?

2010-04-30 Thread Tang, Hsiu-Khuern
* On Thu 05:53PM -0700, 29 Apr 2010, Seth (sjmy...@syr.edu) wrote: > > Hi, > > I've searched online, in a few books, and in the archives, but haven't seen > this. I believe that xerror is scaled to rel error on the first split. > After fitting an rpart object, is it possible with a little math to

[R] R package compilation in windows

2010-04-30 Thread John Lande
dear R user, I al rying to compile an R package with some C code. everithing work fine as long as I work in Linux or MaCOX. unluckyly I can cant compile it under Windows, here is the error, but I cant figure it out what is the problem. can you help me? * using log directory 'C://MyPKG.Rcheck' * u

[R] tis: cannot alter subset when input matrix contains NAs

2010-04-30 Thread Abiel X Reinhart
When using the tis time series package (v1.9), I cannot select or alter a subset of a time series when the time series is created from a matrix and the matrix contains NA values. Example: x<-tis(t(c(1:10,NA)), start=c(2000,1), freq=12) x[x>0]<-0 The second line yields "Error in if (any(i > nro

[R] as.environment Error

2010-04-30 Thread mailing-list
Dear R community, I have a problem with assign: for ( iii in 1:dim(ref_df)[2] ) { ret <<- ref_df[,iii][names(single_string[ii])]*(single_count/sum(ref_df[,iii])) assign(paste("expected_sing_ref",iii,sep=""),c(get(paste("expec

[R] Problem with format(,"%G-%V") - Segfault

2010-04-30 Thread Matthias Rieber
Hi, I've some problems with the new R version converting date to year-week: R version 2.11.0 (2010-04-22) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 > load("test.data.R") > str(test.data) Class 'Date' num [1:3599546] 13888 14166 14188 14189 14189 ... > res

[R] deriving mean from specific cases

2010-04-30 Thread Ruijie
Hi all, I have a large dataset that has >10k entries. The dataset is stored in a dataframe with the headers: SubID Condition1 Condition2 Result1 Result2 There are multiple entries for a given SubID(Subject ID). Condition 1 has 3 levels and condition2 has 2 levels (therefore there are 6 possible

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread Kyeong Soo (Joseph) Kim
Dear Keith, I will keep that in mind in my future posting. Again, thanks for your time and advice! Regards, Joseph On Fri, Apr 30, 2010 at 3:54 PM, kMan wrote: > Dear Joseph, > > I have had a similar experience to replies. Andy's assessment about signal to > noise on the list is, I believe, qu

Re: [R] Curve Fitting/Regression with Multiple Observations

2010-04-30 Thread Kyeong Soo (Joseph) Kim
Dear Andy, You're the "kind soul" I mentioned in my previous e-mail! Certainly yours is the kind of response I've been looking for, and now I can start with that, especially "splinefun()" with "monoH.FC" method. As for my simulation data, your understanding is correct; there are multiple y value

Re: [R] dump not evaluating promises?

2010-04-30 Thread Duncan Murdoch
On 30/04/2010 12:07 PM, D Sonderegger wrote: dump and dput but have the same behavior but dump has an extra option 'evaluate'. From the documentation, 'evaluate=TRUE' looks like it should force promises to be evaluated, ie convert 1:6 to be c(1,2,3,4,5,6). Both 1:6 and c(1,2,3,4,5,6) are e

Re: [R] SOLVED plotting multiple CIs

2010-04-30 Thread Ista Zahn
Glad you got it working! By "true value" do you mean the means? If so: library(ggplot2) data(mtcars) p <- ggplot(mtcars, aes(x=cyl, y=mpg)) p + stat_summary(fun.data = "mean_cl_boot", colour = "red", geom = "errorbar") + stat_summary(fun.data = "mean_cl_normal", colour = "blue", geom = "errorb

Re: [R] help needed with help

2010-04-30 Thread Marc Schwartz
On Apr 30, 2010, at 11:20 AM, Trevor Hastie wrote: > I installed > R version 2.11.0 (2010-04-22) > on may macbook (snow leopard) > and run R from within emacs > > Now when I try to get help, I get >> ?lm > > (in the new "help" window) > > > Error in help("lm", htmlhelp = FALSE) : > unused a

Re: [R] SOLVED plotting multiple CIs

2010-04-30 Thread Giovanni Azua
Hello, After installing gfortran from http://r.research.att.com/gfortran-4.2.3.dmg it finally works! see below. Thank you all. @Ista Zahn: Looks fantastic! :) thank you so much! ... is there a way to have a small circle on the true value? Best regards, Giovanni > install.packages("Hmisc", d

[R] decisions.values meaning in SVM

2010-04-30 Thread Changbin Du
HI, Dear R community, I have 1 and 0 outcome in data set, I used the SVM (e1071). what is the meaning of 1/0 in the decision.values? if the decision.values>0 then it will class to 1, and if decision.values<0, then it will classify to 0, is this right? > attributes(svm.pred)$decision.values

[R] help needed with help

2010-04-30 Thread Trevor Hastie
I installed R version 2.11.0 (2010-04-22) on may macbook (snow leopard) and run R from within emacs Now when I try to get help, I get > ?lm (in the new "help" window) Error in help("lm", htmlhelp = FALSE) : unused argument(s) (htmlhelp = FALSE) Help! p.s. I am running: This is GNU Emacs

Re: [R] re.findall equivalent?

2010-04-30 Thread Gabor Grothendieck
UNIX grep selects out lines in a file and R grep similarly selects out components of a vector of strings.On the other hand re.findall extracts substrings from strings. These are different concepts so there is no logical reason to expect that these two sets of commands behave the same. Instead,

Re: [R] dump not evaluating promises?

2010-04-30 Thread D Sonderegger
dump and dput but have the same behavior but dump has an extra option 'evaluate'. From the documentation, 'evaluate=TRUE' looks like it should force promises to be evaluated, ie convert 1:6 to be c(1,2,3,4,5,6). I think that either my understanding of what a 'promise' is and what it means to be

Re: [R] plotting multiple CIs

2010-04-30 Thread Giovanni Azua
Hello David, On Apr 30, 2010, at 6:00 PM, David Winsemius wrote: > Looks like you do not have the RTools bundle and perhaps not the XCode > framework either? > > I am not suggesting that you do so, since it appears you are not conversant > with compiling source code packages. If I am wrong abo

Re: [R] short question about data frame manipulation

2010-04-30 Thread Dennis Murphy
Hi: On Fri, Apr 30, 2010 at 6:08 AM, arnaud Gaboury wrote: > Dear group, > > I am losing my mind with a simple question. Sorry if obvious, but I maybe > start to be confused after days and days of reading documentations. > > Df : > > > df <- > structure(list(a = 1:3, b = 4:6, c = structure(c(1L,

[R] re.findall equivalent?

2010-04-30 Thread Albert-Jan Roskam
Hi, The regular expression (grep) below does not behave at all like the equivalent in Python. Also, I would be happy if somebody could tell me what the R equivalent for Python's re.findall is. The regex filters out any numbers not enclosed by square brackets, including fractions (with either co

Re: [R] a question on autocorrelation acf

2010-04-30 Thread John Ramey
I think you are Googling the wrong "reference." Note in ?acf the following: References: Venables, W. N. and Ripley, B. D. (2002) _Modern Applied Statistics with S_. Fourth Edition. Springer-Verlag. (This contains the exact definitions used.) On Fri, Apr 30, 2010 at 10:42 AM, z

Re: [R] dopar parallel assignments

2010-04-30 Thread Steve Lianoglou
Hi Vivek, On Thu, Apr 29, 2010 at 8:37 PM, Vivek Ayer wrote: > Hi David, > > Thanks for the help. It's working! I still find it to be a new > concept. I haven't encountered storing loops in objects in any other > languages. Can it even be done in other languages? Very novel, quite > intriguing.

Re: [R] Why do data frame column types vary across apply, lapply?

2010-04-30 Thread Erik Iverson
See ?apply. The apply function works on *matrices*. Actually arrays, and matrices are arrays with 2 dimensions. characters. This is all explained in the first paragraph of ?apply. Also see ?as.matrix __ R-help@r-project.org mailing list htt

Re: [R] dump not evaluating promises?

2010-04-30 Thread Peter Dalgaard
D Sonderegger wrote: > What I was expecting was for the second dump was: > foo <- > structure(c(1,2,3,4,5,6), .Dim = c(2L, 3L)) > > That is, I was expecting dump to expand the 1:6 and 2:3 into the actual > vectors. Well, > dput(c(1,2,3)) c(1, 2, 3) > dput(c(1L,2L,3L)) 1:3 And dump() does lik

  1   2   >