Re: [R] how to explain the interaction terms regarding treatmentcontrast of lm model

2009-08-29 Thread zrl
Thank you all for your help. Daniel, I want to know if I really understand your answer. I calculated each group mean and sub mean as below: tapply(val,group,mean) group1 group2 group3 4.215670 5.664411 7.210819 tapply(val,sub,mean) abcd 4.856927 5.199305

Re: [R] unix like commands in R?

2009-08-29 Thread zrl
Thank you Ted. I did try page(file,method=print), it did behave as less. I will try the code to modify the profile as well to see how it goes. Thank you very much. On Mon, Aug 24, 2009 at 5:32 PM, Ted Harding ted.hard...@manchester.ac.ukwrote: On 24-Aug-09 21:56:06, zrl wrote: Dear List: I

[R] Annotation database

2009-08-29 Thread Sukhbir Rattan
Hi, I have 15 CEL files of Affymetrix platform from GEO. Title of experiment is : Ecoli_ASv2 Affymetrix E. coli Antisense Genome Array. I am looking for the package available in R for this array for annotation. I have already tried doing annotation from packages like org.EcK12.eg.db but I

Re: [R] Annotation database

2009-08-29 Thread David Winsemius
On Aug 29, 2009, at 2:43 AM, Sukhbir Rattan wrote: Hi, I have 15 CEL files of Affymetrix platform from GEO. Title of experiment is : Ecoli_ASv2 Affymetrix E. coli Antisense Genome Array. I am looking for the package available in R for this array for annotation. I have already tried

Re: [R] Rcmdr installalation under Viata gives a warning. Do I need to do anything?

2009-08-29 Thread Stefan Grosse
On Fri, 28 Aug 2009 21:39:41 -0400 John Sorkin jsor...@grecc.umaryland.edu wrote: JS Windows Vista JS R 2.9.1 JS JS When trying to install Rcmdr I get the message shown below. What JS does it mean, do I need to do anything? JS JS The downloaded packages are in JS C:\Users\John JS

Re: [R] CHAID in R

2009-08-29 Thread Achim Zeileis
On Fri, 28 Aug 2009, Arup wrote: Hi..I am trying to run CHAID in R..I have installed the sofyware Party and trying to use the function ctree() to carry out the analysis. but I am getting the following message Error in terms.default(formula, data = data) : no terms component Without a simple

[R] Numeric, 2 ??? as a result of marix???

2009-08-29 Thread Wolfgang Polasek
Strange things are going on in R, if you reshape a matrix in R: g=gretldata[1:2,] g Empfang Versand Transit Inland AuslandSumS 1 787844.0 1307176.6 223395.4 1474726 16199.1 3809341 2 421473.1 306445.4 448801.2 1779402 14445.6 2970567 dim(g) [1] 2 6 as.vector(g) Empfang Versand

[R] script navigation in Vista

