Re: [R] Adding a numeric to all values in the dataframe

2011-05-21 Thread John Kane
--- On Fri, 5/20/11, David Winsemius wrote: > From: David Winsemius > Subject: Re: [R] Adding a numeric to all values in the dataframe > To: "John Kane" > Cc: bill.venab...@csiro.au, ramya.vict...@gmail.com, r-help@r-project.org > Received: Friday, May 20, 2011, 10:1

Re: [R] Adding a numeric to all values in the dataframe

2011-05-20 Thread David Winsemius
d a matrix. -- On Fri, 5/20/11, bill.venab...@csiro.au wrote: From: bill.venab...@csiro.au Subject: Re: [R] Adding a numeric to all values in the dataframe To: bill.venab...@csiro.au, ramya.vict...@gmail.com, r-help@r-project.org Received: Friday, May 20, 2011, 9:37 PM Oops The first

Re: [R] Adding a numeric to all values in the dataframe

2011-05-20 Thread John Kane
e: > From: bill.venab...@csiro.au > Subject: Re: [R] Adding a numeric to all values in the dataframe > To: bill.venab...@csiro.au, ramya.vict...@gmail.com, r-help@r-project.org > Received: Friday, May 20, 2011, 9:37 PM > Oops > > The first line of my template should use data.ma

Re: [R] Adding a numeric to all values in the dataframe

2011-05-20 Thread Bill.Venables
) Sent: 20 May 2011 14:30 To: 'Ramya'; 'r-help@r-project.org' Subject: RE: [R] Adding a numeric to all values in the dataframe For that kind of operation (unusual as it is) work with numeric matrices. When you are finished, if you still want a data frame, make it then, not b

Re: [R] Adding a numeric to all values in the dataframe

2011-05-19 Thread Bill.Venables
ix2 <- myMatrix + 2 myData2 <- data.frame(myMatrix2) Bill Venables. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ramya Sent: Friday, 20 May 2011 1:54 PM To: r-help@r-project.org Subject: [R] Adding a numeric to all values in the

Re: [R] Adding a numeric to all values in the dataframe

2011-05-19 Thread Jorge Ivan Velez
Hi, Does the following work for you? set.seed(123) d <- data.frame(x = rpois(10, 4), y = rnorm(10)) d d + 2 See ?within for one more option. HTH, Jorge On Thu, May 19, 2011 at 11:54 PM, Ramya <> wrote: > Hi there > > I just want to add 2 to all the values in dataframe. > > I tried using sapp

[R] Adding a numeric to all values in the dataframe

2011-05-19 Thread Ramya
Hi there I just want to add 2 to all the values in dataframe. I tried using sapply but it seem to die all the time. Any help would be appreciated. Thanks Ramya -- View this message in context: http://r.789695.n4.nabble.com/Adding-a-numeric-to-all-values-in-the-dataframe-tp3537594p3537594.htm