[R] acf lag1 value

2008-01-17 Thread Shubha Vishwanath Karanth
Hi R, I have doubt. x= c(4,5,6,3,2,4,5) acf(x,plot=F,lag.max=1) Autocorrelations of series 'x', by lag 0 1 1.000 0.182 But if I actually calculate the autocorrelation at lag1 I get, cor(x[-1],x[-length(x)]) [1] 0.1921538 Even in excel I get 0.1921538

[R] multiple text placements and expressions revisited

2008-01-17 Thread Johannes Graumann
Hi all, I asked something like this earlier but decided that a proper minimal example might be helpfull ;0) Why does this work with regards to the expression (substitution): require(stats) plot(cars) text(5,120,labels=substitute(i^{z+phantom()}*(*a* AMU),list(i=yx,z=2,a=0)))

Re: [R] acf lag1 value

2008-01-17 Thread Prof Brian Ripley
Please re-check your time-series books. The acf at lag 1 is _not_ the correlation between x and lag(x). For one thing, the variance of x is computed from the whole series, and not from the series with either the first or last value removed -- there is also the question of the divisor. See

Re: [R] multiple text placements and expressions revisited

2008-01-17 Thread Prof Brian Ripley
On Thu, 17 Jan 2008, Johannes Graumann wrote: Hi all, I asked something like this earlier but decided that a proper minimal example might be helpfull ;0) Why does this work with regards to the expression (substitution): require(stats) plot(cars)

Re: [R] multiple text placements and expressions revisited

2008-01-17 Thread Johannes Graumann
Thanks for your help! Works like a charm now - I can even append to an expression abject as if it was plain 'c()' ... Joh Prof Brian Ripley wrote: On Thu, 17 Jan 2008, Johannes Graumann wrote: Hi all, I asked something like this earlier but decided that a proper minimal example might be

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread Rob Robinson
I wonder if those who complain about SAS as a programming environment have discovered SAS/IML which provides a programming environment akin to Matlab which is more than capable (at least for those problems which can be treated with a matrix like approach). As someone who uses both SAS and R -

Re: [R] odfWeave and xtable

2008-01-17 Thread David Hajage
yes, but we loose the possibility to use a 'simple' text editor. For example, I like to use emacs+ess to edit and evaluate R code, and to write my report in the same editor. I like the idea that the input format could be writen with a simple text editor, and the output format be chosen after. I

[R] aaMI

2008-01-17 Thread navish
hi i am new to R language. I want to use aaMI package which calculates the amino acid mutual interaction for a given protein sequence. I had installed the package but when i run the program it gives me the error could not find function aaMI. can anyone tell me what might be the problem.. --

Re: [R] using table function

2008-01-17 Thread Jim Lemon
Ricardo Perrone [EMAIL PROTECTED] wrote: Hi, How to join two large vectors ordered, where one has the variable's levels and another has the frequencies, in way similar to that showing by table function in R console? and considering this two vectors how to use summary function to produce

Re: [R] aaMI

2008-01-17 Thread Richard . Cotton
i am new to R language. I want to use aaMI package which calculates the amino acid mutual interaction for a given protein sequence. I had installed the package but when i run the program it gives me the error could not find function aaMI. can anyone tell me what might be the problem.. Did

[R] Intro to R :: London :: 6-7/03/2007

2008-01-17 Thread Romain Francois
Mango Solutions are pleased to announce the above course in London as part of our schedule for Q1 2008. --- Introduction to R and R Programming - 6-7th March 2008

Re: [R] Using a data frame to create a legend

