[R-SIG-Finance] extracting a subTable

Jorge Nieves jorge.nieves at moorecap.com
Wed Jan 14 22:37:06 CET 2009


sorry,

The data got out of order on the email.. Here is the data in a
spreadsheet.

Jorge
 <<test.xls>> 
> _____________________________________________ 
> From: 	Jorge Nieves  
> Sent:	Wednesday, January 14, 2009 04:30 PM
> To:	r-sig-finance at stat.math.ethz.ch
> Subject:	extracting a subTable
> 
> Hi,
> 
> I have a BIG table with data organized by ID, see example on Table#1
> bellow. I would like to extract a smaller table with the same number
> of columns. The rows should include only the last ROW of each ID.
> Table# 2 is an example extracted form table #1. I tried using the
> SUBSET function and plan to loop, but I was wondering if someone out
> there has a more efficient way to accomplish this.
> 
> You recommendations are highly appreciated.
> 
> Jorge
> 	
> 
> 	Table # 1					Table # 2
> 
> 	Seq	ID	X1	X2		Seq	ID	X1
> X2		
> 	1	15	-616	796		12	15	-148
> 878		
> 	2	15	-661	-455		20	20	-515
> 1,802		
> 	3	15	-355	-1,639		27	45	-138
> 179		
> 	4	15	-1,226	-97		34	70	1,348
> 840		
> 	5	15	506	985
> 
> 	6	15	-612	76
> 
> 	7	15	947	122
> 
> 	8	15	-45	1,980
> 
> 	9	15	295	-1,827
> 
> 	10	15	1,490	-743
> 
> 	11	15	115	1,283
> 
> 	12	15	-148	878
> 
> 	13	20	359	1,297
> 
> 	14	20	-185	-430
> 
> 	15	20	481	800
> 
> 	16	20	1,567	874
> 
> 	17	20	2,365	-167
> 
> 	18	20	1,636	1,649
> 
> 	19	20	-2,741	337
> 
> 	20	20	-515	1,802
> 
> 	21	45	90	624
> 
> 	22	45	-221	345
> 
> 	23	45	-2,168	-1,734
> 
> 	24	45	1,056	-1,070
> 
> 	25	45	678	-80
> 
> 	26	45	1,747	-74
> 
> 	27	45	-138	179
> 
> 	28	70	1,152	-3,167
> 
> 	29	70	-802	-337
> 
> 	30	70	-388	263
> 
> 	31	70	812	342
> 
> 	32	70	-576	972
> 
> 	33	70	653	-737
> 
> 	34	70	1,348	840
> 
> 	
> 
> 	
> 
> Jorge Nieves
> Phone 212.782.7083
> Fax 212.642.7644
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20090114/eda87907/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.xls
Type: application/vnd.ms-excel
Size: 24576 bytes
Desc: test.xls
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20090114/eda87907/attachment.xls>


More information about the R-SIG-Finance mailing list