From 8d0349d1122e3a11bd95813545ece877f948eb7a Mon Sep 17 00:00:00 2001 From: David Widmann Date: Sat, 6 Mar 2021 23:59:23 +0100 Subject: [PATCH 1/4] Specify file format explicitly --- src/RDatasets.jl | 2 +- src/dataset.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RDatasets.jl b/src/RDatasets.jl index 69d94c2..547b300 100644 --- a/src/RDatasets.jl +++ b/src/RDatasets.jl @@ -3,7 +3,7 @@ module RDatasets @eval Base.Experimental.@optlevel 1 end - using Reexport, RData, CSV, CodecZlib + using Reexport, FileIO, CSV, CodecZlib @reexport using DataFrames export dataset diff --git a/src/dataset.jl b/src/dataset.jl index 494fe00..b47a9f7 100644 --- a/src/dataset.jl +++ b/src/dataset.jl @@ -9,7 +9,7 @@ function dataset(package_name::AbstractString, dataset_name::AbstractString) rdaname = joinpath(basename, string(dataset_name, ".rda")) if isfile(rdaname) - return load(rdaname)[dataset_name] + return load(File{format"RData"}(rdaname))[dataset_name] end csvname = joinpath(basename, string(dataset_name, ".csv.gz")) From 9700523a0095875ae6335e29d5df23e9690bf9dd Mon Sep 17 00:00:00 2001 From: David Widmann Date: Sat, 6 Mar 2021 23:59:48 +0100 Subject: [PATCH 2/4] Remove Printf --- Project.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Project.toml b/Project.toml index e73ca37..bf85695 100644 --- a/Project.toml +++ b/Project.toml @@ -7,7 +7,6 @@ CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" -Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" RData = "df47a6cb-8c03-5eed-afd8-b6050d6c41da" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" From 47b34c22ab59dd7f3441493216bcd38da4e331ec Mon Sep 17 00:00:00 2001 From: David Widmann Date: Sat, 6 Mar 2021 23:59:58 +0100 Subject: [PATCH 3/4] Bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index bf85695..f7c01e0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "RDatasets" uuid = "ce6b1742-4840-55fa-b093-852dadbb1d8b" -version = "0.7.4" +version = "0.7.5" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" From 0f0ad9f5aadc5c082972dc265b3d15770536d657 Mon Sep 17 00:00:00 2001 From: David Widmann Date: Mon, 8 Mar 2021 11:22:53 +0100 Subject: [PATCH 4/4] Update src/dataset.jl --- src/dataset.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/dataset.jl b/src/dataset.jl index b47a9f7..8cd8368 100644 --- a/src/dataset.jl +++ b/src/dataset.jl @@ -9,7 +9,13 @@ function dataset(package_name::AbstractString, dataset_name::AbstractString) rdaname = joinpath(basename, string(dataset_name, ".rda")) if isfile(rdaname) - return load(File{format"RData"}(rdaname))[dataset_name] + if isdefined(FileIO, :action) + # FileIO >= 1.6 + return load(File{format"RData"}(rdaname))[dataset_name] + else + # FileIO < 1.6 + return load(File(format"RData", rdaname))[dataset_name] + end end csvname = joinpath(basename, string(dataset_name, ".csv.gz"))