dtbl[ rep(row.names(dtbl), dtbl$Freq), ]
str(xpd)
--
Best.
David.
>
> Cheers
> Petr
>
>> -Original Message-
>> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Kevin E.
>> Thorpe
>> Sent: Friday, March 17, 2017 1:23 PM
>> To: r-help
Kevin,
The short answer is no.
The function table() takes in the vectors provided as arguments, counts the
number of occurrences of each category by adding the integer 1L to a bin (one
for each category or factor level), and at the end it returns the counts in
each bin. Since it does not retur
> To: r-help
> Subject: [R] Reversing table()
>
> I am wondering if there is a way to undo the results of table().
>
> For example if you had a table that looked like the result of table(x, y) or
> table(x, y, z) is there a simple/elegant way to reverse the process to get th
I am wondering if there is a way to undo the results of table().
For example if you had a table that looked like the result of table(x, y) or
table(x, y, z) is there a simple/elegant way to reverse the process to get the
"original" x, y and z vectors?
Thanks,
Kevin
--
Kevin E. Thorpe
Head of
4 matches
Mail list logo