Re: [R] Sequence generation in a table

2010-12-09 Thread Petr PIKAL
d to keep my problem > short in oder not to consume your valuable time. > > Regards > > Vince Pyne > > > > --- On Thu, 12/9/10, Petr PIKAL wrote: > > From: Petr PIKAL > Subject: Re: [R] Sequence generation in a table > To: "Vincy Pyne" > Cc

Re: [R] Sequence generation in a table

2010-12-09 Thread Henrique Dallazuanna
wever if there are number of > bonds (say 1000) in the portfolio, my method of converting the days > individually is not practical. > > I am extremely sorry for the inconvenience caused. I tried to keep my > problem short in oder not to consume your valuable time. > > Regards &

Re: [R] Sequence generation in a table

2010-12-09 Thread Liviu Andronic
On Thu, Dec 9, 2010 at 1:24 PM, Vincy Pyne wrote: > yy <- lapply(c(257, 520, 110), seq, to=0, by=-100) > > yy/360, I get following error. > > Error in yy/360 : non-numeric argument to binary operator > > On the other hand, > > yy[[1]]/365  fetches me > > [1] 0.7138889 0.436 0.158 >

Re: [R] Sequence generation in a table

2010-12-09 Thread Vincy Pyne
, Petr PIKAL wrote: From: Petr PIKAL Subject: Re: [R] Sequence generation in a table To: "Vincy Pyne" Cc: r-help@r-project.org Received: Thursday, December 9, 2010, 12:03 PM Hi r-help-boun...@r-project.org napsal dne 09.12.2010 12:41:47: > Dear Sir, > > Sorry to bother y

Re: [R] Sequence generation in a table

2010-12-09 Thread Petr PIKAL
cy Pyne > > > --- On Thu, 12/9/10, Jan van der Laan wrote: > > From: Jan van der Laan > Subject: Re: [R] Sequence generation in a table > To: r-help@r-project.org, vincy_p...@yahoo.ca > Received: Thursday, December 9, 2010, 10:57 AM > > Vincy, > > I suppo

Re: [R] Sequence generation in a table

2010-12-09 Thread Liviu Andronic
On Thu, Dec 9, 2010 at 12:41 PM, Vincy Pyne wrote: > The biggest constraint for me is here as an example I have taken only three > cases i.e. c(257, 520, 110), however in reality I will be dealing with no of > cases and that number is unknown. But your code will certainly generate me > the requ

Re: [R] Sequence generation in a table

2010-12-09 Thread Vincy Pyne
rbing you Sir and hope I am able to put up my problem in a proper manner. Regards Vincy Pyne --- On Thu, 12/9/10, Jan van der Laan wrote: From: Jan van der Laan Subject: Re: [R] Sequence generation in a table To: r-help@r-project.org, vincy_p...@yahoo.ca Received: Thursday, December 9, 2010,

Re: [R] Sequence generation in a table

2010-12-09 Thread Jan van der Laan
Vincy, I suppose the following does what you want. yy is now a list which allows for differing lengths of the vectors. > yy <- lapply(c(257, 520, 110), seq, to=0, by=-100) > yy[[1]] [1] 257 157 57 > yy[[2]] [1] 520 420 320 220 120 20 Regards, Jan On 9-12-2010 11:40, Vincy Pyne wrote: c(

[R] Sequence generation in a table

2010-12-09 Thread Vincy Pyne
Dear R helpers I have following input f = c(257, 520, 110). I need to generate a decreasing sequence (decreasing by 100) which will give me an input (in a tabular form) like 257, 157, 57 520, 420, 320, 220, 120, 20 110, 10 I tried the following R code f = c(257, 520, 110) yy = matrix(da

Re: [R] Sequence generation

2009-08-31 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 29.08.2009 21:49:54: > On Sat, Aug 29, 2009 at 8:14 PM, njhuang86 wrote: > > > > Hey guys, > > > > I was wondering how to create this sequence: 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, > > 2, 3... with the '1, 2, 3' repeated over 10 times. > > rep(1:3,10) # rep

Re: [R] Sequence generation

2009-08-29 Thread Greg Snow
Of Barry Rowlingson > Sent: Saturday, August 29, 2009 1:50 PM > To: njhuang86 > Cc: r-help@r-project.org > Subject: Re: [R] Sequence generation > > On Sat, Aug 29, 2009 at 8:14 PM, njhuang86 wrote: > > > > Hey guys, > > > > I was wondering how to create this s

Re: [R] Sequence generation

2009-08-29 Thread Barry Rowlingson
On Sat, Aug 29, 2009 at 8:14 PM, njhuang86 wrote: > > Hey guys, > > I was wondering how to create this sequence: 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, > 2, 3... with the '1, 2, 3' repeated over 10 times. rep(1:3,10) # rep repeats its first argument according to the number in its second argument > Also,

Re: [R] Sequence generation

2009-08-29 Thread David Winsemius
On Aug 29, 2009, at 3:14 PM, njhuang86 wrote: Hey guys, I was wondering how to create this sequence: 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3... with the '1, 2, 3' repeated over 10 times. As noted earlier rep(1:3, 10) Also, is there a simple method to generate 1, 1, 1, 2, 2, 2, 3, 3, 3?

Re: [R] Sequence generation

2009-08-29 Thread RIOS,ALFREDO ARTURO
I think should work rep(c(1,2,3),10) Alfredo On Sat Aug 29 15:14:15 EDT 2009, njhuang86 wrote: Hey guys, I was wondering how to create this sequence: 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3... with the '1, 2, 3' repeated over 10 times. Also, is there a simple method to generate 1, 1, 1,

[R] Sequence generation

2009-08-29 Thread njhuang86
Hey guys, I was wondering how to create this sequence: 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3... with the '1, 2, 3' repeated over 10 times. Also, is there a simple method to generate 1, 1, 1, 2, 2, 2, 3, 3, 3? Anyways, any help with be greatly appreciated! -- View this message in context: http://