For now, you can use sequence-map to turn the hashtable into a sequence of
vectors.

#lang racket

(require math)

(require plot)

(discrete-histogram (sequence-map vector (in-hash (samples->hash '(1 2 3 4
4)))))


But it would be nicer if discrete-histogram took a hash as input.

On Tue, Jun 7, 2016 at 10:44 AM, Sean Kemplay <sean.kemp...@gmail.com>
wrote:

> Hello,
>
> Something like the following would be ideal to build a histogram from a
> sequence of values read in via CSV
>
> #lang racket
> (require math)
> (require plot)
>
> (discrete-histogram (samples->hash '(1 2 3 4 4)))
>
> However discreet histogram takes a list of vectors. Is there a way to
> achieve something like the above without managing a list of vectors for
> 500,000+ rows of data?
>
> Reading the docs, I thought discrete-histogram would also take a list of
> lists and that I could do something like (discrete-histogram (hash->list
> (samples->hash '(1 2 3 4 4)))) but it looks like hash->list returns a list
> of dotted pairs.
>
> Sorry, I dip in and out of Racket so I may be missing something obvious.
> Maybe run through hash-map?
>
> Kind regards,
> Sean
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to