HarlanH/JuliaData — pull request #55 by doobwa (2012-09-12 20:48:13+00:00)
Title: Pooledvec interface functions

I have been experimenting with the following:

```

julia> pdvpp = PooledDataVec(["one","two","two"], ["one","two","three"])
values: ["one", "two", "two"]
levels: ["one", "three", "two"]

julia> levels(pdvpp)
3-element ASCIIString Array:
"one"
"three"
"two"

julia> values(pdvpp)
3-element ASCIIString Array:
"one"
"two"
"two"

julia> indices(pdvpp)
3-element Uint32 Array:
0x00000001
0x00000003
0x00000003

julia> int(indices(pdvpp))
3-element Int64 Array:
1
3
3
```

I've found the above helper functions useful. The interface varies a little bit, however, with R's `factor` and pandas' `Categorical`.

I've also changed the default to Uint32 for keeping references rather than Uint16. This makes it more useful for large categorical variables, e.g. UserID.

I also rearranged a few things to add UTF8String support.

```
julia> pdvpp = PooledDataVec([utf8("hello")])
values: ["hello"]
levels: ["hello"]

julia> typeof(pdvpp[1])
UTF8String
```

I thought I'd use a different branch in case there's anything worth discussing.