On Thu, Feb 3, 2011 at 10:05 PM, Peter Ehlers wrote:
> On 2011-02-03 14:09, Dennis Murphy wrote:
>>
>> Hi:
>>
>> This also works, except that the result is of class 'table':
>>
>> xtabs(COUNTS ~ USER_ID + SITE, data = RAW)
>> SITE
>> USER_ID SITE1 SITE2 SITE3
>> 1 10 13 22
>>
On 2011-02-03 14:09, Dennis Murphy wrote:
Hi:
This also works, except that the result is of class 'table':
xtabs(COUNTS ~ USER_ID + SITE, data = RAW)
SITE
USER_ID SITE1 SITE2 SITE3
1101322
2101212
31344 0
4 0 09
Hi:
This also works, except that the result is of class 'table':
xtabs(COUNTS ~ USER_ID + SITE, data = RAW)
SITE
USER_ID SITE1 SITE2 SITE3
1101322
2101212
31344 0
4 0 099
If you need a data frame, then the earlier res
Hi,
On Thu, Feb 3, 2011 at 2:41 PM, Mike Schumacher
wrote:
> Hello,
>
> I'd like to transpose data to create an analysis-friendly dataframe. See
> below for an example, I was unable to use t(x) and I couldn't find a
> function with options like PROC TRANSPOSE in SAS.
>
> The ideal solution handl
Hi Mike
reshape will be your friend.
reshape(RAW,direction="wide",timevar="SITE",idvar="USER_ID")
there is also the 'reshape'-package, which can do some more
sophisticated transformations.
hth.
Am 03.02.2011 20:41, schrieb Mike Schumacher:
> Hello,
>
> I'd like to transpose data to create an
Hello,
I'd like to transpose data to create an analysis-friendly dataframe. See
below for an example, I was unable to use t(x) and I couldn't find a
function with options like PROC TRANSPOSE in SAS.
The ideal solution handles variable quantities of SITE - but beggars can't
be choosers. :-)
Tha
6 matches
Mail list logo