[R] Calculating Percentile in R

2007-06-17 Thread Megh Dal
Hi all, I have a problem on how R calculates Percentiles : Suppose I have following data set: > data1 [1] -16648185 -14463457 -14449400 -13905309 -13443436 -13234755 -12956282 -11660896 [9] -10061040 -9805005 -9789583 -9754642 -9562164 -9391709 -9212182 -9151073 [17] -9092732 -9

[R] Loading problem with R2HTML package

2007-06-17 Thread spime
I have downloaded latest version of R2HTML (v1.54) for 64-bit windows PC. My R version 2.5.0. My problem arises when i want to install SciViews-R which need R2HTML package. > library(R2HTML) Error in `parent.env<-`(`*tmp*`, value = NULL) : use of NULL environment is defunct Error: pac

Re: [R] the way to look at all the codings of any functions

2007-06-17 Thread Petr Klasterecky
Someone with more experience could certainly provide a more precise answer, but basically you came across something called generic functions in R. This concept allows mean() to be called on various data structures without extra care. See ?UseMethod methods(mean) getAnywhere(mean.default) For m

[R] the way to look at all the codings of any functions

2007-06-17 Thread ebi
Dear SIr, In case of looking at the codes of the fuction, "cov", we find all the codings below. But, incase of "mean", we don't find the contents. Please show me the way to look at all the codings of any functions. Best regards, Kei --- > cov function (x, y = NULL, use =

[R] Automatic paren/bracket closing in 2.5.0?

2007-06-17 Thread Adam D. I. Kramer
Hello, Just upgraded to 2.5.0, and found that R now includes an rparen (right parentheses) or rbracket whenever I enter in an lparen. While I can see the use of this function, it doesn't mesh well with my personal style of using R (e.g., using the up arrow, adding an rparen, jumping to the

Re: [R] getting tapply() to work across multiple columns

2007-06-17 Thread Gabor Grothendieck
Try aggregate: aggregate(table[2:3], table[1], mean) On 6/17/07, Andrew Yee <[EMAIL PROTECTED]> wrote: > I have the following data.frame: > > index <- c("a","a","b","b","b") > alpha <- c(1,2,3,4,5) > beta <- c(2,3,4,5,6) > table <-data.frame(index,alpha,beta) > > I'm now interested in getting me

[R] getting tapply() to work across multiple columns

2007-06-17 Thread Andrew Yee
I have the following data.frame: index <- c("a","a","b","b","b") alpha <- c(1,2,3,4,5) beta <- c(2,3,4,5,6) table <-data.frame(index,alpha,beta) I'm now interested in getting means of alpha and beta for each of the index values and do a tapply() for each of the columns, e.g. means.alpha <- tappl

Re: [R] Storing output vector form a loop as a matrix

