Re: [R] Function to get a sequence of months

2007-09-11 Thread Gabor Grothendieck
Here is a solution using character manipulation. Noting that month.name is built into R we paste together the character string: "January Februrary ... December January ... December" Then we use perl style ungreedy matching to get the shortest substring matching the indicated expression then splitt

Re: [R] Function to get a sequence of months

2007-09-11 Thread Vladimir Eremeev
Duncan Murdoch-2 wrote: > > On 11/09/2007 6:36 AM, Arun Kumar Saha wrote: >> Hi all, >> >> I am looking for a function for following calculation. >> >> start.month = "July" >> end.month = "January" >> >> months = f(start.month, end.month, by=1) >> >> * f is the function that I am looking for

Re: [R] Function to get a sequence of months

2007-09-11 Thread Duncan Murdoch
On 11/09/2007 6:36 AM, Arun Kumar Saha wrote: > Hi all, > > I am looking for a function for following calculation. > > start.month = "July" > end.month = "January" > > months = f(start.month, end.month, by=1) > > * f is the function that I am looking for. > > Actually I want to get months = c(