JuliaStats / RDatasets.jl

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

'dataset' suddenly stopped working with 'ISLR' #117

Open compleathorseplayer opened 3 years ago

compleathorseplayer commented 3 years ago

I teach a class using ISLR, helped by the RDatasets package, which has worked fine this semester so far, until in the past few days, it suddenly stopped working for my students. For all the invocations of

datasets("ISLR","<dataset>")

They are getting

Error encountered while load FileIO.File{.....   
Fatal error....
load not defined

I emphasise that these were scripts that worked fine before, and suddenly just stopped working.

Does anyone have any ideas as to why this might be happening and how one might fix it?

elrond3000 commented 3 years ago

I suppose I have a similar problem. I tried to execute iris = dataset("datasets", "iris") just after add RDatasets and the same error appear.

Error encountered while load FileIO.File{FileIO.DataFormat{:GZIP},String}("/home/elrond/.julia/packages/RDatasets/99YUH/src/../data/datasets/iris.rda").

Fatal error:
ERROR: UndefVarError: load not defined

but neuro = dataset("boot", "neuro") works well. Here is my versioninfo() output

Julia Version 1.5.3
Commit 788b2c77c1 (2020-11-09 13:37 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
  JULIA_PKG_SERVER = https://mirrors.tuna.tsinghua.edu.cn/julia
compleathorseplayer commented 3 years ago

Thanks. Students seem to suddenly have this problem even on (ISLR) datasets which have previously worked fine with exactly the same syntax

devmotion commented 3 years ago

I assume this is caused by FileIO 1.6.0 which was a major rewrite of FileIO (but supposed to be non-breaking - maybe RDatasets uses some internals of FileIO?). Downgrading to FileIO 1.5 fixed e.g. problems with CairoMakie for me (https://github.com/JuliaPlots/Makie.jl/issues/864).

torfjelde commented 3 years ago

Can confirm your solution works @devmotion :heart:

devmotion commented 3 years ago

BTW since I haven't investigated what the actual problem is I am not sure if it is a problem of RDatasets or rather of RData.

devmotion commented 3 years ago

The error message that I get when running the iris example is similar to https://github.com/JuliaData/RData.jl/issues/57 - maybe it's related to the gzip problem mentioned therein? Maybe uncompressed datasets work fine with FileIO 1.6 but compressed ones stopped working?

timholy commented 3 years ago

Really sorry about this, and especially about messing up your class, @compleathorseplayer. Calling it FileIO 1.6 rather than FileIO 2.0 seems to be one of the biggest Julia mistakes I've ever made. I thought I had so cleverly made the rewrite backwards-compatible.

This should be fixed in FileIO 1.6.1. For the interested, there's a more detailed explanation in https://github.com/JuliaIO/FileIO.jl/pull/308#issue-586215132. That said, the solution in #119 is worth considering independently on its own merits.

compleathorseplayer commented 3 years ago

Thanks, Tim. If students re-install RDatasets, will this automatically be fixed now? If not (assuming some of them are barely computer-literate) what is the easiest way to fix this?

timholy commented 3 years ago

All they should have to do is pkg> up. If it upgrades to FileIO 1.6.1, all is good.

compleathorseplayer commented 3 years ago

Thanks for that. I don't know if they want to upgrade everything (at this point, I don't want to risk other new bugs!). How do they just upgrade this package?

timholy commented 3 years ago

I can understand that! :sweat_smile:

Nominally Pkg.update(pkgname) should work, but for me it usually seems to update lots of things, not just what I asked for. I'm not sure what's going on there, that might merit a specific inquiry.