Re: [R] Using names function

2010-10-30 Thread Jorge Ivan Velez
ue and the > month? > > From: > Date: Sat, 30 Oct 2010 12:33:12 -0400 > Subject: Re: [R] Using names function > To: ksudha...@live.com > CC: r-help@r-project.org > > Hi Sudhakar, > Take a look at ?which.max > > > msales <- c(2700, 2600, 3050) names(msales)

Re: [R] Using names function

2010-10-30 Thread David Winsemius
On Oct 30, 2010, at 12:27 PM, Sudhakar Kumar wrote: Just starting on my journey to learn R and the book I am using is "Using R for Introductory Statistics" One of the problems (page 15, 1.10) goes as follows: The monthly sales fig for 2002 were (2700, 2600, 3050, . . ). Using diff() find

Re: [R] Using names function

2010-10-30 Thread Sudhakar Kumar
Thanks Jorge. That is very helpful. Hadnt seen 'which' yet. So it is a matter of combining functions if I wanted both the value and the month? From: jorgeivanve...@gmail.com Date: Sat, 30 Oct 2010 12:33:12 -0400 Subject: Re: [R] Using names function To: ksudha...@live.com CC

Re: [R] Using names function

2010-10-30 Thread Jorge Ivan Velez
Hi Sudhakar, Take a look at ?which.max msales <- c(2700, 2600, 3050) names(msales) <- c("Jan", "Feb", "Mar") names(which.max(diff(msales))) # [1] "Mar" HTH, Jorge On Sat, Oct 30, 2010 at 12:27 PM, Sudhakar Kumar <> wrote: > > Just starting on my journey to learn R and the book I am using is "

[R] Using names function

2010-10-30 Thread Sudhakar Kumar
Just starting on my journey to learn R and the book I am using is "Using R for Introductory Statistics" One of the problems (page 15, 1.10) goes as follows: The monthly sales fig for 2002 were (2700, 2600, 3050, . . ). Using diff() find the month with greatest increase from prev month. I crea