Re: [R] searching for data.frame rows / processing of rows

2006-10-05 Thread Gabor Grothendieck
Grouping the data frame by the first two columns, apply colMeans and then rbind the resulting by-structure together: do.call(rbind, by(DF, DF[2:1], colMeans, na.rm = TRUE)) On 10/5/06, Greg Tarpinian [EMAIL PROTECTED] wrote: R 2.3.1, WinXP: I have a puzzling problem that I suspect may be

Re: [R] help with script

2006-10-05 Thread Gabor Grothendieck
On 10/4/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Also see package caTools. On 10/4/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: See: http://tolstoy.newcastle.edu.au/R/help/04/10/5161.html On 10/4/06, JOHN VOIKLIS [EMAIL PROTECTED] wrote: Hello, I wrote the function,

[R] A statement over multiple lines (i.e. the ... feature in Matlab)

2006-10-05 Thread Wee-Jin Goh
Hello again list, I thought I'd start a new thread, seeing as it's completely different from my previous question. Some functions I have written require many parameters, and so do not fit nicely into an 80 column width display. This is usually avoided, by spreading that particular statement

[R] Variables in RODBC environment

2006-10-05 Thread Thorsten Muehge
Hello Experts, how can I use variables in the RODBC environment. Example which does not work: Thanks for your help. Thorsten pn - '39R5238'; library(RODBC); odbcobj - odbcConnect(SQUIT21C,uid=muehge,pwd=xxx); sql - select u.unitid, from test where part in ('pn') ; parameter -

Re: [R] A statement over multiple lines (i.e. the ... feature in Matlab)

2006-10-05 Thread Robin Hankin
Hi Wee-Jin you can block out bits of R code with if(FALSE){ code not executed } For the line breaking, R deals with incomplete lines by not executing the statement until you finish it. In the function case, it waits for you to close a bracket. If you type: myFunc(a=3, b=5, c=6, d=7 )

Re: [R] R Graphics: Saving PDF and other formats from Windows Graphic Device for LaTeX

2006-10-05 Thread Stefan Grosse
pdf(sgr6100.pdf, horizontal=FALSE, onefile=FALSE, height=3, width=3, pointsize=6) Reducing point-size below 6 does not seem to make any difference to the size of text and symbols. Any suggestions to get smaller font sizes? I have never used the pointsize option. Increasing the height

Re: [R] A statement over multiple lines (i.e. the ... feature in Matlab)

2006-10-05 Thread Wee-Jin Goh
On 5 Oct 2006, at 08:39, Robin Hankin wrote: Hi Wee-Jin you can block out bits of R code with if(FALSE){ code not executed } For the line breaking, R deals with incomplete lines by not executing the statement until you finish it. In the function case, it waits for you to close