2009-08-29 Thread Wolfgang Polasek
Why is the option last changed not working if I open a script from R under Vista? Wolfgang [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Resolved: Problem in local ~/.fonts.conf broke symbol font in pdf device (Was: Re: Plotmath, sweave and lattice graphics interaction problem)

2009-08-29 Thread Gavin Simpson
On Sat, 2009-08-29 at 09:04 +1000, Duncan Mackay wrote: Hi Gavin I am running on windows and have no problem Thanks for confirming that this appears to be peculiar to my system, Duncan. I've narrowed this down to just the PDF device so nothing to do with Sweave and / or lattice as the

Re: [R] setting par(srt) according to plot aspect ratio

2009-08-29 Thread Jim Lemon
Levi Waldron wrote: For posterity's sake, here is the solution I figured out. Putting the following lines after the plot(f) command seems to set the angle correctly: myasp - (par(fin)[2]-par(mai)[1]-par(mai)[3])/(par(fin)[1]-par(mai)[2]-par(mai)[4]) (f_angle - atan(myasp)*180/pi) (g_angle -

Re: [R] Numeric, 2 ??? as a result of marix???

2009-08-29 Thread Duncan Murdoch
Wolfgang Polasek wrote: Strange things are going on in R, if you reshape a matrix in R: g=gretldata[1:2,] g Empfang Versand Transit Inland AuslandSumS 1 787844.0 1307176.6 223395.4 1474726 16199.1 3809341 2 421473.1 306445.4 448801.2 1779402 14445.6 2970567 dim(g)

Re: [R] script navigation in Vista

2009-08-29 Thread Stefan Grosse
On Sat, 29 Aug 2009 00:07:44 +0200 Wolfgang Polasek wolfgang.pola...@gmail.com wrote: WP Why is the option last changed not working if I open a script WP from R under Vista? Because it remembers the changes only of a current session? You should be a bit more descriptive: which editor? which R?

Re: [R] Numeric, 2 ??? as a result of marix???

2009-08-29 Thread Stefan Grosse
On Sat, 29 Aug 2009 00:15:45 +0200 Wolfgang Polasek wolfgang.pola...@gmail.com wrote: WP g=gretldata[1:2,] WP g WPEmpfang Versand Transit Inland AuslandSumS WP 1 787844.0 1307176.6 223395.4 1474726 16199.1 3809341 WP 2 421473.1 306445.4 448801.2 1779402 14445.6 2970567 WP dim(g)

Re: [R] Numeric, 2 ??? as a result of marix???

2009-08-29 Thread Gabor Grothendieck
g does not appear to be a matrix, as described. Its more likely a data frame. If that is the case then as.matrix(g) will create a matrix from it. Also depending on what you want to do ?unlist, ?t or ?c may be of help. Also try str(g) and dput(g) to see internals of object as they seem not to

[R] linear model with interaction / segments

2009-08-29 Thread Markus Gesmann
Dear R-help, Suppose I have the following data: df=data.frame(x=1:10, y=c(1,2,3,4,5,12,14,16,18,20)) plot(y~x, df, t=b) How can I fit a model which estimates the slopes between x = 1-5, 5-6, and 6-10? Adding the factor f: df$f - gl(2,5) Allows me to fit a linear model with interaction

Re: [R] Google's R Style Guide

2009-08-29 Thread Esmail
Duncan Murdoch wrote: On 8/28/2009 8:59 AM, Esmail wrote: Perhaps most of you have already seen this? http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html Comments/Critiques? The rules are mostly reasonable, though they aren't the ones followed in the R source. One bad

Re: [R] Google's R Style Guide

2009-08-29 Thread Esmail
(Ted Harding) wrote: On 28-Aug-09 12:59:24, Esmail wrote: Perhaps most of you have already seen this? http://google-styleguide.googlecode.com/svn/trunk/google-r-style.html Comments/Critiques? I think it is grossly over-prescriptive. For example: function names have initial capital

Re: [R] Google's R Style Guide

2009-08-29 Thread Esmail
Kingsford Jones wrote: A few thoughts: ... -- It's nice that people have made these guides available Agreed .. it helps those relatively new to the language (and possible other language biases) get their orientation. Cheers, Esmail __

Re: [R] Google's R Style Guide

2009-08-29 Thread Esmail
Barry Rowlingson wrote: On Fri, Aug 28, 2009 at 5:11 PM, hadley wickhamh.wick...@gmail.com wrote: In my view, that's the purpose of indenting - you see scope from indenting. *cough* python *cough* :-) (my favorite language at the moment) __

[R] Kolmogorov-Smirnov statistic

2009-08-29 Thread Gad Abraham
Hi, More of a statistical question, I'm trying to understand the formulation of the one-sample two-sided Kolmogorov-Smirnov statistic in stats::ks.test(), testing against a uniform distribution. Basically, it boils down to: x - rnorm(100) n - length(x) z - punif(sort(x)) - (0:(n - 1)) / n

[R] RFE: vectorize URLdecode

2009-08-29 Thread Jack Tanner
In R 2.9.2, URLdecode(c(a%20b, b%20c)) [1] a b Warning message: In charToRaw(URL) : argument should be a character vector of length 1 all but the first element will be ignored Could URLdecode be modified to actually process all elements of the vector, not just the first? Thanks in advance

Re: [R] RFE: vectorize URLdecode

2009-08-29 Thread Gabor Grothendieck
Here is a workaround URLdecode.vec - Vectorize(URLdecode) # test it out x - c(a%20b, b%20c) URLdecode.vec(x) On Sat, Aug 29, 2009 at 10:31 AM, Jack Tanneri...@hotmail.com wrote: In R 2.9.2, URLdecode(c(a%20b, b%20c)) [1] a b Warning message: In charToRaw(URL) : argument should be a

Re: [R] Best R text editors?

2009-08-29 Thread Zhiliang Ma
Emacs + ESS On Thu, Aug 27, 2009 at 12:43 PM, Jonathan Greenberggreenb...@ucdavis.edu wrote: Quick informal poll: what is everyone's favorite text editor for working with R?  I'd like to hear from people who are using editors that have some level of direct R interface (e.g. Tinn-R,

Re: [R] Google's R Style Guide

2009-08-29 Thread Max Kuhn
Perhaps this is obvious, but Ive never understood why this is the general convention: An opening curly brace should never go on its own line; I tend to do this: f - function() { if (TRUE) { cat(TRUE!!\n) } else { cat(FALSE!!\n) } } (I don't usually put one-liners in

[R] Anderson-Darling (one sample)

2009-08-29 Thread tzygmund mcfarlane
Hi, I would like to compute a goodness-of-fit statistic for one data series against a t-distribution, and obtain the quantiles of the distribution of the statistic with given degrees of freedom. I wonder if this is implemented in a package. I know that the critical values have to be computed for

Re: [R] Anderson-Darling (one sample)

2009-08-29 Thread stephen sefick
Do you know how to calculate what you want? Why not write a function- to do it and contribute to CRAN. On Sat, Aug 29, 2009 at 10:07 AM, tzygmund mcfarlanetzygm...@googlemail.com wrote: Hi, I would like to compute a goodness-of-fit statistic for one data series against a t-distribution, and

Re: [R] Google's R Style Guide

2009-08-29 Thread hadley wickham
An opening curly brace should never go on its own line; I tend to do this: f - function() {  if (TRUE)    {      cat(TRUE!!\n)    } else {      cat(FALSE!!\n)    } } (I don't usually put one-liners in if/else blocks; here I would have used ifelse) I haven't seen many others

Re: [R] Google's R Style Guide

2009-08-29 Thread Uwe Ligges
Max Kuhn wrote: Perhaps this is obvious, but Ive never understood why this is the general convention: An opening curly brace should never go on its own line; I tend to do this: f - function() { if (TRUE) { cat(TRUE!!\n) } else { cat(FALSE!!\n) } } (I don't

Re: [R] Google's R Style Guide

2009-08-29 Thread Corrado
I do not understand why one should use a S3 preferentially on a S4 class, if S4 is more rigorous. (The premiss is I am a newbie with OO programming in R, and would like to understand what is the proper way to OO program in R ) Regards On Saturday 29 August 2009 16:23:39 hadley wickham

Re: [R] how to index a list with a string?

2009-08-29 Thread Uwe Ligges
Peter Alspach wrote: Tena koe Try either L[foo()] or L[[foo()]] These return subtly (or not so subtly depending on your point of view) different results. which is quite important, hence read the documentation. [] returns a list of length 1 (or a vector of length 1 of type list) where [[]]

Re: [R] Google's R Style Guide

2009-08-29 Thread Philippe Grosjean
Max Kuhn wrote: Perhaps this is obvious, but Ive never understood why this is the general convention: An opening curly brace should never go on its own line; I tend to do this: f - function() { if (TRUE) { cat(TRUE!!\n) } else { cat(FALSE!!\n) } } (I don't usually

Re: [R] linear model with interaction / segments

2009-08-29 Thread David Winsemius
On Aug 29, 2009, at 7:56 AM, Markus Gesmann wrote: Dear R-help, Suppose I have the following data: df=data.frame(x=1:10, y=c(1,2,3,4,5,12,14,16,18,20)) plot(y~x, df, t=b) How can I fit a model which estimates the slopes between x = 1-5, 5-6, and 6-10? Adding the factor f: df$f -

Re: [R] cannot upgrade to R 2.9.1 in Ubuntu

2009-08-29 Thread Dirk Eddelbuettel
Luis, I missed this email earlier. Consider using r-sig-debian for Debian / Ubuntu question (but you need to subscribe before you can post). On 7 August 2009 at 13:27, Luis Ridao Cruz wrote: | R-help, | | At the moment the R version installed on my machine is 2.8.1. (Ubuntu 9.04) | I wish to

Re: [R] linear model with interaction / segments

2009-08-29 Thread Gavin Simpson
On Sat, 2009-08-29 at 12:56 +0100, Markus Gesmann wrote: Dear R-help, Suppose I have the following data: df=data.frame(x=1:10, y=c(1,2,3,4,5,12,14,16,18,20)) plot(y~x, df, t=b) How can I fit a model which estimates the slopes between x = 1-5, 5-6, and 6-10? Does the segmented

Re: [R] Google's R Style Guide

2009-08-29 Thread spencerg
S3 is very easy to change; S4 is very difficult. This provides advantages and disadvantages for both. Some people swear by one and curse the other -- from both sides. S4 is newer, and I have had problems in the past finding out what S4 methods are available and finding

Re: [R] adding factor scores back to an incomplete dataset...

2009-08-29 Thread Mark Difford
Hi David, Phil, Phil Spector wrote: David - Here's the easiest way I've been able to come up with. Easiest? You are making unnecessary work for yourselves and seem not to understand the purpose of ?naresid (i.e. na.action = na.exclude). Why not take the simple route that I gave, which really

Re: [R] Numeric, 2 ??? as a result of marix???

2009-08-29 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Wolfgang Polasek Sent: Friday, August 28, 2009 3:16 PM To: r-help@r-project.org Subject: [R] Numeric, 2 ??? as a result of marix??? Strange things are going on in R, if you

Re: [R] Google's R Style Guide

2009-08-29 Thread diegol
Max Kuhn wrote: Perhaps this is obvious, but Ive never understood why this is the general convention: An opening curly brace should never go on its own line; I tend to do this: f - function() { if (TRUE) { cat(TRUE!!\n) } else { cat(FALSE!!\n) } }

Re: [R] Within factor random factor

2009-08-29 Thread Juliet Hannah
Let's say that location defined a group, and observations may be more similar in a group. You could account for this similarity with the following model. model1 -lme(X~CorP,random=~1|location,data=mydata,method=ML) This fits a random intercept model grouped by location. This would assume that

Re: [R] Google's R Style Guide

2009-08-29 Thread Ted Harding
On 29-Aug-09 17:51:54, diegol wrote: Max Kuhn wrote: Perhaps this is obvious, but Ive never understood why this is the general convention: An opening curly brace should never go on its own line; I tend to do this: f - function() { if (TRUE) { cat(TRUE!!\n) } else {

Re: [R] RODBC: how to set the data-source?

2009-08-29 Thread Oliver Bandel
Dumblauskas, Jerry jerry.dumblauskas at credit-suisse.com writes: OK Is your PostGres server on the same Linux box you are running R on? Sample values Server = 169.49.30.69 (localhost host means you are on the same box) Port= 2700 (make sure your port is correct)

Re: [R] RODBC: how to set the data-source?

2009-08-29 Thread Oliver Bandel
Dumblauskas, Jerry jerry.dumblauskas at credit-suisse.com writes: [...] The alloc error means you are close... [...] Ah, ok, I see... ...then you are right that Driver has to be the path to the shared library. :-) Oliver __ R-help@r-project.org

[R] Sequence generation

2009-08-29 Thread njhuang86
Hey guys, I was wondering how to create this sequence: 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3... with the '1, 2, 3' repeated over 10 times. Also, is there a simple method to generate 1, 1, 1, 2, 2, 2, 3, 3, 3? Anyways, any help with be greatly appreciated! -- View this message in context:

Re: [R] Sequence generation

2009-08-29 Thread RIOS,ALFREDO ARTURO
I think should work rep(c(1,2,3),10) Alfredo On Sat Aug 29 15:14:15 EDT 2009, njhuang86 njhuan...@yahoo.com wrote: Hey guys, I was wondering how to create this sequence: 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3... with the '1, 2, 3' repeated over 10 times. Also, is there a simple method

[R] memisc/mtable: show only estimates (one line)

2009-08-29 Thread Frederik Elwert
Hello! mtable from memisc package shows estimates and standard error by default. I wanted to show only the estimates. Therefore, I created a new template: setCoefTemplate(simple=c(est=($est:#)($p:*))) But this leads to the following error when used: mtable(berk0,berk1,berk2,

Re: [R] Sequence generation

2009-08-29 Thread David Winsemius
On Aug 29, 2009, at 3:14 PM, njhuang86 wrote: Hey guys, I was wondering how to create this sequence: 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3... with the '1, 2, 3' repeated over 10 times. As noted earlier rep(1:3, 10) Also, is there a simple method to generate 1, 1, 1, 2, 2, 2, 3, 3, 3?

Re: [R] Sequence generation

2009-08-29 Thread Barry Rowlingson
On Sat, Aug 29, 2009 at 8:14 PM, njhuang86njhuan...@yahoo.com wrote: Hey guys, I was wondering how to create this sequence: 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3... with the '1, 2, 3' repeated over 10 times. rep(1:3,10) # rep repeats its first argument according to the number in its second

[R] RODBC: missing files? (Re: RODBC: how to set the data-source?)

2009-08-29 Thread Oliver Bandel
Hello, I stracet the R session when trying to connect to the database. Strange, that /etc/odbc.ini first should be opened with Append-mode: open(/etc/odbc.ini, O_WRONLY|O_CREAT|O_APPEND, 0666) = -1 EACCES (Permission denied) open(/etc/odbc.ini, O_RDONLY) = 3 fstat(3,

Re: [R] RODBC: missing files? (Re: RODBC: how to set the data-source?)

2009-08-29 Thread Oliver Bandel
Oliver Bandel oliver at first.in-berlin.de writes: [...] I assume for each entry in /etc/passwd until the one that os looked for, /etc/odbc.ini is opened once... ...maybe I should test this hypothesis... looks strange. [...] No, my loginname is in line 31 of /etc/passwd. oli...@siouxsie:~$

Re: [R] Google's R Style Guide

2009-08-29 Thread Duncan Murdoch
On 29/08/2009 12:03 PM, Corrado wrote: I do not understand why one should use a S3 preferentially on a S4 class, if S4 is more rigorous. As Spencer said, most people use either one or the other. I think it's generally a bad idea to mix them (there are strange semantics if you do that), so

Re: [R] Best R text editors?

2009-08-29 Thread Tal Galili
Great question to put up here :) My preferences: 1) notepad++ with NPPToR 2) tinn-R (was leading for a long time, but recently I decided to go with notepad++ ) 3) JGR / RCMDR (although RCMDR can be connected with the previous ones - and I wish it would get more developed) With the rest I didn't

Re: [R] Google's R Style Guide

2009-08-29 Thread John Sorkin
For my money, and perspective as one who has written a compiler, this reflects a failing of the R parser. Both if (TRUE) { cat(TRUE!!\n) } else { cat(FALSE!!\n) } and if (TRUE) { cat(TRUE!!\n) } else { cat(FALSE!!\n) } are easy to read, and should be accepted as

Re: [R] Google's R Style Guide

2009-08-29 Thread hadley wickham
But in interactive use the R parser is constrained to work a line at a time (unless it could predict what you were going to type next ;) Hadley On Sat, Aug 29, 2009 at 5:05 PM, John Sorkinjsor...@grecc.umaryland.edu wrote: For my money, and perspective as one who has written a compiler, this

Re: [R] Google's R Style Guide

2009-08-29 Thread Duncan Murdoch
On 29/08/2009 6:05 PM, John Sorkin wrote: For my money, and perspective as one who has written a compiler, this reflects a failing of the R parser. Both if (TRUE) { cat(TRUE!!\n) } else { cat(FALSE!!\n) } and if (TRUE) { cat(TRUE!!\n) } else { cat(FALSE!!\n) }

Re: [R] how to generate a random correlation matrix with restrictions

2009-08-29 Thread Kingsford Jones
Thanks Ravi -- with my limited linear algebra skills I was assuming invertible symmetric was sufficient (rather than just necessary) for positive definiteness. So, the open challenge is to generate a pd matrix of dimension 100 with r_ij = 1 if i=j else -1 r_ij 1, with about 10% of the elements

Re: [R] Sequence generation

2009-08-29 Thread Greg Snow
Or just use the 'each' argument to seq. -- 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.org [mailto:r-help-boun...@r- project.org] On Behalf Of Barry Rowlingson Sent:

[R] lrm in Design

2009-08-29 Thread loch1
Hello everybody, I am trying to do a logistic regression model with lrm() from the design package. I am comparing to groups with different medical outcome which can either be good or bad. In the help file it says that lrm codes al responses to 0,1,2,3, etc. internally and does so in alphabetical

Re: [R] std.error

2009-08-29 Thread Jim Lemon
Mcdonald, Grant wrote: dear sir, i am trying to calculate the standard error of my data (x), i have tried se(x, na.rm=TRUE) and std.error(x) neither have worked and i cannot find an alternative Hi Grant, There is a convenience function std.error that calculates the conventional

Re: [R] std.error

2009-08-29 Thread Bill.Venables
Standard error usually means the estimated standard deviation of a parameter estimate, e.g. the sample mean. Perhaps you mean the estimated standard deviation of the data. If so sdev - sd(x, na.rm = TRUE) If you want the standard error of the mean there are several ways of doing it. Perhaps

Re: [R] how to generate a random correlation matrix with restrictions

2009-08-29 Thread Ravi Varadhan
Yes, Kingsford. This problem does not appear to be trival. I am not sure if there is any literature on this. I have seen a paper by Davies and Higham (BIT 2000) on Stable generation of correlation matrices. There is also a paper by Harry Joe on generating correlation matrices with given

Re: [R] lrm in Design

2009-08-29 Thread Gabor Grothendieck
See: https://stat.ethz.ch/pipermail/r-help/2009-July/204192.html and also other posts in that thread. On Sat, Aug 29, 2009 at 6:02 PM, loch1l...@gmx.li wrote: Hello everybody, I am trying to do a logistic regression model with lrm() from the design package. I am comparing to groups with

[R] Infinite != NaN?

2009-08-29 Thread Michael Hannon
Greetings. I somehow had the impression that an infinite number, as obtained by dividing by zero, for instance, would be flagged as both missing (NA) and not a number (NaN). It appears that I was wrong on both counts, although the is.finite function correctly returns FALSE in such a case.

Re: [R] Infinite != NaN?

2009-08-29 Thread David Winsemius
It is not clear that you have read the help page that arise with: ?Inf Note: In R, basically all mathematical functions (including basic Arithmetic), are supposed to work properly with +/- Inf and NaN as input or output. The basic rule should be that calls and relations with Infs really

Re: [R] RFE: vectorize URLdecode

2009-08-29 Thread Horner, Jeff
Not sure if your context is rapache, but if so urlEncode() and urlDecode() are available to you and are vectorized: http://biostat.mc.vanderbilt.edu/rapache/manual.html#urlEncode Best, Jeff -Original Message- From: r-help-boun...@r-project.org on behalf of Jack Tanner Sent: Sat

[R] aggregating irregular time series

2009-08-29 Thread R_help Help
Hi, I have a couple of aggregation operations that I don't know how to accomplish. Let me give an example. I have the following irregular time series time x 10:00:00.02120 10:00:00.22420 10:00:01.00219 10:00:02:948

[R] POSIX time conversion doesn't display digit

2009-08-29 Thread R_help Help
Hi, I have the following string that I converted to a POSIXct: a - 2009-08-24 10:00:00.213 a.p - strptime(a,%Y-%m-%d %H:%M:%OS) as.double(as.POSIXct(a.p)) [1] 1251122400 I can't seem to get the decimal fraction of .213 out by casting to double or numeric. Is there anyway to make sure that