Please provide a way to sink to a standard Matrix without Tables or Dataframes
Unless I am wrong (but if so, many are on the internet too) to sink to a standard Matrix one has to first using Tables.jl or DataFrames.jl.
I believe it would be useful if CSV could be able to sink directly to a standard Matrix, e.g.
foo= CSV.read("foo.csv", Matrix; [options])
I am aware of readdlm, but CSV has way more options.
Hmmm, yeah, we could probably support this really easily by just wrapping/unwrapping the Tables.matrix call for you with a specific CSV.read dispatch for Matrix. I think that makes sense. We originally decided not to treat Matrix as a table in the Tables.jl interface sense because they don't really have column names/follow the other table properties, but I think this is a specific use-case where it's convenient to get a matrix out directly.
Would this just be
CSV.read(source, ::Type{Matrix}; kw...) = CSV.read(source, Tables.matrix; kw...)
?
Would we want to allow people to write CSV.read("foo.csv", Matrix{Int}) (i'm not sure how we'd do that)... so perhaps we'd want to throw in that case and point users to CSV.read("foo.csv", Matrix)?
@nickrobinson251, yeah that was my idea. Yeah, on the error path, maybe we have a CSV.read(source; ::Type{<:AbstractMatrix}) that says we only support Matrix and to control types, pass types=Int or something?