Re: [R] A statement over multiple lines (i.e. the ... feature in

2006-10-05 Thread Ted Harding
On 05-Oct-06 Wee-Jin Goh wrote: Hello again list, I thought I'd start a new thread, seeing as it's completely different from my previous question. Some functions I have written require many parameters, and so do not fit nicely into an 80 column width display. This is usually avoided,

Re: [R] A statement over multiple lines (i.e. the ... feature in Matlab)

2006-10-05 Thread Bjørn-Helge Mevik
Robin Hankin wrote: For the line breaking, R deals with incomplete lines by not executing the statement until you finish it. Beware, however, that syntactically valid lines do get executed immediately (at least at the prompt). So 1 + 2 - 3 will be interpreted as two commands (returning 3

Re: [R] A statement over multiple lines (i.e. the ... feature in Matlab)

2006-10-05 Thread Robin Hankin
On 5 Oct 2006, at 09:34, Bjørn-Helge Mevik wrote: Robin Hankin wrote: For the line breaking, R deals with incomplete lines by not executing the statement until you finish it. Beware, however, that syntactically valid lines do get executed immediately (at least at the prompt). yes,

Re: [R] Block comments in R?

2006-10-05 Thread Uwe Ligges
Wee-Jin Goh wrote: Hello list, Is there any way to perform a block comment in R? In C++, anything in between a /* and */ is considered a comment, and it allows programmers to comment out chunks of code for testing and debugging. Is there such a feature in R? This has frequently

Re: [R] compiling rgdal package on windows / macos

2006-10-05 Thread Roger Bivand
On Wed, 4 Oct 2006, Dylan Beaudette wrote: Greetings: As I am not a windows user, I cannot try this: is it possible to install rgdal on windows without having to compile it from source ? Andy Jaworski already replied that rgdal Windows binaries are available from CRAN mirrors, thanks to

Re: [R] Block comments in R?

2006-10-05 Thread Robin Hankin
On 5 Oct 2006, at 10:05, Uwe Ligges wrote: Wee-Jin Goh wrote: Hello list, Is there any way to perform a block comment in R? In C++, anything in between a /* and */ is considered a comment, and it allows programmers to comment out chunks of code for testing and debugging. Is there such a

Re: [R] Block comments in R?

2006-10-05 Thread Uwe Ligges
Robin Hankin wrote: On 5 Oct 2006, at 10:05, Uwe Ligges wrote: Wee-Jin Goh wrote: Hello list, Is there any way to perform a block comment in R? In C++, anything in between a /* and */ is considered a comment, and it allows programmers to comment out chunks of code for testing and

Re: [R] searching for data.frame rows / processing of rows

2006-10-05 Thread chao gai
I tought that aggregate was the way to go, but only for large dataframes it is faster. df - read.table(stdin(),header=TRUE) 0: Location TimeXY 1: 1 0 1.6 9.3 2: 1 3 4.2 10.4 3: 1 6 2.7 16.3 4: 2 0 0.5 2.1 5: 2

Re: [R] Variables in RODBC environment

2006-10-05 Thread Søren Merser
hi, use paste: # a string/number/date pn - '39R5238'; sql - paste(select u.unitid from test where part =, pn) ^^ # an array of strings/numbers/dates pn=c(1,2,3,4) sql - paste(select u.unitid from test where part in (,

[R] VGAM Package ?

2006-10-05 Thread KOITA Lassana - STAC/ACE
Hi! R users I would like to ask you where could we find the VGAM Package. I don't find it in the list of packages. Thak you for your help Lassana KOITA Etudes de Sécurité et d'Exploitation aéroportuaires / Safety Study Statistical analysis Service Technique de l'Aviation Civile (STAC) /

Re: [R] VGAM Package ?

2006-10-05 Thread David Scott
google VGAM On Thu, 5 Oct 2006, KOITA Lassana - STAC/ACE wrote: Hi! R users I would like to ask you where could we find the VGAM Package. I don't find it in the list of packages. Thak you for your help Lassana KOITA Etudes de Sécurité et d'Exploitation aéroportuaires / Safety Study

Re: [R] (not so real) function (more like #include)

2006-10-05 Thread Meinhard Ploner
Thanks a lot! longfun2 longfun3 work perfect for my very untypical problem. As I have many local variables, usual functions with parameters are very uncomfortable, but the code you gave me is great! Meinhard On Oct 4, 2006, at 5:25 PM, Gabor Grothendieck wrote: longfun could just pass

Re: [R] Variables in RODBC environment

2006-10-05 Thread Bonfigli Sandro
how can I use variables in the RODBC environment. Example which does not work: Thanks for your help. Thorsten pn - '39R5238'; library(RODBC); odbcobj - odbcConnect(SQUIT21C,uid=muehge,pwd=xxx); sql - select u.unitid, from test where part in ('pn') ; parameter -

Re: [R] VGAM Package ?

2006-10-05 Thread Gavin Simpson
On Thu, 2006-10-05 at 11:39 +0200, KOITA Lassana - STAC/ACE wrote: Hi! R users I would like to ask you where could we find the VGAM Package. I don't find it in the list of packages. Thak you for your help Lassana KOITA That's because it isn't on CRAN yet. You can find a link to

[R] format of data for use in clim.pact

2006-10-05 Thread isidora k
Goodmorning everyone! Just a quick question: I want to apply eof analysis and downscaling using the clim.pact package. What form should my data have? Only netCDF? Right now my data are of the form of ascii files for each month with 3 columns corresponding to latitude, longitude and value of my

[R] glm with nesting

2006-10-05 Thread Jeffrey Stratford
I just had a manuscript returned with the biggest problem being the analysis. Instead of using principal components in a regression I've been asked to analyze a few variables separately. So that's what I'm doing. I pulled a feather from young birds and we quantified certain aspects of the color

Re: [R] glm with nesting

2006-10-05 Thread Peter Dalgaard
Jeffrey Stratford [EMAIL PROTECTED] writes: I just had a manuscript returned with the biggest problem being the analysis. Instead of using principal components in a regression I've been asked to analyze a few variables separately. So that's what I'm doing. I pulled a feather from young

[R] [Fwd: Re: Block comments in R?]

2006-10-05 Thread Philippe Grosjean
Ooops! Sorry, I send it only to Uwe Ligges the first time. Best, Philippe Grosjean This is perhaps another solution, more elegant in the way the block comment is written... but it requires to redefine `!` and slows it a little bit because it tests first its arguments before calling

[R] Partition into quantiles

2006-10-05 Thread Alberto Monteiro
Is there any function that divides a sample into N quantiles? For example, for N = 2, this would be the solution: x - rnorm(100) m - median(x) q - ifelse(x = median, 1, 2) Alberto Monteiro __ R-help@stat.math.ethz.ch mailing list

Re: [R] Partition into quantiles

2006-10-05 Thread Peter Dalgaard
Alberto Monteiro [EMAIL PROTECTED] writes: Is there any function that divides a sample into N quantiles? For example, for N = 2, this would be the solution: x - rnorm(100) m - median(x) q - ifelse(x = median, 1, 2) Have a look at N - 2 table(cut(x,quantile(x,seq(0,1,1/N)),

Re: [R] Partition into quantiles

2006-10-05 Thread Richard M. Heiberger
cut.quantile - function(x, N, use.ppoints=TRUE) { qq - if (use.ppoints) c(0,ppoints(N-1),1) else seq(0, 1, 1/N) breaks - quantile(x, qq) breaks[1] - breaks[1] - 1 breaks[N+1] - breaks[N+1]+1 cut(x, breaks) } tmpT - cut.quantile(rnorm(100), 10, TRUE) table(tmpT) tmpF -

Re: [R] Partition into quantiles

2006-10-05 Thread David Barron
You might also want to look at the function quantcut in the gtools package (part of the gregmisc bundle). On 05/10/06, Alberto Monteiro [EMAIL PROTECTED] wrote: Is there any function that divides a sample into N quantiles? For example, for N = 2, this would be the solution: x - rnorm(100)

Re: [R] [Fwd: Re: Block comments in R?]

2006-10-05 Thread Barry Rowlingson
Philippe Grosjean wrote: It takes advantage of `!` being not defined for character arguments: *gasp* how much R code is destined to feature on www.thedailywtf.com in the future? whats the chances of block commenting being included in a future version? and more generally, is there

Re: [R] glm with nesting

2006-10-05 Thread Jeffrey Stratford
Peter and list, Thanks for the response. A did add box as a factor (box - factor(box)). Julian should be linear - bluebird chicks are bluer as the season progresses from March to August. I did try the following rtot.lme - lmer(rtot ~ sex +(purban|box:chick) + (purban|box), data=bb,

Re: [R] [Fwd: Re: Block comments in R?]

2006-10-05 Thread Duncan Murdoch
On 2006-10-5 9:20, Barry Rowlingson wrote: Philippe Grosjean wrote: It takes advantage of `!` being not defined for character arguments: *gasp* how much R code is destined to feature on www.thedailywtf.com in the future? whats the chances of block commenting being included

Re: [R] glm with nesting

2006-10-05 Thread Doran, Harold
It's not really possible to help without knowing what errors you received and maybe some reproducible code. I think I remember this, though. From what I recall, there was no distinction between box and chick, so you cannot estimate both variance components. -Original Message- From:

[R] Changes in console preferences won't take

2006-10-05 Thread David Kaplan
Greetings, I've attempted to change the font size directly in Rconsole as well as through the GUI preferences. Neither seems to take even when I save the preference changes. When I make the change through the gui preference, and click apply the change is made, but when I save it, close, and

Re: [R] Block comments in R?

2006-10-05 Thread Seth Falcon
Uwe Ligges [EMAIL PROTECTED] writes: Use an editor that comments out a whole block which is what I do all the time, e.g. use Tinn-R, Emacs or WinEdt, to mention just a few of them. This, of course, works. The if(FALSE) approach does not because it requires the comment to be syntactically

Re: [R] Partition into quantiles

2006-10-05 Thread Frank E Harrell Jr
David Barron wrote: You might also want to look at the function quantcut in the gtools package (part of the gregmisc bundle). Also, cut2 in Hmisc will do this and will label the intervals compactly. Frank On 05/10/06, Alberto Monteiro [EMAIL PROTECTED] wrote: Is there any function

[R] research

2006-10-05 Thread aziz tomi
dear sir iam algerian student iam 30 years old i finished my postgraduate in applied economic and statistics .i prepare my doctorat about effect of kyoto protocol on our economic. i need the document and the articals and the adress of doctor in this domain in your university i

Re: [R] Partition into quantiles

2006-10-05 Thread Alberto Monteiro
Sorry, folks. Thanks for the help, but none of the suggestions worked quite as I wanted :-/ So I wrote the code. It seems to work: gera_particao - function(x, n) { y - sort(x) icut - as.integer(seq(1, length(x)+1, length = n + 1)) icut - icut[c(-(n+1))] ycut - y[icut] for (i in

Re: [R] warning message in nlm

2006-10-05 Thread Spencer Graves
Without 'msc39', I can't say for sure, but I doubt if it's anything to worry about. It looks like 'nlm' tests values for theta and len that produce either NA or Inf in computing 'loglikcs'. Since you got an answer, it does not look to me like it's anything worth worrying about; just

Re: [R] Block comments in R?

2006-10-05 Thread Peter Dalgaard
Seth Falcon [EMAIL PROTECTED] writes: Uwe Ligges [EMAIL PROTECTED] writes: Use an editor that comments out a whole block which is what I do all the time, e.g. use Tinn-R, Emacs or WinEdt, to mention just a few of them. This, of course, works. The if(FALSE) approach does not because it

[R] matrix multiplication

2006-10-05 Thread Ya-Hsiu Chuang
Dear all, I have 2 matrices, one is a 8x3 matrix, called X; the other matrix is a 3x3 indicator matrix with the diagonal element as 0 or 1. when a variable is included in the model, the corresponding diagonal element is 1, otherwise, it is 0. Let A be a set of matrices that contain the

Re: [R] Changes in console preferences won't take

2006-10-05 Thread Duncan Murdoch
On 10/5/2006 9:41 AM, David Kaplan wrote: Greetings, I've attempted to change the font size directly in Rconsole as well as through the GUI preferences. Neither seems to take even when I save the preference changes. When I make the change through the gui preference, and click apply the

Re: [R] glm with nesting

2006-10-05 Thread Jeffrey Stratford
Harold and list, I've changed a few things since the last time so I'm really starting from scratch. I start with bbmale - read.csv(c:\\eabl\\2004\\feathers\\male_feathers2.csv, header=TRUE) box -factor(box) chick - factor(chick) Here's a sample of the data

Re: [R] Plotting text with lattice

2006-10-05 Thread Ritwik Sinha
Hi, On a related note, if I wanted to add different texts to different panels, should I stick to using trellis.focus() for each text in each panel? I cannot figure out a way to do it using a panel function. Ritwik. On 9/29/06, Deepayan Sarkar [EMAIL PROTECTED] wrote: On 9/29/06, Gabor

Re: [R] Block comments in R?

2006-10-05 Thread hadley wickham
Still gives you problems with nested comments. *IF* we want to go down that route, we should have directional symbols like dsaldfysdfk What about heredocs? (http://en.wikipedia.org/wiki/Heredoc) Hadley __ R-help@stat.math.ethz.ch mailing list

Re: [R] Block comments in R?

2006-10-05 Thread Martin Maechler
PD == Peter Dalgaard [EMAIL PROTECTED] on 05 Oct 2006 16:12:50 +0200 writes: PD Seth Falcon [EMAIL PROTECTED] writes: Uwe Ligges [EMAIL PROTECTED] writes: Use an editor that comments out a whole block which is what I do all the time, e.g. use Tinn-R, Emacs or WinEdt,

Re: [R] treatment effect at specific time point within mixed effects model

2006-10-05 Thread Afshartous, David
Hi Spencer, Thanks for your reply. I don't think this answers my question. If I understand correctly, your model simply removes the intercept and thus the intercept in fm1 is the same as the first time factor in fm1a ... but am I confused as to why the other coefficient estimates are now

Re: [R] Block comments in R?

2006-10-05 Thread Duncan Murdoch
On 10/5/2006 10:57 AM, Martin Maechler wrote: ## ... ## but I'm not yet fond of the general idea. Martin Is that just because you don't need it, or that you see something objectionable in it? Duncan Murdoch __

Re: [R] Plotting text with lattice

2006-10-05 Thread Gabor Grothendieck
This requires R 2.4.0. Its the same as my earlier example except the labels= arg has been changed to labels=which.packet(). xyplot(x ~ x | g, data = data.frame(x = 1:12), panel = function(...) { panel.xyplot(...) panel.text(x=2, y=4, labels=which.packet()) }) On 10/5/06, Ritwik

Re: [R] Block comments in R?

2006-10-05 Thread Barry Rowlingson
Seth Falcon wrote: My wtf feature request is to add a multiline string delimiter ala Python like . Anything that makes R more like Python syntax gets a +1 from me. How about getting rid of curly brackets for blocks and using indenting in R? Time to attack gram.y with a

[R] lmer BIC changes between output and anova

2006-10-05 Thread Darren M. Ward
list, i am using lmer to fit multilevel models and trying to use anova to compare the models. however, whenever i run the anova, the AIC, BIC and loglik are different from the original model output- as below. can someone help me out with why this is happening? (i'm hoping the output

Re: [R] glm with nesting

2006-10-05 Thread Berton Gunter
Jeffrey: Please... May I repeat what Peter Dalgaard already said: consult a local statistician. The structure of your study is sufficiently complicated that your stat 101 training is inadequate. Get professional help, which this list is not set up to provide (though it often does, through the

Re: [R] treatment effect at specific time point within mixedeffects model

2006-10-05 Thread Doran, Harold
Hi David: In looking at your original post it is a bit difficult to ascertain exactly what your null hypothesis was. That is, you want to assess whether there is a treatment effect at time 3, but compared to what. I think your second post clears this up. You should refer to pages 224- 225 of

[R] unexpected behavior of boxplot(x, notch=TRUE, log=y)

2006-10-05 Thread bogdan romocea
A function I've been using for a while returned a surprising [to me, given the data] error recently: Error in plot.window(xlim, ylim, log, asp, ...) : Logarithmic axis must have positive limits After some digging I realized what was going on: x - c(10460.97, 10808.67, 29499.98, 1,

[R] Fw: Bivariate Weibull distribution -- Copula

2006-10-05 Thread Jenny Stadt
I repost this in order for more responses. Thanks! From: Jenny Stadt Sent: 2006-10-04 16:49:33 To: r-help@stat.math.ethz.ch CC: Subject: [R] Bivariate Weibull distribution -- Copula Hi All, I am struggling in a bivariate Weibull distribution although I searched R-Site-Help and found

Re: [R] Block comments in R?

2006-10-05 Thread Martin Maechler
Duncan == Duncan Murdoch [EMAIL PROTECTED] on Thu, 05 Oct 2006 11:13:03 -0400 writes: Duncan On 10/5/2006 10:57 AM, Martin Maechler wrote: ## ... ## but I'm not yet fond of the general idea. Martin Duncan Is that just because you don't

[R] mixed models: correlation between fixed and random effects??

2006-10-05 Thread Bruno L. Giordano
Hello, I built 4 mixed models using different data sets and standardized variables as predictors. In all the models each of the fixed effects has an associated random effect (same predictor). What I find is that fixed effects with larger (absolute) standardized parameter estimates have also a

Re: [R] Block comments in R?

2006-10-05 Thread Gabor Grothendieck
There are two places that I find the current way it works to be less than ideal although its not that bad either: 1 .when one wants to define strings that have quotes then one must be careful to use double quoted strings to contain single quotes and single quoted strings to contain double quotes

Re: [R] treatment effect at specific time point within mixedeffects model

2006-10-05 Thread Afshartous, David
Hi Harold, Thanks for your response. I'll check out p.224 in PB, thanks. The null hypothesis is that there is no difference between say A=[time=3, drug=I] and B=[time=3, drug=P], or mu_A = mu_B. If the study is a crossover design, i.e., each patient receives drug=I and drug=P, I assume that

Re: [R] (not so real) function (more like #include)

2006-10-05 Thread Gabor Grothendieck
I thought of a few more possibilities. If options 1, 2 and 3 correspond to longfun, longfun2 and longfun3 then: 4. We could arrange it so that the variables are stored outside of longfun and then longfun, f1 and f2 reference them symmetrically. a - b - d - 1 longfun4 - function() { out -

[R] any package can visualize original affymetrix data?

2006-10-05 Thread Baoqiang Cao
Dear All, I'm thinking of visualizing the original binary data from affymetrix. Would you recommend any package? Not necessarily limited to R packages. Thanks! Best, -Cao __ R-help@stat.math.ethz.ch mailing list

[R] convert day of week from number to character and include in lm

2006-10-05 Thread Spencer Jones
All, I am trying to include a day of week variable (1-7) in in a regression model. I would like to have the day of week treated as a categorical variable rather than a number the code looks like lm( dep ~ WKDY) I know this is a basic question, but help would be appreciated thanks spencer

Re: [R] treatment effect at specific time point within mixedeffects model

2006-10-05 Thread Chuck Cleland
Afshartous, David wrote: Hi Harold, Thanks for your response. I'll check out p.224 in PB, thanks. The null hypothesis is that there is no difference between say A=[time=3, drug=I] and B=[time=3, drug=P], or mu_A = mu_B. If the study is a crossover design, i.e., each patient

Re: [R] Block comments in R?

2006-10-05 Thread BBands
+1 for Python style comments. your comments here and some more ... and some related info jab -- John Bollinger, CFA, CMT www.BollingerBands.com If you advance far enough, you arrive at the beginning. __ R-help@stat.math.ethz.ch mailing list

[R] The W statistic in wilcox.exact

2006-10-05 Thread Jue.Wang2
Does anyone know why wilcox.exact gives W-statistic 6 instead of 12 as indicated below. 12 is the rank sum of group 0 of x, which is the linear statistic computed by wilcox_test. y-c(1,2,3,4,5) x-c(1,1,0,0,0) (a) wilcox.exact wilcox.exact(y~x) Exact Wilcoxon rank sum test data: y by x W =

[R] Multivariate AR - prediction

2006-10-05 Thread Fleischer Alexander 0969 SPI
Hi, does anybody know how to predict a multivariate AR within R? If I just estimate a multi AR-object and plug it into predict I get an error from the aperm - just works for univariates. thx alex __ R-help@stat.math.ethz.ch mailing list

Re: [R] Plotting text with lattice

2006-10-05 Thread Gabor Grothendieck
I seem to have omitted g library(lattice) xyplot(x ~ x | g, data = data.frame(x = 1:12, g = gl(3,4)), panel = function(...) { panel.xyplot(...) panel.text(x=2, y=4, labels=which.packet()) }) On 10/5/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: This requires R 2.4.0. Its the

[R] [R-pkgs] new package proptest

2006-10-05 Thread David Kraus
Dear R users, The package proptest (http://www.davidkraus.net/proptest/) has been recently released to CRAN. The package provides functions for testing the proportional hazards assumption in the Cox model for right censored survival data. Two types of tests for identifying nonproportional

Re: [R] R Graphics: Saving PDF and other formats from Windows Graphic Device for LaTeX

2006-10-05 Thread Jens Scheidtmann
Anupam Tyagi [EMAIL PROTECTED] writes: [...] What is the best format to save R graphics for inclusion into a LaTeX documents? When using pdflatex use pdf for graphics as reference format. Using ps2pdf or some such may have some problems when it comes to alpha channels and transparency. [...]

Re: [R] littler release 0.0.6

2006-10-05 Thread Jeffrey Horner
For those of you who are littler fans, you'll be pleased to know that we've already decommissioned version 0.0.6 in light of the new and improved 0.0.7 (actually 0.0.6 was broken because of a missing file). You can get it from the links below. Jeff --

[R] Help on plot multiple plot(hexbin) in the same page

2006-10-05 Thread Li, Sue
Dear R-users, I try to plot multiple plots of hexbin in the same page. However, par does not work when hexbin is used. Neither do xlim and ylim. Any ideas? Thanks, Sue [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch

[R] Writing Text into Plots

2006-10-05 Thread Lothar Botelho-Machado
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I have a simple question on the text() method in plots, e.g.: text(3,4,adj=1,cex=1.0, expression(alpha == beta)) I know there exists a lot more like frac(), etc which could be used for expression. But a help(frac) doesn't return any results

Re: [R] matrix multiplication

2006-10-05 Thread Ferdinand Alimadhi
Is this what you want ? A1-matrix(c(1,0,0,0,0,0,0,0,0),3) A2-matrix(c(1,0,0,0,1,0,0,0,0),3) A3-matrix(c(1,0,0,0,1,0,0,1,0),3) X - matrix(1:24,8) XX-list() for(i in 1:3){ + XX[[i]]-X%*%A[[i]] + } XX [[1]] [,1] [,2] [,3] [1,]100 [2,]200 [3,]300

Re: [R] R Graphics: Saving PDF and other formats from Windows Graphic Device for LaTeX

2006-10-05 Thread Mike Prager
Jens Scheidtmann [EMAIL PROTECTED] wrote: Indispensable is having a good editing cycle. I.e. compile the latex, jump to the position where you are editing the file in the preview, double click somewhere in the preview, move to that position in your editor (or at least near that position).

[R] How to get the function names

2006-10-05 Thread Søren Højsgaard
I've defined the function getFunNames - function(FUN){ if (!is.list(FUN)) fun.names - paste(deparse(substitute(FUN)), collapse = ) else fun.names - unlist(lapply(substitute(FUN)[-1], function(a) paste(a))) fun.names } which gives what I want : getFunNames(mean) [1] mean

Re: [R] The W statistic in wilcox.exact

2006-10-05 Thread Christos Hatzis
Probably because of the offset: U = W - n*(n+1)/2 In your example, W=12 (=3+4+5) as reported by wilcox.test. The offset is 6 (=3*4/2) and therefore U=6. I am not certain as I haven't installed the exactRankTests package, but it seems that wilcox.exact reports U instead of W. -Christos Hatzis

[R] xyplot

2006-10-05 Thread Osman Al-Radi
Hi, for the data below: time-c(rep(1:10,5)) y-time+rnorm(50,5,2) subject-c(rep('a',10),rep('b',10),rep('c',10),rep('d',10),rep('e',10)) group-c(rep('A',30),rep('B',20)) df-data.frame(subject,group,time,y) I'd like to produce a plot with a single pannel with two loess curves one for each group.

Re: [R] Writing Text into Plots

2006-10-05 Thread Duncan Murdoch
On 10/5/2006 4:10 PM, Lothar Botelho-Machado wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I have a simple question on the text() method in plots, e.g.: text(3,4,adj=1,cex=1.0, expression(alpha == beta)) I know there exists a lot more like frac(), etc which could be

Re: [R] Writing Text into Plots

2006-10-05 Thread Marc Schwartz
On Thu, 2006-10-05 at 22:10 +0200, Lothar Botelho-Machado wrote: Hello, I have a simple question on the text() method in plots, e.g.: text(3,4,adj=1,cex=1.0, expression(alpha == beta)) I know there exists a lot more like frac(), etc which could be used for expression. But a help(frac)

[R] which command

2006-10-05 Thread AgusSusanto
I obtained error messages when I run these commands in UNIX, but I obtained correct result when I run these command in WINDOWS. Can somebody point out the problem and give the solution. Thanks. dt-read.table(file=Fall.dat) dim(dt) [1] 19415 table(dt$V2) 0 1 2 3 220 989 639

[R] Matrix input problem

2006-10-05 Thread Bill Wyatt
Hi, Included is an R.script that came from a much large date set being read in to R from a .txt file. Why is it that the first line codes with an error, but the second line works fine? Is there some line length limit in R? This happens at random places all through my data. Any help would be

Re: [R] xyplot

2006-10-05 Thread Sundar Dorai-Raj
Osman Al-Radi said the following on 10/5/2006 3:43 PM: Hi, for the data below: time-c(rep(1:10,5)) y-time+rnorm(50,5,2) subject-c(rep('a',10),rep('b',10),rep('c',10),rep('d',10),rep('e',10)) group-c(rep('A',30),rep('B',20)) df-data.frame(subject,group,time,y) I'd like to produce a

[R] which command

2006-10-05 Thread AgusSusanto
I obtained error messages when I run these commands in UNIX, but I obtained correct result when I run these command in WINDOWS. Can somebody point out the problem and give the solution. Thanks. dt-read.table(file=Fall.dat) dim(dt) [1] 19415 table(dt$V2) 0 1 2 3 220 989 639

Re: [R] How to get the function names

2006-10-05 Thread Duncan Murdoch
On 10/5/2006 4:41 PM, Søren Højsgaard wrote: I've defined the function getFunNames - function(FUN){ if (!is.list(FUN)) fun.names - paste(deparse(substitute(FUN)), collapse = ) else fun.names - unlist(lapply(substitute(FUN)[-1], function(a) paste(a))) fun.names } which

Re: [R] xyplot

2006-10-05 Thread Deepayan Sarkar
On 10/5/06, Osman Al-Radi [EMAIL PROTECTED] wrote: Hi, for the data below: time-c(rep(1:10,5)) y-time+rnorm(50,5,2) subject-c(rep('a',10),rep('b',10),rep('c',10),rep('d',10),rep('e',10)) group-c(rep('A',30),rep('B',20)) df-data.frame(subject,group,time,y) I'd like to produce a plot with

Re: [R] Matrix input problem

2006-10-05 Thread Duncan Murdoch
On 10/5/2006 4:52 PM, Bill Wyatt wrote: Hi, Included is an R.script that came from a much large date set being read in to R from a .txt file. Why is it that the first line codes with an error, but the second line works fine? I get syntax errors on both, due to the missing comma at the

Re: [R] How to get the function names

2006-10-05 Thread Jerome Asselin
On Thu, 2006-10-05 at 22:41 +0200, Søren Højsgaard wrote: I've defined the function getFunNames - function(FUN){ if (!is.list(FUN)) fun.names - paste(deparse(substitute(FUN)), collapse = ) else fun.names - unlist(lapply(substitute(FUN)[-1], function(a) paste(a)))

Re: [R] Writing Text into Plots

2006-10-05 Thread Lothar Botelho-Machado
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Duncan Murdoch wrote: On 10/5/2006 4:10 PM, Lothar Botelho-Machado wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I have a simple question on the text() method in plots, e.g.: text(3,4,adj=1,cex=1.0, expression(alpha == beta))

Re: [R] The W statistic in wilcox.exact

2006-10-05 Thread Christos Hatzis
Jue, On a second look, it appears that wilcox.test does report the offset-adjusted statistic U, as also mentioned in the help page. wilcox.test returns W=6 (instead of 12 as your example showed, unless wilcox_test is a different function). wilcox.test( 1:5 ~ c(1,1,0,0,0) )$statistic # or

Re: [R] which command

2006-10-05 Thread Don MacQueen
Are you sure Fall.dat is identical on both platforms, and that dt is also? Did you intend to ignore the cases where dt$V2 equals zero? Try, for example, table(which(dt[,2] == 0)) ## also ==1, ==2, ==3 unique( dt[which(dt[,2] == 0),5]## also ==1, ==2, ==3 unique( dt$V5 ) adding

[R] emacs-ess tab indentation

2006-10-05 Thread Ferdinand Alimadhi
Hi, I have a 2 tab-identation in my emacs-ess and I would like to make it 8. Can somebody help me with this ? thanks Johan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] which command

2006-10-05 Thread Gavin Simpson
On Thu, 2006-10-05 at 16:57 -0400, AgusSusanto wrote: I obtained error messages when I run these commands in UNIX, but I obtained correct result when I run these command in WINDOWS. Can somebody point out the problem and give the solution. Thanks. Not without Fall.dat I suspect. please read

[R] [OT] testing for synchronicity

2006-10-05 Thread Andrew Robinson
Greetings, friends in the R community, this is an OT question about statistics. Given four time series of events, what possibilities do I have to test for synchronicity? e.g. times - data.frame(year= c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), event.1=c(1, 0, 0, 1, 2, 4, 1, 0, 0,

[R] Aggregate Values for All Levels of a Factor

2006-10-05 Thread Kaom Te
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I'm a novice user trying to figure out how to retain NA aggregate values. For example, given a data frame with data for 3 of the 4 possible factor colors(orange is omitted from the data frame), I want to calculate the average height by color,

[R] solaris 64 build?

2006-10-05 Thread roger koenker
We have a solaris/sparc machine that has been running an old version of R-devel: Version 2.2.0 Under development (unstable) (2005-06-04 r34577) which was built as m64 from sources. Attempting to upgrade to 2.4.0 the configure step goes ok, but I'm getting early on from make: gcc -m64

Re: [R] xyplot

2006-10-05 Thread David Barron
If you include a conditioning factor (here it is the variable groups) you will get more than one panel. To get loess curves for the two groups, the easiest way is to use the type argument: xyplot(y ~ time, groups=group,data=df,type=c(p,smooth)) On 05/10/06, Osman Al-Radi [EMAIL PROTECTED]

Re: [R] Block comments in R?

2006-10-05 Thread Richard A. O'Keefe
Please let's not waste any time trying to figure out how to add block comments to R. In any guise they are highly error prone. Although its precursors (PL/I and Pascal) had block comments and did not have end-of-line comments, the programming language Ada was explicitly designed to have

Re: [R] How to get the function names

2006-10-05 Thread Gabor Grothendieck
Probably the best you can hope for is to cover most cases. This one uses match.call and handles a number of cases and perhaps if you spend more time on it might be able to add some cases where it fails such as the second L below: f - function(x) { if (!is.list(x)) x - list(x) if

Re: [R] Aggregate Values for All Levels of a Factor

2006-10-05 Thread Marc Schwartz
On Thu, 2006-10-05 at 15:44 -0700, Kaom Te wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, I'm a novice user trying to figure out how to retain NA aggregate values. For example, given a data frame with data for 3 of the 4 possible factor colors(orange is omitted from the data

Re: [R] How to get the function names

2006-10-05 Thread Gabor Grothendieck
I should have mentioned is that the way it works is that it uses the name of the list component, if any, otherwise it uses the name of the function if its given as a number and otherwise it uses the function itself or possibly the name of the list. On 10/5/06, Gabor Grothendieck [EMAIL PROTECTED]

  1   2   >