Skip to content

Concatenate dataframe

1 message · Ronaldo Reis Jr.

#
Hi,

thanks for help on index in a for for looping. its work.

Now I have another doubt.

I have a data.frame like this:

    nsps area
1      1    4
2      0    9
3      1    4
4      1    4
5      1    4
6      1    9
7      0    4
8      1    9
9      0    4
10     1    9
...

I try to make another data.frame like this:

    nsps area
1      4    4
2      3    9

using tapply, it work:
4   9  16  25  36  49  64  81 100 121 144 
  4  10  11  19  25  34  36  44  49  49  56 

But i need it on a data.frame where the first line of this tapply result is 
the area column and the second line is the nsps column.

Any idea for make this?

Thanks
Ronaldo