JuliaStats / RDatasets.jl

Julia package for loading many of the data sets available in R
GNU General Public License v3.0
159 stars 56 forks source link

No method matching CSV.File #92

Closed MaximeBouton closed 4 years ago

MaximeBouton commented 4 years ago

When trying to load datasets from the "datasets" group I am getting the following error:

ERROR: MethodError: no method matching CSV.File(::Base.GenericIOBuffer{Array{UInt8,1}}; delim=',', quotechar='"', missingstring="NA", rows_for_type_detect=200)
Closest candidates are:
  CSV.File(::Any; header, normalizenames, datarow, skipto, footerskip, limit, transpose, comment, use_mmap, ignoreemptylines, threaded, select, drop, missingstrings, missingstring, delim, ignorerepeated, quotechar, openquotechar, closequotechar, escapechar, dateformat, decimal, truestrings, falsestrings, type, types, typemap, categorical, pool, strict, silencewarnings, debug, parsingdebug, allowmissing) at /Users/maxime/.julia/packages/CSV/76SRf/src/CSV.jl:262 got unsupported keyword argument "rows_for_type_detect"
Stacktrace:
 [1] kwerr(::NamedTuple{(:delim, :quotechar, :missingstring, :rows_for_type_detect),Tuple{Char,Char,String,Int64}}, ::Type{T} where T, ::Base.GenericIOBuffer{Array{UInt8,1}}) at ./error.jl:157
 [2] (::RDatasets.var"#1#2"{String,String})(::IOStream) at /Users/maxime/.julia/packages/RDatasets/1Ih8s/src/dataset.jl:28
 [3] open(::RDatasets.var"#1#2"{String,String}, ::String, ::Vararg{String,N} where N; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at ./io.jl:298
 [4] open at ./io.jl:296 [inlined]
 [5] dataset(::String, ::String) at /Users/maxime/.julia/packages/RDatasets/1Ih8s/src/dataset.jl:26
 [6] top-level scope at REPL[3]:1

Minimum example:

using RDatasets
dataset("datasets", "volcano")

Environment:

Status `~/.julia/environments/julia-tour/Project.toml`
  [336ed68f] CSV v0.6.1
  [a93c6f00] DataFrames v0.20.2
  [c601a237] Interact v0.10.3
  [add582a8] MLJ v0.10.3
  [91a5bcdd] Plots v0.29.9
  [ce6b1742] RDatasets v0.6.1
  [f3b207a7] StatsPlots v0.14.4
  [0f1e0344] WebIO v0.8.13

version info:

julia> versioninfo()
Julia Version 1.4.0
Commit b8e9a9ecc6 (2020-03-21 16:36 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.6.0)
  CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
arnavs commented 4 years ago

I can reproduce this issue. And it also happens in the plm group.

asinghvi17 commented 4 years ago

Which version of RDatasets are you on @arnavs?

FWIW, I cannot reproduce this on:

(@v1.4) pkg> st -m RDatasets
Status `~/.julia/environments/v1.4/Manifest.toml`
  [336ed68f] CSV v0.6.1
  [944b1d66] CodecZlib v0.7.0
  [a93c6f00] DataFrames v0.20.2
  [5789e2e9] FileIO v1.3.0
  [df47a6cb] RData v0.6.3
  [ce6b1742] RDatasets v0.6.7
  [189a3867] Reexport v0.2.0
  [de0858da] Printf
MaximeBouton commented 4 years ago

it is also working for me now with v0.6.7

arnavs commented 4 years ago

Think I was on an old version; it's working now.

asinghvi17 commented 4 years ago

Looks resolved to me; please feel free to reopen if the issue persists on new versions.