Re: [R] Please help with this error - new to

2010-09-20 Thread c.wri...@uq.edu.au
Sorry about that Jeff. I have attached the data file to this email. Kind regards, Casey Wright Casey Wright BSc (Hons I)I PhD Candidate I The University of Queensland School of Medicine l Room 2, Level 1, Clinical Sciences Building, The Prince Charles Hospital, Rode Road,

Re: [R] invalid 'row.names' length error when running scatterplots or plot in R Commander

2010-09-20 Thread Peter Dalgaard
On 09/20/2010 04:00 AM, Samantha McKenzie wrote: The data look fine and correlation/regression can be done on them with correct output. Just not scatterplots. I tried a work around using the following script, but still with the same result: attach(Mass) Mass str(Mass) names(Mass)

Re: [R] invalid 'row.names' length error when running scatterplots or plot in R Commander

2010-09-20 Thread Dejian Zhao
I did not reproduce the error either, because I failed to find the function scattperplot in your script. :D I suggest that you check whether they read the data into R correctly. On 2010-9-20 10:00, Samantha McKenzie wrote: Hello, I teach statistics and use R Commander for teaching. I have 2

[R] select affy probes of cancer-related genes

2010-09-20 Thread Unger Kristian
Hi! I would like to select probes (affy expression set) of genes that are cancer-related. Conventionally the decision whether a gene is cancer-related or not is made by looking up the literature. Since this is not possible for all genes on the array I wonder if there is a way of doing this

[R] Tal Galili wants to stay in touch on LinkedIn

2010-09-20 Thread Tal Galili via LinkedIn
LinkedIn Tal Galili requested to add you as a connection on LinkedIn: -- Arnaud, I'd like to add you to my professional network on LinkedIn. - Tal Galili Accept invitation from Tal Galili

[R] ggplot2 - bar colour

2010-09-20 Thread nzcoops
Hi All, I have trying to do what I thought was a reasonably simple graph but I think I'm now going in circles with the colour. Attached is a picture of where I'm up to. The line creating this is: qplot(ageincgraph$age, ageincgraph$rate, position=dodge, stat=identity, geom=bar ) + aes(

Re: [R] Tal Galili wants to stay in touch on LinkedIn

2010-09-20 Thread Edwin Groot
Tal: Invite everyone on R-Help, why not? Please check your contact e-mail address! Edwin -- On Mon, 20 Sep 2010 02:14:17 -0700 (PDT) Tal Galili via LinkedIn mem...@linkedin.com wrote: LinkedIn Tal Galili requested to add you as a connection on LinkedIn:

Re: [R] ggplot2 - bar colour

2010-09-20 Thread ONKELINX, Thierry
If you want to change the fill colours, then you need to specify fill instead of colour ggplot(ageincgraph, aes(x = age, y = rate, fill = era)) + geom_bar(position = dodge, stat = identity) + scale_fill_manual(values=c(red,orange,yellow))

[R] How to set the limit of abline (regression line of lm)

2010-09-20 Thread elaine kuo
Dear List, I ran a regression model using lm and produced a regression line using abline. The line ranges from -20 to 20 in x axis, and the section I only want is from -20 to 0. Please kindly advise any function in abline () to set the range of x axes. Thank you Elaine

[R] select affy probes of cancer-related genes

2010-09-20 Thread Unger Kristian
Hi! I would like to select probes (affy expression set) of genes that are cancer-related. Conventionally the decision whether a gene is cancer-related or not is made by looking up the literature. Since this is not possible for all genes on the array I wonder if there is a way of doing this

[R] Substitute NAs by zero

2010-09-20 Thread skan
Hello How can I substitute all NA values by zero in a R zoo series? I've been reading about na.locf and na.omit but I think none of them do what I need. thanks. -- View this message in context: http://r.789695.n4.nabble.com/Substitute-NAs-by-zero-tp2546715p2546715.html Sent from the R help

Re: [R] Substitute NAs by zero

2010-09-20 Thread Girish A.R.
Check the following thread from a couple of years ago: http://www.mail-archive.com/r-help@r-project.org/msg14521.html cheers, -Girish -- View this message in context: http://r.789695.n4.nabble.com/Substitute-NAs-by-zero-tp2546715p2546725.html Sent from the R help mailing list archive at

Re: [R] Substitute NAs by zero

2010-09-20 Thread steven mosher
v-c(1,2,3,4,5,6,7,8,97,6,5,4,NA,NA) b-zoo(v) b 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7 8 97 6 5 4 NA NA b[is.na(b)]-0 b 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 2 3 4 5 6 7 8 97 6 5 4 0 0 is.zoo(b) [1] TRUE On Mon, Sep 20, 2010 at 2:37 AM, skan

Re: [R] Tal Galili wants to stay in touch on LinkedIn

2010-09-20 Thread Tal Galili
Edwin and everyone else - I am very sorry for this accidental spamming! Please ignore. Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) |