2008-01-17 Thread Tom Snowden
If I understand your question: x - rnorm(100) plot(x) legend(topright, capture.output(t(t(summary(x) Thank you for your help, but I'm afraid that is not what I meant. As an example of what i am trying to say, imagine I had grouped a whole bunch of people into 4 age ranges and then

Re: [R] aaMI

2008-01-17 Thread Andrew Robinson
Hi Navish, did you run require(aaMI) ? Cheers Andrew On Thu, Jan 17, 2008 at 02:17:12AM -0800, navish wrote: hi i am new to R language. I want to use aaMI package which calculates the amino acid mutual interaction for a given protein sequence. I had installed the package but when i

Re: [R] acf lag1 value

2008-01-17 Thread Shubha Vishwanath Karanth
Thank you Professor... Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Thursday, January 17, 2008

Re: [R] aaMI

2008-01-17 Thread navish
Dear Richie. Thank you. yes it works after loading the package. can you please tell me what should be the location of the file during uploading for aaMI function. Richard Cotton wrote: i am new to R language. I want to use aaMI package which calculates the amino acid mutual interaction for

Re: [R] using an element of an array as a new object

2008-01-17 Thread ppaarrkk
Thankyou for the replies. assign() works. for (i in 1:7) assign(filesBox[i,1],read.table(paste(dir2, filesBox[i,1], sep=), header = FALSE)) -- View this message in context: http://www.nabble.com/using-an-element-of-an-array-as-a-new-object-tp14884435p14917349.html Sent from the R help

Re: [R] aaMI

2008-01-17 Thread Richard . Cotton
Thank you. yes it works after loading the package. can you please tell me what should be the location of the file during uploading for aaMI function. You can use an absolute path to a file, e.g. c:/source/project/myrproject/myfile.r .. Or an relative path from the current working directory.

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread Walter Paczkowski
Good morning, I use SAS and R/S-Plus as my primary tools so I have a lot of experience with these programs. By far and away, SAS is superior for handling the messy datasets, but also the very large ones. I work at times with datasets in the hundreds of thousands (and on occasion, millions)

Re: [R] odfWeave and xtable

2008-01-17 Thread 宋时歌
David, The value of odfWeave is not limited to newbie users. It is vastly useful for researchers in fields that do not accept LaTeX for journal paper submission (for example, sociology, demography). Best, Shige On Jan 17, 2008 5:46 PM, David Hajage [EMAIL PROTECTED] wrote: yes, but we loose

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread Frank E Harrell Jr
Rob Robinson wrote: I wonder if those who complain about SAS as a programming environment have discovered SAS/IML which provides a programming environment akin to Matlab which is more than capable (at least for those problems which can be treated with a matrix like approach). As someone who

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread Frank E Harrell Jr
Walter Paczkowski wrote: Good morning, I use SAS and R/S-Plus as my primary tools so I have a lot of experience with these programs. By far and away, SAS is superior for handling the messy datasets, but also the very large ones. I work at times with datasets in the hundreds of

Re: [R] Rmpi on Linux x86_64 GNU/Linux

2008-01-17 Thread Dirk Eddelbuettel
Brian, On 16 January 2008 at 11:26, Brian O'Gorman wrote: | I'm having trouble with R CMD INSTALL Rmpi_0.5-5.tar.gz | --configure-args=~/lam | | lam is is installed locally. | lamboot -d (or lamboot-d and also recon) works. make -k check from the | lamtest suite passes all tests. | Is this

Re: [R] exact method in coxph

2008-01-17 Thread Terry Therneau
The help says that the exact method is computationally demanding, but even after days the computing it won't finish. Also, if I include a frailty-term, the exact method gives me results in no time. Is my setup incorrect? Assume that at some particular time point there are k deaths and n

[R] non-plot plotting

2008-01-17 Thread Johannes Graumann
I really do not know ho to else title this ... I want to draw something like the attached png with R and would like to poll you on how to start ... make an empty plot first and then start positioning the characterstring by 'text' and then drawing the lines ... Joh attachment:

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread hadley wickham
Previously I used SAS for 23 years and now R/S-Plus for 17. SAS is effective for large datasets (in my work 500,000 subjects) but except for that, R is far superior to SAS for data management and manipulation. Just four of the reasons are that you can - merge data frames multiple ways

Re: [R] color ranges on a 2D plot

2008-01-17 Thread John Kane
There must be a better way but this will do it for you. x - runif(100, 0, 1) y - runif(100, 0, 1) z - data.frame(x,y) plot(subset(z, z$y =.5), col=red, ylim=c(min(z$y), max(z$y)), pch=16) points(subset(z, z$y =.49), col=blue, pch=15) --- dxc13 [EMAIL PROTECTED] wrote: useR's I am trying

[R] Converting plots to ggplot2

2008-01-17 Thread Thompson, David (MNR)
Hello Hadley, I am trying to reproduce the following with ggplot: a - seq(0, 360, 5)*pi/180 ; a ac - sin(a + (45*pi/180)) + 1 ; ac plot(a, ac, type='b', xaxt = n) axis(1, at=seq(0,6,1), labels=round(seq(0,6,1)*180/pi),1) abline(v=c(45*pi/180, 225*pi/180)) I can get the basic

Re: [R] color ranges on a 2D plot

2008-01-17 Thread Petr PIKAL
[EMAIL PROTECTED] napsal dne 17.01.2008 15:08:40: There must be a better way but this will do it for you. x - runif(100, 0, 1) y - runif(100, 0, 1) z - data.frame(x,y) plot(subset(z, z$y =.5), col=red, ylim=c(min(z$y), max(z$y)), pch=16) points(subset(z, z$y =.49), col=blue, pch=15)

[R] vector generation

2008-01-17 Thread Juan Pablo Fededa
Dear Contributors: I have the next vector: Z 526 723 110 1110 34 778 614 249 14 I want to generate a vector containing the ratios of all the values versus all the values of the z vector. I mean a vector containing the values of 526/723, 526/110, and so on, 723/723, 723/110, and so on, and so

Re: [R] Converting plots to ggplot2

2008-01-17 Thread Domenico Vistocco
Thompson, David (MNR) wrote: Hello Hadley, I am trying to reproduce the following with ggplot: a - seq(0, 360, 5)*pi/180 ; a ac - sin(a + (45*pi/180)) + 1 ; ac plot(a, ac, type='b', xaxt = n) axis(1, at=seq(0,6,1), labels=round(seq(0,6,1)*180/pi),1)

[R] [R-pkgs] New version of Epi package out (1.0.7)

2008-01-17 Thread BXC (Bendix Carstensen)
A new major upgrade of the Epi package for Epidemiological data analysis has been put on CRAN, it is now at version 1.0.7. It contains an entirely new way of representing follow-up data on multiple timescales and multiple states. See the function Lexis(). Plus a lot of other useful stuff for

Re: [R] Grouping data

2008-01-17 Thread John Kane
You might want to have a look at the recode function in the car package. By the way I think you meant 26-35 not 25-25. === Example xx - data.frame(age=c(25, 33, 22, 19,21, 30, 32, 31), edu=c(2,5 ,3, 1,3, 4, 4, 1)) library(car)

Re: [R] Help with Error

2008-01-17 Thread Richard . Cotton
d - read.table(C:\\rep.csv, head=TRUE, sep=,) pie(d$Votes, + labels=d$Name, + main=Class Rep Results\n(Final Results)) Error: Error in pie(d$votes, labels = d$name, main = Class Rep Results\n(Final Results)) : 'x' values must be positive. The first input to the pie function

Re: [R] replace numbers in a column conditional on their value

2008-01-17 Thread Jabez Wilson
Splendid, thanks for your quick response. [EMAIL PROTECTED] wrote: I have a data frame column in which I would like to replace some of the numbers dependent on their value. data frame = zz AveExpr t P.Value FC 7.481964 7.323950 1.778503e-04 2.218760 7.585783 12.233056 6.679776e-06

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread Wittner, Ben, Ph.D.
Several people have mentioned large, messy data sets. I am curious as to in what way messy data sets are messy. (I am also curious about what SAS does that helps one deal with them, but perhaps that's asking too much.) Thanks. -Ben -Original Message- From: [EMAIL PROTECTED]

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread Paul Gilbert
The argument for SAS (and Stata) when working with large dataset comes up fairly often. I have not had much experience in this area, but have been pleasantly surprised using R in combination with an SQL interface, in situations with modestly large, messy datasets. I certainly would

[R] Help with Error

2008-01-17 Thread hoogeebear
Hi, I am having trouble with an error I keep getting. I am just trying to create a simple pic chart from a small table. Hope someone can help. I am new to R. Table: Name Votes John 300 Sean222 Andy 467 Sinead 740 David 124 James 641 William 380 Commands: d

Re: [R] vector generation

2008-01-17 Thread Gabor Csardi
See ?outer outer(Z, Z, function(x,y) x/y) Gabor On Thu, Jan 17, 2008 at 01:24:33PM -0300, Juan Pablo Fededa wrote: Dear Contributors: I have the next vector: Z 526 723 110 1110 34 778 614 249 14 I want to generate a vector containing the ratios of all the values versus all

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread Erin Hodgess
Would it be possible for Matthew (the original person) to tell us what he ended up with for his final talk, please? Thanks, Erin On Jan 17, 2008 10:45 AM, Wittner, Ben, Ph.D. [EMAIL PROTECTED] wrote: Several people have mentioned large, messy data sets. I am curious as to in what way messy

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread hadley wickham
Happy families are all alike; every unhappy family is unhappy in its own way. Leo Tolstoy and every messy data is messy in its own way - it's easy to define the characteristics of a clean dataset (rows are observations, columns are variables, columns contain values of consistent types). If you

Re: [R] as.integer question

2008-01-17 Thread Erin Hodgess
Thanks to all! This is really helpful! Sincerely, Erin On Jan 17, 2008 12:00 PM, Marc Schwartz [EMAIL PROTECTED] wrote: Erin Hodgess wrote: Hi R People: I'm reading Statistical Computing with R, by Maria Rizzo, and it's really good. Anyhow, I have a question about something in

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread Barry Rowlingson
Clint Bowman wrote: So how does SAS compare with one of the specialty languages such as perl. I've found the combination of perl and R to work quite satisfactorily (as long as I don't confuse the syntax and functions available in each.) Now that the topic has drifted off the subject of what

Re: [R] things that are difficult/impossible to do in SAS orSPSSbut simple in R

2008-01-17 Thread Bert Gunter
Thanks Hadley. Witty! Profound! Concise! I think this is definitely a Fortunes candidate. -- Bert Gunter Genentech Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of hadley wickham Sent: Thursday, January 17, 2008 9:56 AM To: Wittner,

Re: [R] Converting plots to ggplot2

2008-01-17 Thread hadley wickham
On Jan 17, 2008 9:53 AM, Thompson, David (MNR) [EMAIL PROTECTED] wrote: Hello Hadley, I am trying to reproduce the following with ggplot: a - seq(0, 360, 5)*pi/180 ; a ac - sin(a + (45*pi/180)) + 1 ; ac plot(a, ac, type='b', xaxt = n) axis(1, at=seq(0,6,1),

Re: [R] Help with Error

2008-01-17 Thread hoogeebear
Thnk you very much! It now works correctly! Much Appreciated, John. hoogeebear wrote: Hi, I am having trouble with an error I keep getting. I am just trying to create a simple pic chart from a small table. Hope someone can help. I am new to R. Table: Name Votes John 300

Re: [R] as.integer question

2008-01-17 Thread Marc Schwartz
Erin Hodgess wrote: Hi R People: I'm reading Statistical Computing with R, by Maria Rizzo, and it's really good. Anyhow, I have a question about something in there. u- runif(5) u [1] 0.1177041 0.4271790 0.4601597 0.2204846 0.4051473 #in the book sum(as.integer(u 0.4)) [1] 3 #what I

[R] Change R localization

2008-01-17 Thread Michael Kubovy
Dear R-helpers, A student in my Department reports that his R is in Japanese: I lived in Japan and have a US-purchased mac with the Japanese input/ reader enabled, which must be where the Japanese came from. When I uninstalled R and reinstalled it last time (I think I completely uninstalled

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread Peter Dalgaard
Wittner, Ben, Ph.D. wrote: Several people have mentioned large, messy data sets. I am curious as to in what way messy data sets are messy. (I am also curious about what SAS does that helps one deal with them, but perhaps that's asking too much.) One aspect is that in the SAS culture (e.g.

[R] Any tools for working with US 2000 census data?

2008-01-17 Thread Zembower, Kevin
I've been given the job of extracting some data from the United States 2000 census (files at http://www2.census.gov/census_2000/datasets/Summary_File_2/Maryland/all_ Maryland.zip 52M). I'm only interested in Census Block Groups (CBGs) located within Baltimore City, Maryland. Additionally, I just

[R] 'simulate.p.value' for goodness of fit

2008-01-17 Thread Bob
R Help on 'chisq.test' states that if 'simulate.p.value' is 'TRUE', the p-value is computed by Monte Carlo simulation with 'B' replicates. In the contingency table case this is done by random sampling from the set of all contingency tables with given marginals, and works

Re: [R] things that are difficult/impossible to do in SAS or SPSSbut simple in R

2008-01-17 Thread Clint Bowman
So how does SAS compare with one of the specialty languages such as perl. I've found the combination of perl and R to work quite satisfactorily (as long as I don't confuse the syntax and functions available in each.) Clint Clint BowmanINTERNET: [EMAIL PROTECTED] Air

Re: [R] non-plot plotting

2008-01-17 Thread Charilaos Skiadas
On Jan 17, 2008, at 9:44 AM, Johannes Graumann wrote: I really do not know ho to else title this ... I want to draw something like the attached png with R and would like to poll you on how to start ... make an empty plot first and then start positioning the characterstring by 'text'

Re: [R] Help with Error

2008-01-17 Thread John Kane
It looks fine to me. Try str(d) and check to be sure that Votes is a numeric value or integer value. I ran this code with no problem. x - Name Votes John 300 Sean222 Andy 467 Sinead 740 David 124 James 641 William 380 d - read.table(textConnection(x),

Re: [R] Any tools for working with US 2000 census data?

2008-01-17 Thread Dylan Beaudette
On Thursday 17 January 2008 10:55:03 am Zembower, Kevin wrote: I've been given the job of extracting some data from the United States 2000 census (files at http://www2.census.gov/census_2000/datasets/Summary_File_2/Maryland/all_ Maryland.zip 52M). I'm only interested in Census Block Groups

Re: [R] 'simulate.p.value' for goodness of fit

2008-01-17 Thread Rolf Turner
I'm afraid I can't follow your examples, but you seem to me to be mixing contingency table tests and goodness of fit tests in a somewhat incoherent fashion. Note that your ``x2()'' function does a contingency table test, and not a goodness of fit test. Note that in chisq.test(), if ``x'' is a

[R] nlme: Variogram.gls error with grouping factor

2008-01-17 Thread Dan Bebber
I am using gls to fit a linear model with spatially-autocorrelated errors. My first step is to fit a simple model, and inspect a semivariogram of residuals. The following example gives this error: Error in FUN(X[[1L]], ...) : unused argument(s) (method = euclidean) #Example library(nlme) x -

Re: [R] Loading only particular columns from csv file...

2008-01-17 Thread Marko Milicic
Thank you very much... That was helpful.. On Jan 15, 2008 12:58 AM, Charles C. Berry [EMAIL PROTECTED] wrote: On Mon, 14 Jan 2008, Marko Milicic wrote: Dear all, I'm trying to process HUGE datasets with R. It's very fast, but I would like to optimize it a bit more, by focusing one one

Re: [R] things that are difficult/impossible to do in SAS or SPSS but simple in R

2008-01-17 Thread James Reilly
Max Kuhn wrote: Factors have huge benefits over character data in SAS. For a series regulatory filings, I had miles of SAS code to compute KxK tables where all the cells must show up. For example, if one of the levels of one of the variables was never observed, the corresponding row or

[R] how to specify a particular contrast

2008-01-17 Thread array chip
Hi, I am running a simple one-way ANOVA with an independent factot variable treat (3 levels: a, b and c) and a response variable y. I want to test a linear relationship of the response among the 3 levels of the variable treat (ordered a-b-c). I used glht() from multcomp package. Later I found out

[R] Res: vector generation

2008-01-17 Thread Milton Cezar Ribeiro
hi Juan, It is not so elegant, but work fine. I know that our colleagues can do it on a simple line. z-c(526,723,110,1110,34,778,614,249,14) v1-NULL v2-NULL for (i in 1:(length(z)-1)) { for (j in i:length(z)) { v1-rbind(v1,z[i]) v2-rbind(v2,z[j]) } } df-data.frame(cbind(v1=v1,v2=v2))

Re: [R] things that are difficult/impossible to do in SAS or SPSS but simple in R

2008-01-17 Thread Tim Churches
James Reilly wrote: Max Kuhn wrote: Factors have huge benefits over character data in SAS. For a series regulatory filings, I had miles of SAS code to compute KxK tables where all the cells must show up. For example, if one of the levels of one of the variables was never observed, the

Re: [R] non-plot plotting

2008-01-17 Thread Marc Schwartz
Johannes Graumann wrote: I really do not know ho to else title this ... I want to draw something like the attached png with R and would like to poll you on how to start ... make an empty plot first and then start positioning the characterstring by 'text' and then drawing the lines ... Joh

Re: [R] how to specify a particular contrast

2008-01-17 Thread Ross Darnell
I don't quite follow what you are trying to do but the second contrast has a few interpretations with the same meaning in your case 1) are the 2-1 and 3-2 differences equal 2) lack of fit of a linear trend 3) is there a quadratic response If you declare your factor to be ordered then the

Re: [R] Probability weights with density estimation

2008-01-17 Thread David Winsemius
Charles C. Berry [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: On Wed, 16 Jan 2008, David Winsemius wrote: I am a physician examining an NHANES dataset available at the NCHS website: http://www.cdc.gov/nchs/about/major/nhanes/nhanes2005-2006/demo_d.xpt snip TC.ran -

Re: [R] Res: vector generation

2008-01-17 Thread Bert Gunter
If I understand you correctly, use outer() -- the for loops suggested below are not the R way (nor do they seem to fully address the and so on part of your request): ratios - outer(z,z,/) This produces a matrix, the first column of which is z/z[1], the second of which is z/z[2], and so forth.

[R] Need to install RDCOM

2008-01-17 Thread Uma Sitaraman
Hi, Where do I find the link to install RDCOM? I need to use RExcel for my project. Thanks a lot! Uma This e-mail may contain confidential and/or privileged i...{{dropped:13}} __ R-help@r-project.org mailing list

Re: [R] how to specify a particular contrast

2008-01-17 Thread array chip
I didn't set the variable treat as ordered factor, just ordinary factor. In my example, the 3 levels of treat are of equal distance in the order of from a to b to c. So my understanding is that a contrast in the form of a+c-2*b=0 was to test a linear trend of the response variable among the 3