Skip to content

Commit

Permalink
Consistent column names
Browse files Browse the repository at this point in the history
  • Loading branch information
garborg committed Apr 9, 2015
1 parent 59d4e94 commit 7be4d66
Show file tree
Hide file tree
Showing 20 changed files with 14 additions and 5 deletions.
Binary file modified data/Ecdat/Klein.csv.gz
Binary file not shown.
Binary file modified data/ISLR/Auto.rda
Binary file not shown.
Binary file modified data/ISLR/College.rda
Binary file not shown.
Binary file modified data/ISLR/Default.rda
Binary file not shown.
Binary file modified data/ISLR/Wage.rda
Binary file not shown.
Binary file modified data/MASS/abbey.csv.gz
Binary file not shown.
Binary file modified data/MASS/chem.csv.gz
Binary file not shown.
Binary file modified data/MASS/galaxies.csv.gz
Binary file not shown.
Binary file modified data/MASS/newcomb.csv.gz
Binary file not shown.
Binary file modified data/car/Bfox.csv.gz
Binary file not shown.
Binary file modified data/cluster/votes.repub.csv.gz
Binary file not shown.
Binary file modified data/datasets/USPersonalExpenditure.csv.gz
Binary file not shown.
Binary file modified data/datasets/precip.csv.gz
Binary file not shown.
Binary file modified data/datasets/rivers.csv.gz
Binary file not shown.
Binary file modified data/robustbase/cushny.csv.gz
Binary file not shown.
Binary file modified data/robustbase/wagnerGrowth.rda
Binary file not shown.
Binary file modified data/rpart/solder.rda
Binary file not shown.
Binary file modified data/vcd/Hospital.csv.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion doc/datasets.csv
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
"ISLR","Auto","Auto Data Set",392,9
"ISLR","Caravan","The Insurance Company (TIC) Benchmark",5822,86
"ISLR","Carseats","Sales of Child Car Seats",400,11
"ISLR","College","U.S. News and World Report's College Data",777,18
"ISLR","College","U.S. News and World Report's College Data",777,19
"ISLR","Default","Credit Card Default Data",10000,4
"ISLR","Hitters","Baseball Data",322,20
"ISLR","OJ","Orange Juice Data",1070,18
Expand Down
17 changes: 13 additions & 4 deletions test/dataset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ module TestDataset
using Base.Test
using RDatasets

function badname(sym)
n = string(sym)
ismatch(r"^[a-z]", n) || contains(n, ".")
end
goodname(sym) = ismatch(r"^([_xA-Z]|pH|pK)", string(sym))

package_directory = joinpath(dirname(@__FILE__), "..", "data")

Expand All @@ -21,5 +18,17 @@ module TestDataset
println("Package: $pkg Dataset: $ds -")
@test size(df) == recorded_size
end

if !all(map(goodname, names(df)))

println("Package: $pkg Dataset: $ds -")
println("Names: ", names(df))
throw(ErrorException("""
Column names should be match what 'readtable' would produce,
except words should be 'UpperCamelCase' (acronyms uppercase), &
'_' used only where two acronyms or two numbers would be concatenated.
"""))
end
end
end

0 comments on commit 7be4d66

Please sign in to comment.