Note that there are some explanatory texts on larger screens.

plurals
  1. PORe-bucketing data in R
    primarykey
    data
    text
    <p>I've been using the "hist" function to bucket my data in R. What I would to do now is have a hist function that not only takes a list of values to bucket, but the value and the count for each. I've written one in R to do it for me, but its 10-50x slower(very rough estimate) than the built in hist.</p> <p>Is there anyone way to do this 'natively'?</p> <p>So for example, maybe a list(or vector) of the form (1, 200) (2, 30) (3, 50)</p> <p>Where the first value is the value, and the second is the number of instances of that data (I can move my data into other forms, this is just an example)</p> <p>Thanks!</p> <p>Update: I'm (basically) mapping a continuous domain to a arbitrary discrete domain. So say I have a hundred values between 0 and 10, and I want an output of how many are between 0 and 1, 1 and 2 etc..(or between 0 and 2, 2 and 4 or whatever). So the hist function works fine for that(I tell it where to divide the 'buckets') and it outputs the discretized counts(I can pass in a flag not to draw the graph).</p> <p>But what I have now is not just a set of value from 0 to 10, but a set of values, AND how many instances there are of that. So instead of having 0.1, 0.1, 0.1, 0.1, 0.2, 0.2, 0.5 as 7 different values I have it in the form (0.1, 4), (0.2, 2), (0.5, 1) which shows the values and the count. And I want to be able to run the 'hist' function(or something like it) over the data and get the same output as if it was in the 'expanded' form.</p> <p>So I've written a function to do that, but it runs A LOT slower than the original hist. "Unrolling" the data would make it too large in memory for what I need.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload