Try this:

aggregate(t(x), list(gl(2, 2)), FUN = 'diff')

On Sun, Jan 30, 2011 at 11:32 PM, Ramya <ramya.vict...@gmail.com> wrote:

>
> Hi,
>
> I have a Dataframe.
>
> A       B      C       D
> 0.1    0.7   0.9   0.8
> 0.20  0.60 0.80  0.70
> 0.40  0.80  0.70 0.76
>
> I need a resultant dataframe
>
> (A-B)   (C-D)
> -0.6     0.1
> -0.40    0.1
> -0.40   -0.06
>
> Any suggestion would be of a great help
>
> Thanks
> Ramya
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Finding-a-Diff-within-a-Dataframe-columns-tp3247943p3247943.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to