RDatasets.jl icon indicating copy to clipboard operation
RDatasets.jl copied to clipboard

datasets mtcars error

Open filchristou opened this issue 2 years ago • 0 comments

I was running the Turing turorial in linear regression and I discovered that the following code throws an error:

julia> using RDatasets

julia> data = RDatasets.dataset("datasets", "mtcars");
ERROR: MethodError: Cannot `convert` an object of type 
  Parsers.Result{InlineStrings.String31} to an object of type 
  Parsers.Result{Any}
Closest candidates are:
  convert(::Type{T}, ::T) where T at Base.jl:61
Stacktrace:
  [1] _parseany(T::Type, buf::Vector{UInt8}, pos::Int64, len::Int64, opts::Parsers.Options)
    @ CSV ~/.julia/packages/CSV/jFiCn/src/utils.jl:455
  [2] parsevalue!
    @ ~/.julia/packages/CSV/jFiCn/src/file.jl:810 [inlined]
  [3] parserow
    @ ~/.julia/packages/CSV/jFiCn/src/file.jl:622 [inlined]
  [4] parsefilechunk!(ctx::CSV.Context, pos::Int64, len::Int64, rowsguess::Int64, rowoffset::Int64, columns::Vector{CSV.Column}, #unused#::Type{Tuple{}})
    @ CSV ~/.julia/packages/CSV/jFiCn/src/file.jl:551
  [5] CSV.File(ctx::CSV.Context, chunking::Bool)
    @ CSV ~/.julia/packages/CSV/jFiCn/src/file.jl:291
  [6] File
    @ ~/.julia/packages/CSV/jFiCn/src/file.jl:226 [inlined]
  [7] #File#25
    @ ~/.julia/packages/CSV/jFiCn/src/file.jl:222 [inlined]
  [8] (::RDatasets.var"#3#4"{String, String})(io::IOStream)
    @ RDatasets ~/.julia/packages/RDatasets/fNG6F/src/dataset.jl:19
  [9] open(::RDatasets.var"#3#4"{String, String}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:384
 [10] open
    @ ./io.jl:381 [inlined]
 [11] dataset(package_name::String, dataset_name::String)
    @ RDatasets ~/.julia/packages/RDatasets/fNG6F/src/dataset.jl:17
 [12] top-level scope
    @ REPL[4]:1

tested on RDatasets v0.7.7 and Julia 1.8.1

filchristou avatar Oct 13 '22 09:10 filchristou