Skip to content

Commit

Permalink
Allow datasets with a .RData extension as well as .rda
Browse files Browse the repository at this point in the history
  • Loading branch information
frankier committed Aug 30, 2022
1 parent 0c5b9e3 commit ebcbfef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/dataset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ const Dataset_typedetect_rows = Dict{Tuple{String, String}, Union{Vector,Dict}}(
function dataset(package_name::AbstractString, dataset_name::AbstractString)
basename = joinpath(@__DIR__, "..", "data", package_name)

rdataname = joinpath(basename, string(dataset_name, ".RData"))
if isfile(rdataname)
return load(rdataname)[dataset_name]
end

rdaname = joinpath(basename, string(dataset_name, ".rda"))
if isfile(rdaname)
return load(rdaname)[dataset_name]
Expand Down
2 changes: 1 addition & 1 deletion src/update_doc.r
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ do_package_update <- function(data_dir, package_df, old_dataset_df, dataset_df,
datasets <- dir(path = file.path(data_dir, package))

# Trim filenames to dataset names
r <- "(.+)\\.(csv\\.gz|rda)$"
r <- "(.+)\\.(csv\\.gz|rda|RData)$"
format_recognized <- grepl(r, datasets)
if (!(all(format_recognized))) {
stop("Unrecognized formats:\n",
Expand Down

0 comments on commit ebcbfef

Please sign in to comment.