Re: [R] plot with different color

2006-06-02 Thread P Ehlers
Greg, It might be better to use ylim = c(min(x), 0) in place of ylim = c(-4, 0). I don't think plt can take negative values. Peter Ehlers Greg Snow wrote: > Here is one approach. It uses the function clipplot which is shown > below (someday I will add this to my TeachingDemos package, the > Te

Re: [R] a question about a simply figure

2006-06-02 Thread P Ehlers
I don't understand the question. What's wrong with showing 26.94350 as being less than all the other leiji values? Peter Ehlers zhang jian wrote: > I think there is a question in R. I donot know the reason. > This is my data about comulative percentage figure. The result is not right. > > The

Re: [R] Table collumn to single var in lowcase

2006-06-02 Thread P Ehlers
tolower(names(DataTABLE)) Peter Ehlers Milton Cezar wrote: > Dear All, > > I have read a table using > DataTABLE <- read.table("mytable.txt, header=T) > > And get the following data structure >Var1 VAR2 VaR3 Var4 ... > > How can I list all collumn names (in l

Re: [R] Key titles in Lattice

2006-06-01 Thread P Ehlers
Hi Max, You have 'title' as a component of the 'text' component of key. According to the help page for xyplot, 'title' is a component of key. AFAICS, 'text' does not have a 'title' component. Peter Ehlers Kuhn, Max wrote: > Hi, > > I'm creating some lattice plots that have a key and I'd like to

Re: [R] mtext in trellis-loop & colorkey

2006-05-29 Thread P Ehlers
mtext() is not a lattice function. Could you not use the 'main' argument? Peter Ehlers Marius Hofert wrote: > Hello, > > I would like to create a sequence of plots (using a for loop). I read > in the FAQ that print() has to be used in order to obtain any output. > This works perfectly fine

Re: [R] Bug of pmvnorm?

2006-05-27 Thread P Ehlers
Looks like a bug (in mvt()?). Note that pmvnorm(lower = c(-Inf, -Inf), upper = c(Inf, 10)) works as expected, as does replacing any of the 4 Infs with a finite value. Function sadmvn() in pkg:mnormt does give 1 with Inf lower/uppers. Peter Ehlers Daniel Yang wrote: > Dear R-help, > > Is t

Re: [R] query: sample size calculation

2006-05-26 Thread P Ehlers
[EMAIL PROTECTED] wrote: > Dear all, > > I am doing something wrong. > > I am trying to apply a formula for sample size calculation as in the book > "Design and Analysis of Clinical Trials", from Chow et all. > > There a suggested sample size strategy uses the formula > > 0.30/0.45=F(0.80,2n,

Re: [R] changing font size in plot(effect())

2006-05-26 Thread P Ehlers
> Dear Peter, > > Won't that wipe out the other components of axis.text, etc.? > > Regards, > John > > On Thu, 25 May 2006 06:22:22 -0600 > P Ehlers <[EMAIL PROTECTED]> wrote: > >>John Fox wrote: >> >> >>>Dear Emilie, >&

Re: [R] changing font size in plot(effect())

2006-05-25 Thread P Ehlers
John Fox wrote: > Dear Emilie, > > This is, I guess, the effect() function in the effects package. If so, > note that the plot.effect() method uses trellis graphics (via the > lattice package), not standard R graphics, so you have to control > aspects of the plot in a manner consistent with trel

Re: [R] mean(NA)

2006-05-25 Thread P Ehlers
Fixed in 2.3.1beta. See NEWS. Peter Gorjanc Gregor wrote: > Hello! > > I was just caught with the following: > > >>mean(NA) > > [1] -2147483648 > > Is this OK. I thought that I should get NA. I use R 2.3.0 > > --please do not edit the information below-- > > Version: > > platform = i3

Re: [R] data.frame

2006-05-24 Thread P Ehlers
Sara, You didn't read your data into R correctly. If your data are really in the form you posted (one long column of mixed data types and lots of blank lines), then I would: 1. remove the blank lines with my text editor and save (say, mydata.txt) 2. scan() the variable names into a vector nm

Re: [R] my first R program

2006-05-20 Thread P Ehlers
Is this what you're after? > pos [1] 120 134 156 169 203 > dat2 Col1 Col2 p.val 112 0.45 212 0.56 323 0.56 423 0.68 523 0.88 634 0.76 735 0.79 835 0.92 plot(pos, rep(0, 5), type = "n", ylim = c(0, 1)) with(dat2, segment

Re: [R] create a vector

2006-05-18 Thread P Ehlers
'An Introduction to R', section 2.6 couldn't really be any clearer. You'll find the document on your computer. Peter Ehlers YIHSU CHEN wrote: > Dear R users: > > I have an elementary question: how to creat a vector of [A1, A2, A3.. > A300]? I know c(1:300) would give 1, 2, 3, , 300 bu

Re: [R] persp plot increasing 'x' and 'y' values expected

2006-04-25 Thread P Ehlers
[EMAIL PROTECTED] wrote: > hello, > > i do the following in order to get an persp-plot > > x<-c(2,2,2,2,2,2,3,3,3,3) > y<-c(41,41,83,83,124,166,208,208,208,208) > z<-c(90366,90366,92240,92240,92240,96473,100995,100995,100995,100995) > x<-data$x > y<-data$y > z<-matrix(data$z,length(y),length(x))

Re: [R] omitting coefficients in summary.lm()

2006-04-24 Thread P Ehlers
Dimitri, coef(summary(your model)) pulls out the matrix of coefs/SEs/etc. You could subset that. Peter Ehlers Dimitri Szerman wrote: > Hi, > > I'm running a regression using lm(), in which one of the right-hand side > variables is factor with many levels (say, 80). I am not intersted in the >

Re: [R] a question on subset a dataset

2006-04-13 Thread P Ehlers
Or, possibly slightly simpler: ok <- (x %% 2) * (y %% 2) d[ok == 1, ] Peter Ehlers Petr Pikal wrote: > Hi > > I coords was data frame you could use some arithmetic to get > selection criteria for both numbers odd. In case of matrix you need > to use coords[,1]*coords[,2] instead > > trunc((

Re: [R] Correlation of coefficients?

2006-04-09 Thread P Ehlers
Asako, My copy of MASS4 has been borrowed. But you can have a look at Julian Faraway's "Practical Regression and Anova using R" in the Contributed Documentation section of CRAN. See section 2.9. In MASS, look for 'vcov'. Peter Ehlers asako Ishii wrote: > Peter, > > Thank you very much for you

Re: [R] RGui: windows-record and command history

2006-03-23 Thread P Ehlers
Duncan Murdoch wrote: > On 3/23/2006 10:34 AM, Peter Ehlers wrote: > >> Duncan Murdoch wrote: >> >>> On 3/23/2006 7:35 AM, Thomas Steiner wrote: >>> a) How can I set the recording of all windows()-history forever to "true"? I want something like windows(record = TRUE) but not just for

Re: [R] How to use: library lattice: barchart

2006-03-21 Thread P Ehlers
I think your problem is the definition of abarley. You're making ayield into a factor. Have a look at str(abarley). Peter Ehlers [EMAIL PROTECTED] wrote: > Dear ladies and gentlemen! > > In the help text for the xyplot (library(lattice), help(xyplot)) is an example > given how one can use barcha

Re: [R] subsetting and NAs

2006-03-20 Thread P Ehlers
Eric Archer wrote: > R-help, > > I'm getting some unexpected behavior with subsetting a data frame > (aircraft flight data) that I can't sort out. > Here is a simplified version of my data frame and problem: > > > flight > FlightID TailNo FlightDate HobbsTime FlightCost Date year

Re: [R] Variance for Vector of Constants is STILL Not Zero

2006-02-17 Thread P Ehlers
Barry, Try the latest _patched_ version. I'm on 2006-02-12, but that may already be superseded. I get var(x) = 0. Peter Ehlers Barry Zajdlik wrote: > Hello all, > > Thanks for the responses but I am still annoyed by this seemingly simple > problem; I recorded sessionInfo() as below. > > x<-rep(

Re: [R] creating 3-way tables for mantelhaen.test

2006-02-17 Thread P Ehlers
Taka, Maybe you did something strange when you "replaced Y1's values ". Is the result a 10-level factor? The following works for me. x1 <- sample(c("y", "n"), 100, replace = TRUE) x2 <- sample(c("a", "b"), 100, replace = TRUE) y <- sample(1:10, 100, replace = TRUE) y <- factor(y) dat <- da

Re: [R] Read a csv file

2006-02-16 Thread P Ehlers
Alexandra, I haven't seen an answer to your query yet, so let me give it a shot. First, I would not use R-illegal variable names (I assume you want 2004-12-30, etc, to be your colnames). Try replacing them with A,B,C, etc. And delete the empty string at the start. Then I would make sure that ther

Re: [R] silly, extracting the value of "C" from the results of somers2

2006-01-03 Thread P Ehlers
ahimsa campos arceiz wrote: > Sorry I have a very simple question: > > I used somers2 function from Design package: > > >>z<- somers2(x,y, weights=w) > > > results are: > > >>z > > CDxynMissing > 0.88 0.76 5000.00 > > Now I want to call only the value of C to be used

Re: [R] Split graph labels in 2 levels

2005-12-29 Thread P Ehlers
Marc Schwartz wrote: > On Thu, 2005-12-29 at 14:49 +0100, Andrej Kastrin wrote: > >>Dear R users, >> >>is there any simple low-level function that split "single-line" graph >>labels and produce something like (e.g. for x axis): >> >>100300500 700... >> 200400 600 >> >>Cheer

Re: [R] Axis/Ticks/Scale

2005-12-28 Thread P Ehlers
Try this: x <- c(1, 1e6); y <- 0:1 par(mar = c(5, 4, 4, 5) + 0.1) # make room at the right plot(x, y, axes = FALSE) box() axis(2) axis(1, at = 0:5 * 2 * 1e5, labels = 0:5 * 2) mtext(text = expression(phantom(0)%*%10^5), side = 1, line = 1, at = 11.0 * 1e5) Peter Ehlers [EMAIL PROTECTED]

Re: [R] Add notes to a graph

2005-12-26 Thread P Ehlers
Just use two title()s: plot(1) title("Main Title", cex.main=2) title(sub = "sub title", cex.sub = 0.75, adj = 0) Peter Ehlers Ronnie Babigumira wrote: > Thank you all, ?sub did the trick. One more question, Is it possible to > orientate the "sub title" independently from the > "main title".

Re: [R] Add notes to a graph

2005-12-26 Thread P Ehlers
?mtext Peter Ehlers Ronnie Babigumira wrote: > Hi, I have done a search on this in vain. How can I add a note to the foot of > a graph example below > > |---| > | Title | > | | > | | my | | > | | graph | | > | |

Re: [R] grouping-R-help

2005-12-26 Thread P Ehlers
Subhabrata wrote: > Hello R-experts, > > I have a set of data as follows: > > age time > 1 281 > 2 532 > 3 533 > 4 364 > 5 544 > 6 464 > 7 455 > 8 316 > 9 537 > 10 357 > 11 628 > 12 198 > 13 432 > 14 513 > 15 45

Re: [R] copy contributed packages from R 2.2.0 to 2.2.1

2005-12-23 Thread P Ehlers
Good point. I actually keep packages that aren't installed with R in a separate directory. I set .libPaths via R_LIBS. Peter Ehlers Uwe Ligges wrote: > P Ehlers wrote: > > >>This might not be the preferred way, but can one not also >>do this by appropriately assign

Re: [R] copy contributed packages from R 2.2.0 to 2.2.1

2005-12-23 Thread P Ehlers
This might not be the preferred way, but can one not also do this by appropriately assigning .libPaths? Peter Ehlers Uwe Ligges wrote: > Helmut Kudrnovsky wrote: > > >>hi R-users, >> >>a few days ago R 2.2.1 came out. on my win xp i'installed R 2.2.0. along the >>time i've installed a lot of

Re: [R] Plot problems: xlim

2005-12-23 Thread P Ehlers
While I appreciate the availability of axis.break, I agree with Hadley in this case. I would provide two plots, with and without the special point. Or just the density plot and some numbers. Broken axes require interpretation which is often easier to do using numbers, e.g. the mean or range (exclus

Re: [R] Wilcoxon Mann-Whitney Rank Sum Test in R

2005-12-21 Thread P Ehlers
Peter, You're right, of course, as usual. Sorry about that. Peter E. Peter Dalgaard wrote: > P Ehlers <[EMAIL PROTECTED]> writes: > > >>>so a good guess at its definition is that it is obtained from W or one >>>of the others by subtracting the mean and d

Re: [R] Wilcoxon Mann-Whitney Rank Sum Test in R

2005-12-20 Thread P Ehlers
Peter Dalgaard wrote: > Bob Green <[EMAIL PROTECTED]> writes: > > >>An earlier post had posed the question: "Does anybody know what is relation >>between 'T' value calculated by 'wilcox_test' function (coin package) and >>more common 'W' value?" >> >>I found the question interesting and ran t

Re: [R] clear console function

2005-12-09 Thread P Ehlers
What OS? In Windows, what's wrong with pressing Ctrl-L? Peter Ehlers Manel Salamero wrote: > Hi, > > Someone can tell me a function for clearing the console without using the > menu bar? > > Thanks, > > Manel > > __ > R-help@stat.math.ethz.ch mail

Re: [R] Warnings about user error (was read.table error)

2005-12-09 Thread P Ehlers
Eric, Have you tried just copying your data from your email (this mail, e.g.) to your preferred text editor, removing any mailer-inserted leading characters, ensuring a newline at the end of the last line, and then using read.table (perhaps via the clipboard if you're on Windows)? Works for me wit

Re: [R] truncate/overwrite a data frame

2005-12-08 Thread P Ehlers
Guillaume, Will functions unique() or duplicated() help you? (Comment on trailing ";" withheld so as not to revive recent thread.) Peter Ehlers [EMAIL PROTECTED] wrote: > hi all, > > I've got a data frame, this data frame have 76 columns and 22600 rows. > The data inside can be redundant becau

Re: [R] concatenate data frame

2005-12-07 Thread P Ehlers
Guillaume, I assume that 'tab' is a data frame and that, for some unspecified reason, you want to get two subsets of the last column of tab, overlapping one case, and coercing the final result to a data frame. If that is correct, then as.data.frame(c(tab_tmp, tab_tmp1)) will give you a data fram

Re: [R] ploting the two sets of data side by side

2005-12-07 Thread P Ehlers
As usual, Gabor provides an elegant solution. But I hope that, in this case, the OP provided a toy example. Otherwise, I don't see the point of applying cut() to a vector of length 7. Why not just use stripchart()? Peter Ehlers Gabor Grothendieck wrote: > Or building on that solution but elimina

Re: [R] R is GNU S, not C.... [was "how to get or store ....."]

2005-12-07 Thread P Ehlers
Oh Patrick, surely German Capitalization is better! :) Peter Patrick Connolly wrote: > On Tue, 06-Dec-2005 at 04:21PM +, Patrick Burns wrote: > > |> I don't put in extraneous ';' because I maybe get a > |> blister on my little finger. > |> > |> I suspect that those who find the semi-colon

Re: [R] urgent

2005-12-06 Thread P Ehlers
I don't have an answer to your query, but I do have three suggestions: 1. Use a sensible subject line. This may be "urgent" to you, but I doubt that it is to anyone else. 2. Do indicate what package contains multhist(). I have no idea (nor do I know what a 'multi histogram' is). 3. Don't send HT

Re: [R] R is GNU S, not C.... [was "how to get or store ....."]

2005-12-06 Thread P Ehlers
[EMAIL PROTECTED] wrote: > Martin Maechler a écrit : > > >>please, please, these trailing ";" are *so* ugly. >>This is GNU S, not C (or matlab) ! >> >>but I'll be happy already if you could >>drop these ugly empty statements at the end of your lines... > > > May I disagree ? > I find miss

Re: [R] about comparison of KURTOSIS in package: moments and fBasics

2005-12-02 Thread P Ehlers
(Haven't seen an anwer to this yet; maybe I missed it.) klebyn wrote: > > > Hello > > > > I do not know very much about statistics (and English language too :-( ), > then I come in search of a clarification (explanation): > > I found two distinct results on KURTOSIS and > I do not know whic

Re: [R] Impaired boxplot functionality - mean instead of median

2005-12-01 Thread P Ehlers
Kjetil Brinchmann Halvorsen wrote: > P Ehlers wrote: > >> I'd like to add two comments to Martin's sensible response. >> >> 1. I've seen several intro-stats textbooks that define a >> boxplot to have whiskers to the extreme data values >> and

Re: [R] Impaired boxplot functionality - mean instead of median

2005-12-01 Thread P Ehlers
I'd like to add two comments to Martin's sensible response. 1. I've seen several intro-stats textbooks that define a boxplot to have whiskers to the extreme data values and then define Tukey's boxplot as a "modified" boxplot. I wish authors wouldn't do that. 2. I've also seen boxplots used for sa

Re: [R] read.table without sep

2005-11-25 Thread P Ehlers
Vasu, You have a lot of problems here. 1. How was your file generated? Excel? You have trailing tabs on all but row 1 which is why your read.table call with sep="\t" gives you columns that don't seem to agree with what you expect. See the argument row.names in ?read.table. 2. It's never a good i

Re: [R] residuals in logistic regression model

2005-11-25 Thread P Ehlers
Urania, I'm not very fond of "putting additive residuals on the righthand side". This practice tends to obscure the fact that we're fitting a conditional mean function: E(Y|x) = function(x; parameters) We then need to assess the model fit and uncertainties of parameter estimates. We may want t

Re: [R] model selection with step function

2005-11-25 Thread P Ehlers
sting." I would use the technique only in an exploratory setting, i.e. one that might help me to refine further experimentation. Peter > > > Citando P Ehlers <[EMAIL PROTECTED]>: > > >>Antonio Olinto wrote: >> >> >>>Hello, >>> >&g

Re: [R] Chi-squared test

2005-11-24 Thread P Ehlers
Marc Schwartz wrote: > On Thu, 2005-11-24 at 21:55 +, Ted Harding wrote: > >>On 24-Nov-05 P Ehlers wrote: >> >>>Bianca Vieru- Dimulescu wrote: >>> >>>>Hello, >>>>I'm trying to calculate a chi-squared test to see if my

Re: [R] model selection with step function

2005-11-24 Thread P Ehlers
Antonio Olinto wrote: > Hello, > > I have a doubt in using the function step (step wise) to select glm models. > > Usually I apply the gamma distribution to analyze fishery data. To select the > terms I use a routine where I first compare single term models to the null > model > (eg. U~1 vs. U

Re: [R] Chi-squared test

2005-11-24 Thread P Ehlers
Bianca Vieru- Dimulescu wrote: > Hello, > > I'm trying to calculate a chi-squared test to see if my data are > different from the theoretical distribution or not: > > chisq.test(rbind(c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49, > 60),c(80,80,80, 80, 80, 80, 80, 80, 80, 80, 80, 80))) > >

Re: [R] R: pp plot

2005-11-22 Thread P Ehlers
Is qq.plot in package 'car' of use to you? I think that it requires your distribution to be one of those available in R. Peter Clark Allan wrote: > hi all > > i would like to know if anyone has a reference on how one would place > the "bands" on the pp plot. > > i want to test whether or not a

Re: [R] Can't figure out warning message

2005-11-21 Thread P Ehlers
P Ehlers (that's me) wrote: > My guess is that you have an object 'T' hanging around. > Like Berton, I get no error until I define: > > T <- 0:1 > > and then run your test case, resulting in the warnings. > > Peter > > > Ravi Varadhan

Re: [R] Can't figure out warning message

2005-11-21 Thread P Ehlers
My guess is that you have an object 'T' hanging around. Like Berton, I get no error until I define: T <- 0:1 and then run your test case, resulting in the warnings. Peter Ravi Varadhan wrote: > Hi, > > > > I apologize for the previous posting, where the message was not formatted > properl

Re: [R] update R packages in local repos

2005-11-16 Thread P Ehlers
This should work: update.packages(ask = "graphics", repos = NULL, contriburl = "file:///g:/myFolder/myRepository")) -peter Muhammad Subianto wrote: > I try to update R packages via my local repository. > I put all R packages in g:/myFolder/myRepository, I do like > > >>library(tools) >>wr

Re: [R] Post Hoc Groupings

2005-10-26 Thread P Ehlers
Jarrett Byrnes wrote: > Quick question, as I attempt to learn R. For post-hoc tests > > 1) Is there an easy function that will take, say the results of > tukeyHSD and create a grouping table. e.g., if I have treatments 1, 2, > and 3, with 1 and 2 being statistically the same and 3 being diff

Re: [R] Graphics window always overlaps console window!

2005-10-25 Thread P Ehlers
[EMAIL PROTECTED] wrote: > Does anyone know how I can set up R so that when I make a graphic, the > graphics window remains behind the console window? It's annoying to > have to reach for the mouse every time I want to type another line of > code (e.g., to add another line to the plot). Thanks. I

Re: [R] priority of operators in the FOR ( ) statement

2005-08-23 Thread P Ehlers
Since there is nothing wrong with for(i in 1:nr - 1) R can't really do much more than point to where your code fails due your incorrect assumption about operator precedence. You're certainly not the first to fall into this trap. But it's not that hard to diagnose. Anytime I have problems with a l

Re: [R] trouble with wilcox.test

2005-08-18 Thread P Ehlers
I think your guess about stack overflow is probably correct and I definitely don't think it's worth wasting effort recoding. Peter Ehlers Prof Brian Ripley wrote: > If this is stack overflow (and I don't know that yet: when I tried this on > Windows the traceback was clearly corrupt, referring

Re: [R] trouble with wilcox.test

2005-08-18 Thread P Ehlers
P Ehlers wrote: > > Prof Brian Ripley wrote: > >> On Wed, 17 Aug 2005, Greg Hather wrote: >> >> >>> I'm having trouble with the wilcox.test command in R. >> >> >> >> Are you sure it is not the concepts that are giving 'tro

Re: [R] trouble with wilcox.test

2005-08-18 Thread P Ehlers
Prof Brian Ripley wrote: > On Wed, 17 Aug 2005, Greg Hather wrote: > > >>I'm having trouble with the wilcox.test command in R. > > > Are you sure it is not the concepts that are giving 'trouble'? > What real problem are you trying to solve here? > > >>To demonstrate the anomalous behavior of