--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-stats+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
using DataFrames, RDatasets
iris = dataset("datasets", "iris")
iris[:id] = 1:size(iris, 1)
longdf = melt(iris, :id)
widedf = unstack(longdf, :id, :variable, :value)
ERROR: MethodError: Cannot `convert` an object of type String to an object of type Float64
This may have arisen from a call to the constructor Float64(...),
since type constructors fall back to convert methods.
in setindex!(::DataArrays.DataArray{Float64,1}, ::String, ::Int64) at /Users/michael/.julia/v0.5/DataArrays/src/indexing.jl:217
in unstack(::DataFrames.DataFrame, ::Int64, ::Int64, ::Int64) at /Users/michael/.julia/v0.5/DataFrames/src/abstractdataframe/reshape.jl:183
in unstack(::DataFrames.DataFrame, ::Symbol, ::Symbol, ::Symbol) at /Users/michael/.julia/v0.5/DataFrames/src/abstractdataframe/reshape.jl:188
using DataFrames
df = DataFrame(ct = ["a", "b", "c", "d"], x = randn(4), id = ones(Int, 4))
unstack(df, :id, :ct, :x)