2007-06-17 Thread Economics Guy
Thanks so much to both of you. I did not exactly use the code from either of you but your post help me figure out the things I was doing wrong. For anyone who stumbles upon this thread later, here is the code I used that made it work: Thanks Again. a <-c("A","C","B","A","B","C") b <-c(10,20,30

Re: [R] Responding to a posting in the digest

2007-06-17 Thread Michael Bibo
Moshe Olshansky yahoo.com> writes: > > Is there a convenient way to respond to a particular > posting which is a part of the digest? > I mean something that will automatically quote the > original message, subject, etc. > > Thank you! > > Moshe Olshansky > m_olshansky yahoo.com > > ___

Re: [R] Storing output vector form a loop as a matrix

2007-06-17 Thread jim holtman
I think this does it for you: > a <-c("A","C","B","A","B","C") > > b <-c(10,20,30,40,50,60) > > C <-data.frame(a,b) # don't use 'c' as it is a primitive function - canbe confusing > > N=10 #Number of Loops > > > > output.matix <- replicate(N, function(x){ + .samp <- C[sample(nrow(C), replace=

Re: [R] Storing output vector form a loop as a matrix

2007-06-17 Thread Economics Guy
That gives: Error in output.matrix[, i] <- as.vector(output.vector) : number of items to replace is not a multiple of replacement length But I think that is close. Thanks, EG On 6/17/07, David Barron <[EMAIL PROTECTED]> wrote: > > I'm not sure I've completely understood this, but would

Re: [R] data.frame and subsetting problem

2007-06-17 Thread Michelle Wynn
Yes, the problem I have is finding away to get rid of the extra levels I do not need in the subset. What Don posted works for my needs. I will also read up on factors/levels. Thanks for all suggestions and sorry my example had and error (x2 was supposed to y). Michelle On 6/16/07, Don MacQueen

Re: [R] Storing output vector form a loop as a matrix

2007-06-17 Thread David Barron
I'm not sure I've completely understood this, but would this do what you want: for (i in 1:N){ aa <- sample(a, replace=TRUE) c <-data.frame(b,aa) output <- by(c, aa, function(x) sum(x$b)) output.matrix[,i] <- as.vector(output) } On 17/06/07, Economics Guy <[EMAIL PROTECTED]> wrote: > Based

[R] Storing output vector form a loop as a matrix

2007-06-17 Thread Economics Guy
Based on help files and searching the archives and help from the listserv I have managed to build my monte carlo program. However I cannot get the proper syntax for running the loop and storing the output of each loop (which is a vector) into a matrix. I took out some of the crazy code I was writ

Re: [R] [Not R question]: Better fit for order probit model

2007-06-17 Thread Robert A LaBudde
At 01:29 PM 6/17/2007, adschai wrote: >Thank you so much Robert. Please find the information below. > >The scale 1-10 are subjective physical condition ratings scored by >inspection engineers at the site. 1-5 are in very bad conditions >(bridge close down to seriously deteriorated). The rest from

Re: [R] standard error of skewness

2007-06-17 Thread RonV
I found this this link that might help. http://www.gbstat.com/macintosh/mac-new.html livia wrote: > > Hi, > > I just wonder how can I calculate the standard error of skewness? > Basiclly, I would like to test whether it is too skewed or not? > > Many thanks > -- View this message in conte

[R] Cluster validation

2007-06-17 Thread Graham Leask
Dear list Is "v-fold cross-validation " for cluster analysis available in R? If anyone can point me towards the appropriate link I would greatly appreciate it. Graham [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing

Re: [R] [Not R question]: Better fit for order probit model

2007-06-17 Thread adschai
Thank you so much Robert. Please find the information below. The scale 1-10 are subjective physical condition ratings scored by inspection engineers at the site. 1-5 are in very bad conditions (bridge close down to seriously deteriorated). The rest from 6-10 are categorized as good condition.H

Re: [R] Efficiently calculate sd on an array?

2007-06-17 Thread Charles C. Berry
On Sun, 17 Jun 2007, Gavin Simpson wrote: > Dear list, > > Consider the following problem: > > n.obs <- 167 > n.boot <- 100 > arr <- array(runif(n.obs*n.obs*n.boot), dim = c(n.obs, n.obs, n.boot)) > arr[sample(n.obs, 3), sample(n.obs, 3), ] <- NA > > Given the array arr, with dims = 167*167*100, I

Re: [R] clustalW

2007-06-17 Thread Jean lobry
> Hello, > > I try to make directly with R a multiple alignment querying CLUSTAL W, > do you know how can I do this? > > Thanks > > Jérémy Mazet See ?system on how to run an external program. There is an example in the reverse.align() function from the seqinR package in which clustalW can be

Re: [R] (no subject)

2007-06-17 Thread Uwe Ligges
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html It tells you to read the manuals *before* posting. There is a manual "An Introduction to R" and anotehr one called "R Installation and Administration", both telling you how to install packages. Uwe Ligges K KAMALA wr

Re: [R] error bars on survival curve

2007-06-17 Thread Frank E Harrell Jr
Murray Pung wrote: > I am using plot(survfit(Surv(time,status) ~...) and would like to add > error bars rather than the confidence intervals. Am I able to do this > at specified times? e.g. when time = 20 & 40. > > > leukemia.surv <- survfit(Surv(time, status) ~ x, data = aml) > plot(leukemia.sur

Re: [R] GLM dist Gamma-links identity and inverse

2007-06-17 Thread Simon Wood
If the linear predictor of the GLM becomes negative during fitting, then the corresponding fitted values (expected value of response according to model), will be negative if you use inverse or identity links. This is problematic, since a Gamma r.v. can not be negative, let alone have a negative

Re: [R] Visualize quartiles of plot line

2007-06-17 Thread Arne Brutschy
Hi, thanks for your tips - all of them worked. After a bit of fiddling, I managed to get what I wanted. hadley wickham wrote: h> You might want to read the introductory chapters in the ggplot book, h> available from http://had.co.nz/ggplot2, which will give you more of a h> background. Please le

[R] (no subject)

2007-06-17 Thread K KAMALA
Sir/Mam, I have installed R in LINUX PC and I'm trying to run the code. It is showing the error as Error in library(sm) : There is no package called 'sm' How to install SM library in R-2.5.0? Can you please me. Kamala - __ R-help@stat.math.ethz.ch ma

[R] Efficiently calculate sd on an array?

2007-06-17 Thread Gavin Simpson
Dear list, Consider the following problem: n.obs <- 167 n.boot <- 100 arr <- array(runif(n.obs*n.obs*n.boot), dim = c(n.obs, n.obs, n.boot)) arr[sample(n.obs, 3), sample(n.obs, 3), ] <- NA Given the array arr, with dims = 167*167*100, I would like to calculate the sd of the values in the 3rd dim

Re: [R] correlation comparison one more time

2007-06-17 Thread Bill.Venables
Hypothesis tests are normally set up to test a null hypothesis within a broader class of alternatives, which includes the null as a special case. Roughly speaking the logic is "We assume that the outer class includes the truth. We have a simple special case of this we call the null hypothesis

Re: [R] problem with xlsReadWrite package

2007-06-17 Thread Hans-Peter
Hi, 2007/6/11, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > I have installed R 2.4.0 in my pc. I have a file xls entitled dali following > this directory:c://programfiles//R 2.4.0. Recently I have installed > xlsreadwrite 1.3.2. but , when I wrote the following lines: > >library(xlsReadWrite) > >rea

Re: [R] Fitting model with response and day bias

2007-06-17 Thread Bart Joosen
Bernardo, thanks for your solution, I was short in time last weeks, but I tried it and it works fine. I'll post it to the list, as it may help other people too. Regards Bart - Original Message - From: "Bernardo Rangel Tura" <[EMAIL PROTECTED]> To: "Bart Joosen" <[EMAIL PROTECTED]> Se

Re: [R] [ggplot2] Change color of grid lines

2007-06-17 Thread hadley wickham
On 6/17/07, Bernd Weiss <[EMAIL PROTECTED]> wrote: > Hi, > > I am making myself familiar with ggplot2 (I really like the examples > at ). > > One thing that really annoys me is the default use of white grid > lines and a gray background [1, 2]. I simply would like to have

[R] correlation comparison one more time

2007-06-17 Thread rafael
I would like ask again, because I cant find the answer I have such problem: My data containing 4 variables (A,B,C,D) and are completed from 4 samples. Each of matrix is such: A B C D A 1 ab ac ad B ab 1bc bd C ac bc 1 cd D ad bd cd 1 My hy

[R] [ggplot2] Change color of grid lines

2007-06-17 Thread Bernd Weiss
Hi, I am making myself familiar with ggplot2 (I really like the examples at ). One thing that really annoys me is the default use of white grid lines and a gray background [1, 2]. I simply would like to have black grid lines and a white background. No problem, I th

Re: [R] Visualize quartiles of plot line

2007-06-17 Thread hadley wickham
On 6/17/07, Arne Brutschy <[EMAIL PROTECTED]> wrote: > Hi, > > h> How about quantile regression? Have a look at > h> http://had.co.nz/ggplot2/stat_quantile.html for some examples of > h> what that might look like. > I tried the ggplot2 package, it seems to be quite powerful. But > documentation is

Re: [R] Visualize quartiles of plot line

2007-06-17 Thread hadley wickham
On 6/17/07, Arne Brutschy <[EMAIL PROTECTED]> wrote: > Hi, > > concerning the missing se coloring: I followed the examples on > http://had.co.nz/ggplot2/stat_smooth.html > > c <- ggplot(mtcars, aes(y=wt, x=qsec)) > > c + stat_smooth() > c + stat_smooth() + geom_point() > c + stat_smooth(se = TR

Re: [R] Visualize quartiles of plot line

2007-06-17 Thread Arne Brutschy
Hi, concerning the missing se coloring: I followed the examples on http://had.co.nz/ggplot2/stat_smooth.html c <- ggplot(mtcars, aes(y=wt, x=qsec)) c + stat_smooth() c + stat_smooth() + geom_point() c + stat_smooth(se = TRUE) + geom_point() c + stat_smooth(fill=alpha("blue", 0.2), colour="d

Re: [R] Visualize quartiles of plot line

2007-06-17 Thread Arne Brutschy
Hi, h> How about quantile regression? Have a look at h> http://had.co.nz/ggplot2/stat_quantile.html for some examples of h> what that might look like. I tried the ggplot2 package, it seems to be quite powerful. But documentation is only partially available, so I'm having some problems creating the