Re: [R] data frame subscription

2010-05-12 Thread David Winsemius
"STANDARD LEAD USD"), class = "factor"), POSITION = c(2, -3, -2, -2, -18, -3, -5, 1, -5, 1), prix = c(-702.9, 244.77, 166.48, 2273.8, 24876, 2985, 80.9, -15.95, 2512.5, -2423)), .Names = c("DESCRIPTION", "POSITION", "prix"), row.names = c

Re: [R] data frame subscription

2010-05-12 Thread arnaud Gaboury
TY. Didn't know this function. From: Henrique Dallazuanna [mailto:www...@gmail.com] Sent: Wednesday, May 12, 2010 3:32 PM To: arnaud Gaboury Cc: r-help@r-project.org Subject: Re: [R] data frame subscription Try this: transform(pose16, prix = POSITION * SETTLEMENT, SETTLEMENT =

Re: [R] data frame subscription

2010-05-12 Thread arnaud Gaboury
M HGH GD ALUMINIUM USD", "SPCL HIGH GRADE ZINC USD", "STANDARD LEAD USD"), class = "factor"), POSITION = c(2, -3, -2, -2, -18, -3, -5, 1, -5, 1), prix = c(-702.9, 244.77, 166.48, 2273.8, 24876, 2985, 80.9, -15.95, 2512.5, -2423)), .Names = c("DES

Re: [R] data frame subscription

2010-05-12 Thread arnaud Gaboury
> Cc: arnaud Gaboury; r-help@r-project.org > Subject: Re: [R] data frame subscription > > Couldn't you just put a minus sign in from of the derived "prix" > expression? > > transform(pose16, prix = - POSITION * SETTLEMENT, SETTLEMENT = NULL, > POSITION > = POSI

Re: [R] data frame subscription

2010-05-12 Thread Henrique Dallazuanna
GAR NO.11 May/10", > "WHEAT Jul/10", "PRIMARY NICKEL USD", "PRM HGH GD ALUMINIUM USD", > "SPCL HIGH GRADE ZINC USD", "STANDARD LEAD USD"), class = "factor"), > POSITION = c(2, -3, -2, -2, -18, -3, -5, 1, -5, 1), prix = c(-702.

Re: [R] data frame subscription

2010-05-12 Thread Henrique Dallazuanna
Try this: transform(pose16, prix = POSITION * SETTLEMENT, SETTLEMENT = NULL, POSITION = POSITION * -1) On Wed, May 12, 2010 at 9:50 AM, arnaud Gaboury wrote: > Dear group, > > Here is my df : > > pose16 <- > structure(list(DESCRIPTION = structure(c(1L, 2L, 3L, 4L, 5L, > 6L, 7L, 8L, 9L, 12L), .L

[R] data frame subscription

2010-05-12 Thread arnaud Gaboury
Dear group, Here is my df : pose16 <- structure(list(DESCRIPTION = structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 12L), .Label = c("COPPER May/10", "COTTON NO.2 Jul/10", "CRUDE OIL miNY May/10", "GOLD Jun/10", "ROBUSTA COFFEE (10) Jul/10", "SOYBEANS Jul/10", "SUGAR NO.11 Jul/10", "SUGAR NO.11