Re: [R] Odp: Programming: loop versus vector oriented

2010-09-20 Thread Petr PIKAL
Hi Jan r-help-boun...@r-project.org napsal dne 17.09.2010 12:43:40: Hello Petr, but I think this is how your code really works. Did you try it? it does, but the R documentation says somewhere: Warning: for() loops are used in R code much less often than in compiled languages. Code that

Re: [R] Odp: Programming: loop versus vector oriented

2010-09-20 Thread Petr PIKAL
Hi Jan Jan private jrheinlaen...@gmx.de napsal dne 18.09.2010 12:12:29: Hello Petr, thank you for your ideas. The split() looks most realistic. What about this idea: 1. Define three functions Refun1, Refun2, Refun3 for the three different sections of the calculations (same as you

Re: [R] Converting tables to matrices

2010-09-20 Thread Ivan Calandra
Hi, In this case, str() would help you a lot too to understand the structure of your ft object, and especially which element contains what. Ivan Le 9/20/2010 04:59, Michael Bedward a écrit : A good function to know about is names(). For example... ft- fisher.test( my.data ) names(ft)

Re: [R] working with eval and environments

2010-09-20 Thread Duncan Murdoch
darckeen wrote: I'm trying to get the following section of code to work, I think the problem is being caused by the assignment of data to the lm function not evaluating to train in the parent environment but I can't seem to figure out how to do this. I'd suggest simplifying this. Packing

Re: [R] How to set the limit of abline (regression line of lm)

2010-09-20 Thread Gavin Simpson
On Mon, 2010-09-20 at 17:31 +0800, elaine kuo wrote: Dear List, I ran a regression model using lm and produced a regression line using abline. The line ranges from -20 to 20 in x axis, and the section I only want is from -20 to 0. Please kindly advise any function in abline

Re: [R] ggplot2 - bar colour

2010-09-20 Thread nzcoops
Thanks Thierry, will have a go when back in the office tomorrow. I had tried ggplot as opposed to qplot but didn't get any further. I'm actually after a greyscale graph for black and white printing (red etc was just so I could see the change before tweaking further). A reasonably thorough

Re: [R] Tal Galili wants to stay in touch on LinkedIn

2010-09-20 Thread Jim Lemon
On 09/20/2010 07:25 PM, Edwin Groot wrote: Tal: Invite everyone on R-Help, why not? Please check your contact e-mail address! Edwin I think this is LinkedIn, as I have gotten a number of more or less spam notifications like this when the person involved had no idea they were sent. Jim

Re: [R] How to set the limit of abline (regression line of lm)

2010-09-20 Thread Jim Lemon
On 09/20/2010 07:31 PM, elaine kuo wrote: Dear List, I ran a regression model using lm and produced a regression line using abline. The line ranges from -20 to 20 in x axis, and the section I only want is from -20 to 0. Please kindly advise any function in abline () to set the range of

Re: [R] ggplot2 - bar colour

2010-09-20 Thread ONKELINX, Thierry
Textures are currently not possible in ggplot2. Because grid does not support them. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie Kwaliteitszorg Gaverstraat 4 9500 Geraardsbergen Belgium

Re: [R] function help?

2010-09-20 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 17.09.2010 17:02:29: On 9/16/10 5:00 PM, Rolf Turner wrote: On 17/09/2010, at 8:51 AM, Duke wrote: Hi Duncan, On 9/16/10 3:47 PM, Duncan Murdoch wrote: On 16/09/2010 3:40 PM, Duke wrote: Hi all, I am writing a function (fun.R),

[R] predict.lrm ( Design package)

2010-09-20 Thread Chris Mcowen
Dear List, I am familier with binary models, however i am now trying to get predictions from a ordinal model and have a question. I have a data set made up of 12 categorical predictors, the response variable is classed as 1,2,3,4,5,6, this relates to threat level of the species ( on the IUCN

Re: [R] boyplots nearly identical but still highly significant effect?

2010-09-20 Thread Ben Bolker
Jake Kami jakejkami at gmail.com writes: dear list, i am running a within-design ANOVA with 4 factors (4,4,2 and 2 levels each). the last one is a time factor comprising two different treatment timepoints. i fit a mixed-effects model using lme and apply the anova function to the outcome.

Re: [R] select affy probes of cancer-related genes

2010-09-20 Thread Ben Bolker
Unger Kristian k.unger at imperial.ac.uk writes: I would like to select probes (affy expression set) of genes that are cancer-related. Conventionally the decision whether a gene is cancer-related or not is made by looking up the literature. Since this is not possible for all genes on the

[R] running time consuming function in the background?

2010-09-20 Thread raje...@cse.iitm.ac.in
Hi, I have a function that takes close to 60 seconds to run. In this time, the R interface freezes and I have to wait for it to complete. Is there anyway the function can run in the background while I continue to use the interface? It could send me a signal when it completed.

[R] unz() ignores encoding argument

2010-09-20 Thread Stefan Evert
Hi! I'm trying to read individual files from a ZIP archive, using the unz() function. Some of the files contain non-ASCII characters and I'd like to avoid unpacking them in a temporary directory. My problem is that unz() seems to ignore the encoding=latin1 option I need to read the non-ASCII

[R] how to show the number of each axis interval (plot)

2010-09-20 Thread elaine kuo
Dear List, I am using plot for homework. The x-axis covered from 0 to 80, with 4 intervals. However, the plot only showed 0, 40, 80. 20 and 60 disappeared. Please kindly advise how to show 0, 20, 40, 60, 80 for the axis interval. Thank you. Elaine [[alternative HTML version deleted]]

Re: [R] how to show the number of each axis interval (plot)

2010-09-20 Thread Ivan Calandra
Hi, The list is not made for helping students with their homeworks. I will just tell you this: there are graphic parameters for every single detail on a plot. Take a look at ?par Ivan Le 9/20/2010 15:44, elaine kuo a écrit : Dear List, I am using plot for homework. The x-axis covered

Re: [R] how to show the number of each axis interval (plot)

2010-09-20 Thread Duncan Murdoch
On 20/09/2010 9:44 AM, elaine kuo wrote: Dear List, I am using plot for homework. You should ask your instructor or teaching assistant for help on homework. Duncan Murdoch The x-axis covered from 0 to 80, with 4 intervals. However, the plot only showed 0, 40, 80. 20 and 60 disappeared.

Re: [R] how to show the number of each axis interval (plot)

2010-09-20 Thread ONKELINX, Thierry
Have a look at ?axis ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie Kwaliteitszorg Gaverstraat 4 9500 Geraardsbergen Belgium Research Institute for Nature and Forest team Biometrics

Re: [R] predict.lrm ( Design package)

2010-09-20 Thread Frank Harrell
You sent a private note about this which I just took the time to answer. Please send only one note, and please post my reply to you to r-help. Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context:

Re: [R] how to show the number of each axis interval (plot)

2010-09-20 Thread Ben Bolker
Duncan Murdoch murdoch.duncan at gmail.com writes: On 20/09/2010 9:44 AM, elaine kuo wrote: Dear List, I am using plot for homework. You should ask your instructor or teaching assistant for help on homework. Duncan Murdoch The x-axis covered from 0 to 80, with 4 intervals.

[R] Depletion of small p values upon iterative testing of identical normal distributions

2010-09-20 Thread A
Dear all, I'm performing a t-test on two normal distributions with identical mean standard deviation, and repeating this tests a very large number of times to describe an representative p value distribution in a null case. As a part of this, the program bins these values in 10 evenly distributed

Re: [R] predict.lrm ( Design package)

2010-09-20 Thread Chris Mcowen
A few comments; sorry I don't have time for any more. - Combining categories is almost always a bad idea - It can be harder to discriminate more categories but that's only because the task is more difficult - Split-sample validation is not reliable unless you have say 10,000 samples to begin

Re: [R] Depletion of small p values upon iterative testing of identical normal distributions

2010-09-20 Thread Duncan Murdoch
On 20/09/2010 9:54 AM, A wrote: Dear all, I'm performing a t-test on two normal distributions with identical mean standard deviation, and repeating this tests a very large number of times to describe an representative p value distribution in a null case. As a part of this, the program bins

Re: [R] predict.lrm ( Design package)

2010-09-20 Thread Peter Dalgaard
On Sep 20, 2010, at 15:50 , Frank Harrell wrote: You sent a private note about this which I just took the time to answer. Please send only one note, and please post my reply to you to r-help. I have been annoyed by this at times as well. However, I have come to suspect that it is actually

Re: [R] Composing Music - R Package

2010-09-20 Thread Ben Bolker
C.H. chainsawtiney at gmail.com writes: http://r-forge.r-project.org/projects/tuner/ On Mon, Sep 20, 2010 at 8:35 AM, Deb Midya debmidya at yahoo.com wrote: [snip] 1.   Is there any R-package or if any to compose music? 2.   Is there any R-package or if any to analyse music?

Re: [R] Depletion of small p values upon iterative testing of identical normal distributions

2010-09-20 Thread Ben Bolker
A petlyakov at gmail.com writes: Dear all, [snip] Here are two key parts of my code to show what functions I'm working with: #Calculating the p values while(inumtests){ Group1-rnorm(6,-0.0065,0.0837) Group2-rnorm(6,-0.0065,0.0837) PV-t.test(Group1,Group2)$p.value

Re: [R] Depletion of small p values upon iterative testing of id

2010-09-20 Thread Ted Harding
On 20-Sep-10 13:54:56, A wrote: Dear all, I'm performing a t-test on two normal distributions with identical mean standard deviation, and repeating this tests a very large number of times to describe an representative p value distribution in a null case. As a part of this, the program bins

Re: [R] predict.lrm ( Design package)

2010-09-20 Thread Chris Mcowen
A few comments; sorry I don't have time for any more. - Combining categories is almost always a bad idea - It can be harder to discriminate more categories but that's only because the task is more difficult - Split-sample validation is not reliable unless you have say 10,000 samples to begin

[R] Advanced R Training - London

2010-09-20 Thread Sarah Lewis
Mango Solutions announce a public training course in ADVANCED R on the 6th and 7th October 2010 in London. This 2 day course is suitable for people with a working knowledge of R who want to extend their knowledge to take advantage of the fuller capabilities of R. Ideally, attendees should

Re: [R] Depletion of small p values upon iterative testing of identical normal distributions

2010-09-20 Thread Thomas Lumley
On Mon, 20 Sep 2010, Duncan Murdoch wrote: On 20/09/2010 9:54 AM, A wrote: Dear all, I'm performing a t-test on two normal distributions with identical mean standard deviation, and repeating this tests a very large number of times to describe an representative p value distribution in a null

Re: [R] predict.lrm ( Design package)

2010-09-20 Thread Frank Harrell
Thanks Peter. I think you're right. Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/predict-lrm-Design-package-tp2546894p2547146.html Sent from the R help mailing list archive at Nabble.com.

[R] support for caron (hacek) symbol

2010-09-20 Thread Jonathan Callahan
I am creating a Slovak translation of an interactive website ( http://mazamascience.com/OilExport/index_sk.html ) and am running into problems with R's lack of support for the caron found in the following letters: Č/č, Š/š and Ž/ž. I am using R 2.6.1 running on a recent version of CentOS.

[R] interpreting one-way anova tables

2010-09-20 Thread Jabez Wilson
Hi, I am trying to reconcile anova table in R (summary(lm)) with individual t.test. datafilename=http://personality-project.org/R/datasets/R.appendix1.data; data.ex1=read.table(datafilename,header=T) #read the data into a table summary(lm(Alertness~Dosage,data=data.ex1)) gives: Call:

Re: [R] support for caron (hacek) symbol

2010-09-20 Thread Vojtěch Zeisek
Hello Dne Po 20. září 2010 10:28:54 Jonathan Callahan napsal(a): I am creating a Slovak translation of an interactive website ( http://mazamascience.com/OilExport/index_sk.html ) and am running into problems with R's lack of support for the caron found in the following letters: Č/č, Å /Å¡

Re: [R] interpreting one-way anova tables

2010-09-20 Thread David Winsemius
On Sep 20, 2010, at 11:53 AM, Jabez Wilson wrote: Hi, I am trying to reconcile anova table in R (summary(lm)) with individual t.test. datafilename=http://personality-project.org/R/datasets/R.appendix1.data data.ex1=read.table(datafilename,header=T) #read the data into a table

Re: [R] interpreting one-way anova tables

2010-09-20 Thread Thomas Lumley
On Mon, 20 Sep 2010, Jabez Wilson wrote: Hi, I am trying to reconcile anova table in R (summary(lm)) with individual t.test. datafilename=http://personality-project.org/R/datasets/R.appendix1.data; data.ex1=read.table(datafilename,header=T) #read the data into a table

Re: [R] Is there a bisection method in R?

2010-09-20 Thread Gregory Gentlemen
Now that is a more useful reply than Why do you assume there is one?. Thanks a lot Ravi! --- On Fri, 9/17/10, Ravi Varadhan rvarad...@jhmi.edu wrote: From: Ravi Varadhan rvarad...@jhmi.edu Subject: RE: [R] Is there a bisection method in R? To: 'Peter Dalgaard' pda...@gmail.com, 'Gregory

[R] Rounding Elements of a Matrix

2010-09-20 Thread Raphael Fraser
I have a 2x50 matrix and would like to round all the elements to 2 decimal places. Can any one help? Thanks, Raphael __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] contr.sum, model summaries and `missing' information

2010-09-20 Thread Greg Snow
Look at the functions dummy.coef, model.tables, and se.contrasts, they may help with what you want. You can also look at the multcomp package for another approach. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111

Re: [R] Rounding Elements of a Matrix

2010-09-20 Thread Joshua Wiley
Hi Raphael, mat - matrix(rnorm(100), ncol = 2) round(mat, 2) for documentation see ?round Cheers, Josh On Mon, Sep 20, 2010 at 9:21 AM, Raphael Fraser raphael.fra...@gmail.com wrote: I have a 2x50 matrix and would like to round all the elements to 2 decimal places. Can any one help?

[R] R/Finance 2011 - Call for Papers

2010-09-20 Thread Brian G. Peterson
Call for Papers: R/Finance 2011: Applied Finance with R April 29 and 30, 2011 Chicago, IL, USA The third annual R/Finance conference for applied finance using R will be held this spring in Chicago, IL, USA on April 29 and 30, 2011. The two-day conference will cover topics including portfolio

Re: [R] Rounding Elements of a Matrix

2010-09-20 Thread David Winsemius
On Sep 20, 2010, at 12:25 PM, Joshua Wiley wrote: Hi Raphael, mat - matrix(rnorm(100), ncol = 2) round(mat, 2) for documentation see ?round Thanks, Josh. I was having trouble a couple of minutes ago remembering this. Getting old, I guess. In constructing my thanks to Josh I tested:

Re: [R] Is there a bisection method in R?

2010-09-20 Thread peter dalgaard
On Sep 20, 2010, at 18:15 , Gregory Gentlemen wrote: Now that is a more useful reply than Why do you assume there is one?. Thanks a lot Ravi! Well, maybe, but you can NOT expect that someone will go out of THEIR way to solve YOUR problem every time. Sometimes they will and sometimes they

Re: [R] Is there a bisection method in R?

2010-09-20 Thread Gregory Gentlemen
Fair enough. I didn't intend to offend anyone. Please accept my apologies. Greg --- On Mon, 9/20/10, peter dalgaard pda...@gmail.com wrote: From: peter dalgaard pda...@gmail.com Subject: Re: [R] Is there a bisection method in R? To: Gregory Gentlemen gregory_gentle...@yahoo.ca Cc: Ravi Varadhan

Re: [R] How to set the limit of abline (regression line of lm)

2010-09-20 Thread Greg Snow
Look at the clip function for one approach. You specify the clipping region, then do abline and it only shows up in the region specified. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From:

Re: [R] Is there a bisection method in R?

2010-09-20 Thread Ravi Varadhan
I am glad, Greg, you did this. Peter is one of the backbones behind R, and has made enormous contributions to it. He deserves to be treated with respect. More to the point, Peter's comments are perfectly reasonable. People are motivated by different factors to go to extra lengths to help

[R] Sorting and subsetting

2010-09-20 Thread Doran, Harold
Suppose I have a data frame, such as the one below: tmp - data.frame(index = gl(2,20), foo = rnorm(40)) And further assume it is sorted by index and then by the variable foo. tmp - tmp[order(tmp$index, tmp$foo) , ] Now, I want to grab the first N rows of tmp for each index. In the end, what I

Re: [R] Sorting and subsetting

2010-09-20 Thread Phil Spector
Harold - Two ways that come to mind: 1) do.call(rbind,lapply(split(tmp,tmp$index),function(x)x[1:5,])) 2) subset(tmp,unlist(tapply(foo,index,seq))=5) - Phil Spector Statistical Computing Facility

Re: [R] Sorting and subsetting

2010-09-20 Thread Doran, Harold
Very nice, Phil. Thank you. -Original Message- From: Phil Spector [mailto:spec...@stat.berkeley.edu] Sent: Monday, September 20, 2010 1:28 PM To: Doran, Harold Cc: R-help Subject: Re: [R] Sorting and subsetting Harold - Two ways that come to mind: 1)

[R] OT: Is randomization for targeted cancer therapies ethical?

2010-09-20 Thread Bert Gunter
Hi Folks: **Off Topic** Those interested in clinical trials may find the following of interest: http://www.nytimes.com/2010/09/19/health/research/19trial.html It concerns the ethicality of randomizing those with life-threatening disease to relatively ineffective SOC when new biologically

Re: [R] Sorting and subsetting

2010-09-20 Thread Tal Galili
Hi Harold, I thought of one way to do this, but maybe (probably) there is a faster way: tmp - data.frame(index = gl(3,20), foo = rnorm(60)) subset.first.x.elements - function(INDEX, num.of.elements = 5) { t.INDEX - table(factor(INDEX, levels = unique(INDEX))) running.indexes -

Re: [R] Sorting and subsetting

2010-09-20 Thread Joshua Wiley
On Mon, Sep 20, 2010 at 10:27 AM, Phil Spector spec...@stat.berkeley.edu wrote: Harold -   Two ways that come to mind: 1) do.call(rbind,lapply(split(tmp,tmp$index),function(x)x[1:5,])) 2) subset(tmp,unlist(tapply(foo,index,seq))=5) 3) do.call(rbind, by(tmp, tmp$index, .Primitive([), 1:5,

[R] Lempel-Ziv Entropy Estimator

2010-09-20 Thread Lorenzo Isella
Dear All, Does anyone know if there is any R implementation of the Lempel-Ziv entropy estimator? I searched for it in the entropy contributed package, but unsuccessfully. Cheers Lorenzo __ R-help@r-project.org mailing list

Re: [R] Sorting and subsetting

2010-09-20 Thread Peter Dalgaard
On 09/20/2010 07:16 PM, Doran, Harold wrote: tmp1 - tmp1[1:5,] tmp2 - tmp2[1:5,] result - rbind(tmp1, tmp2) Does anyone see a way to subset and subsequently bind without a loop? do.call(rbind,lapply(split(tmp,tmp$index),head,5)) indexfoo 1.11 1 -1.5124909 1.10 1

Re: [R] how to import this kind of data?

2010-09-20 Thread Brian Diggs
On 9/17/2010 4:39 PM, Phil Spector wrote: Soyeon - I think scan() (combined with matrix and data.frame) is the easiest way. Suppose your text file is called data.txt. Then data.frame(matrix(scan('data.txt'),byrow=TRUE,ncol=14)) should give you what you want. - Phil Spector Statistical

Re: [R] Sorting and subsetting

2010-09-20 Thread David Winsemius
On Sep 20, 2010, at 1:40 PM, Joshua Wiley wrote: On Mon, Sep 20, 2010 at 10:27 AM, Phil Spector spec...@stat.berkeley.edu wrote: Harold - Two ways that come to mind: 1) do.call(rbind,lapply(split(tmp,tmp$index),function(x)x[1:5,])) 2) subset(tmp,unlist(tapply(foo,index,seq))=5) 3)

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-20 Thread array chip
Thank you Peter for your explanation of relationship between aov and lme. It makes perfect sense. When you said you might have computed the average of all 8 measurements on each animal and computed a 1-way ANOVA for treatment effect, would this be the case for balanced design, or it is also

Re: [R] Sorting and subsetting

2010-09-20 Thread David Winsemius
On Sep 20, 2010, at 2:01 PM, David Winsemius wrote: On Sep 20, 2010, at 1:40 PM, Joshua Wiley wrote: On Mon, Sep 20, 2010 at 10:27 AM, Phil Spector spec...@stat.berkeley.edu wrote: Harold - Two ways that come to mind: 1) do.call(rbind,lapply(split(tmp,tmp$index),function(x)x[1:5,])) 2)

Re: [R] Sorting and subsetting

2010-09-20 Thread William Dunlap
Richard Tan asked a very similar question last week ('get top n rows group by a column from a dataframe'). You could use ave() to make a sequence-number-within-group vector and choose rows with a small enough value there: tmp[ave(integer(nrow(tmp)), tmp$index, FUN=seq_along)=N, ] If there are

[R] how to seperate ? or how to do regression on each variable when I have multiple variables?

2010-09-20 Thread Soyeon Kim
Dear All, I have data which contains 14 variables. And I have to regress one of variables on each variable (simple 13 linear regressions) I try to make a loop and store only R-squared colnames(boston) [1] CRIMZN INDUS CHASNOX RM AGE [8] DIS RAD TAX PTRATIO

[R] ERROR: Object not found

2010-09-20 Thread Tianchan Niu
Dear All, I am trying to use ode solver rk4 to solve an ODE system, however, it keeps saying: Error in eval(expr, envir, enclos) : object dIN not found. The sample codes are enclosed as follows, please help me. Thank you very much! rm(list=ls()) library(odesolve) # The ODE system

Re: [R] OT: Is randomization for targeted cancer therapies ethical?

2010-09-20 Thread Charles C. Berry
On Mon, 20 Sep 2010, Bert Gunter wrote: Hi Folks: **Off Topic** Those interested in clinical trials may find the following of interest: http://www.nytimes.com/2010/09/19/health/research/19trial.html It concerns the ethicality of randomizing those with life-threatening disease to relatively

Re: [R] Sorting and subsetting

2010-09-20 Thread Joshua Wiley
On Mon, Sep 20, 2010 at 11:15 AM, David Winsemius dwinsem...@comcast.net wrote: On Sep 20, 2010, at 2:01 PM, David Winsemius wrote: On Sep 20, 2010, at 1:40 PM, Joshua Wiley wrote: On Mon, Sep 20, 2010 at 10:27 AM, Phil Spector spec...@stat.berkeley.edu wrote: Harold -  Two ways that

Re: [R] how to seperate ? or how to do regression on each variable when I have multiple variables?

2010-09-20 Thread Henrique Dallazuanna
Try this: lapply(names(boston), function(x)summary(update(lm(MEDV ~ 1, boston), ~ get(x On Mon, Sep 20, 2010 at 2:03 PM, Soyeon Kim yunni0...@gmail.com wrote: Dear All, I have data which contains 14 variables. And I have to regress one of variables on each variable (simple 13 linear

Re: [R] how to seperate ? or how to do regression on each variable when I have multiple variables?

2010-09-20 Thread Ista Zahn
Hi Soyeon, Here are a few options: ## Use get() to find the predictor r - rep(0, 13) for(i in 1: 13) { r[i] - summary(lm(MEDV ~ get(name[i]), data = boston))$r.squared } ## Use as.formula(paste()) to construction the model for(i in 1: 13) { r[i] - summary(lm(as.formula(paste(MEDV ~ , name[i],

[R] Ask for help with Error: Object not found

2010-09-20 Thread Tianchan Niu
Dear All, I am trying to use ode solver rk4 to solve an ODE system, however, it keeps saying: Error in eval(expr, envir, enclos) : object dIN not found. The sample codes are enclosed as follows, please help me. Thank you very much! rm(list=ls()) library(odesolve) # The ODE system

Re: [R] OT: Is randomization for targeted cancer therapies ethical?

2010-09-20 Thread David Winsemius
On Sep 20, 2010, at 2:28 PM, Charles C. Berry wrote: On Mon, 20 Sep 2010, Bert Gunter wrote: Hi Folks: **Off Topic** Those interested in clinical trials may find the following of interest: http://www.nytimes.com/2010/09/19/health/research/19trial.html It concerns the ethicality of

Re: [R] Is there a bisection method in R?

2010-09-20 Thread Matt Shotwell
I was just reading about the merge sort algorithm last night (BTW, here is a fun link http://www.youtube.com/watch?v=t8g-iYGHpEA). There are some interesting similarities in this context. Here's a recursive method for bisection: bisectMatt - function(fn, lo, hi, tol = 1e-7, ...) { flo -

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-20 Thread Peter Dalgaard
On 09/20/2010 08:09 PM, array chip wrote: Thank you Peter for your explanation of relationship between aov and lme. It makes perfect sense. When you said you might have computed the average of all 8 measurements on each animal and computed a 1-way ANOVA for treatment effect, would this

Re: [R] Sorting and subsetting

2010-09-20 Thread Peter Dalgaard
On 09/20/2010 08:01 PM, David Winsemius wrote: indexfoo 1.6 1 -3.0267759 1.7 1 -1.3725536 1.19 1 -1.1476048 1.16 1 -1.0963967 1.2 1 -1.0684793 2.29 2 -1.6601486 2.21 2 -1.2633632 2.22 2 -0.9875626 2.38 2 -0.9515301 2.30 2

Re: [R] lmer() vs. lme() gave different variance component estimates

2010-09-20 Thread array chip
Thank you Peter and Ben for your comments. John - Original Message From: Peter Dalgaard pda...@gmail.com To: array chip arrayprof...@yahoo.com Cc: r-help@r-project.org; r-sig-mixed-mod...@r-project.org Sent: Mon, September 20, 2010 12:28:43 PM Subject: Re: [R] lmer() vs. lme() gave

[R] Size of the legend

2010-09-20 Thread Mestat
Hello, Which would be the command to change the size of the legend. I checked at the help and I found out something about TEXT.WIDTH, but I am not sure if is what I want. Any help! Thanks in advance, Marcio -- View this message in context:

Re: [R] Ask for help with Error: Object not found

2010-09-20 Thread Duncan Murdoch
On 20/09/2010 3:07 PM, Tianchan Niu wrote: Dear All, I am trying to use ode solver rk4 to solve an ODE system, however, it keeps saying: Error in eval(expr, envir, enclos) : object dIN not found. The sample codes are enclosed as follows, please help me. Thank you very much! rm(list=ls())

Re: [R] OT: Is randomization for targeted cancer therapies ethical?

2010-09-20 Thread JLucke
Clearly inferior treatments are unethical. Donald Berry at MD Anderson in Houston TX and Jay Kadane at Carnegie Mellon have been working on more ethical designs within the Bayesian framework. In particular, response adaptive designs reduce the assignment to and continuation of patients on

Re: [R] Rounding Elements of a Matrix

2010-09-20 Thread Raphael Fraser
Thank you all On Mon, Sep 20, 2010 at 12:53 PM, Zoppoli, Gabriele (NIH/NCI) [G] zoppo...@mail.nih.gov wrote: see help(round) Gabriele Zoppoli, MD Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, University of Genova, Genova, Italy Guest Researcher, LMP, NCI, NIH, Bethesda

[R] Removing slected values from original vector and definning new vector with the rest?

2010-09-20 Thread Halabi, Anan
sampleSize - 20 shape.true - 1.82 scale.true - 987 sampWB - rweibull(sampleSize, shape=shape.true, scale=scale.true) print(sampWB) censidx - sample(1:length(sampWB), length(sampWB)*0.3) Censored.data - sampWB[censidx] noncensidx - defines the rest values of the vector which is not included at

Re: [R] Removing slected values from original vector and definning new vector with the rest?

2010-09-20 Thread Phil Spector
Anan - If you actually want the indices, you can use seq_along(sampWB)[-censidx] If you want the values themselves, then use sampWB[-censidx] - Phil Spector Statistical Computing Facility

[R] Help!

2010-09-20 Thread Oyomoare Osazuwa-Peters
Please I need some help using R to analyze my data. What I would like to do is to repeat the same basic process (e.g. linear regression between wood density and distance from pith) for at least 240 data subsets within the main data-frame. Within the main data-frame, these data subsets will be

Re: [R] Size of the legend

2010-09-20 Thread Dennis Murphy
Base graphics, ggplot2 or lattice? You need to be more specific. A reproducible example to illustrate your problem would be helpful. Dennis On Mon, Sep 20, 2010 at 1:07 PM, Mestat mes...@pop.com.br wrote: Hello, Which would be the command to change the size of the legend. I checked at the

Re: [R] Help!

2010-09-20 Thread Erich Neuwirth
If you assume that the variance is the same in all your subsets, you can do an lm analysis with your subset classification as a factor. You could also analyze the interaction between factors and between factors and your numeric independent variable. You also should consider repeated measurement

Re: [R] Help!

2010-09-20 Thread Oyomoare Osazuwa-Peters
From: Oyomoare Osazuwa-Peters oyomo...@yahoo.com Subject: Re: [R] Help! To: Erich Neuwirth erich.neuwi...@univie.ac.at Date: Monday, September 20, 2010, 5:16 PM Thanks for responding to my request for help. I understand what you mean about the repeated measurements methods for the two cores.

Re: [R] Help!

2010-09-20 Thread Bill.Venables
You could do most of this with the function lmList in the nlme package, but since you want both plots and summaries, you might as well do it in a more flexible loop. How about something like this: Code: ## This makes a single factor to define your groups BCI - within(BCI,

Re: [R] support for caron (hacek) symbol

2010-09-20 Thread Jonathan Callahan
Vojtěch, Thanks for responding. I should be clear that the web pages and server all support UTF-8 quite well. I am asking about using slavic letters with the caron/hacek symbol in R * plots*. Reading old messages I see that this has been a problem in past years. Can you -- or anyone else --

Re: [R] support for caron (hacek) symbol

2010-09-20 Thread Thomas Lumley
On Mon, 20 Sep 2010, Jonathan Callahan wrote: Can you -- or anyone else -- point me to some plots in R that have Czech, Slovak or Polish text on them? That would be the proof that it is possible. Then I would still need to figure out why my version fails to print this text properly. I have

Re: [R] support for caron (hacek) symbol

2010-09-20 Thread Jonathan Callahan
Awesome! Can you tell me what version of R you are using and what operating system? R does use system fonts, doesn't it? Perhaps I just don't have the correct fonts installed -- I'm on CentOS. Jon 2010/9/20 Thomas Lumley tlum...@u.washington.edu On Mon, 20 Sep 2010, Jonathan Callahan wrote:

  1   2   >