On 9/2/2009 1:31 PM, Peter Ehlers wrote:
Heinrich,
You could create your own function mywithin()
by inserting a couple of rev()'s in within.data.frame().
In within.data.frame(), replace the two commented lines
with those immediately following:
mywithin <-
function (data, expr, ...)
{
pare
On Wed, Sep 2, 2009 at 9:27 AM, RINNER
Heinrich wrote:
> Dear R community,
>
> I am using function 'within' in R.2.9.1 to add variables to an existing
> data.frame. This works wonderful, except for one minor point: The new
> variables are added to the data in reverse order.
>
> For example:
> x <
Heinrich,
You could create your own function mywithin()
by inserting a couple of rev()'s in within.data.frame().
In within.data.frame(), replace the two commented lines
with those immediately following:
mywithin <-
function (data, expr, ...)
{
parent <- parent.frame()
#e <- evalq(enviro
On 9/2/2009 9:27 AM, RINNER Heinrich wrote:
Dear R community,
I am using function 'within' in R.2.9.1 to add variables to an existing
data.frame. This works wonderful, except for one minor point: The new variables
are added to the data in reverse order.
For example:
x <- data.frame(a = 1:3, b
Try this:
transform(transform(x, c = a ^ 2, d = b ^2), e = c + d)
On Wed, Sep 2, 2009 at 10:27 AM, RINNER Heinrich <
heinrich.rin...@tirol.gv.at> wrote:
> Dear R community,
>
> I am using function 'within' in R.2.9.1 to add variables to an existing
> data.frame. This works wonderful, except for
Dear R community,
I am using function 'within' in R.2.9.1 to add variables to an existing
data.frame. This works wonderful, except for one minor point: The new variables
are added to the data in reverse order.
For example:
x <- data.frame(a = 1:3, b = 4:6)
y <- within(x, {
c = a^2
d =
6 matches
Mail list logo