Add missing script generation for small_salary dataset
This commit is contained in:
Родитель
44da15a1e2
Коммит
c68b5501bc
|
@ -0,0 +1,5 @@
|
|||
library(readr)
|
||||
|
||||
small_salary <- read_csv(here::here("data-raw", "small_salary.csv"))
|
||||
|
||||
usethis::use_data(small_salary, overwrite = TRUE)
|
|
@ -0,0 +1,101 @@
|
|||
Degree,Work,Salary
|
||||
Masters,Academia,81.94450138369575
|
||||
PhD,Academia,84.48683335236274
|
||||
Masters,Academia,82.89530056482181
|
||||
PhD,Academia,83.84691398846917
|
||||
PhD,Academia,83.75313821574673
|
||||
PhD,Academia,85.26832443126477
|
||||
PhD,Industry,91.40521181118675
|
||||
PhD,Academia,85.33091764966957
|
||||
Masters,Academia,83.26561724720523
|
||||
PhD,Industry,92.34894080343656
|
||||
Masters,Academia,82.89954726654105
|
||||
PhD,Academia,84.73846479947679
|
||||
Masters,Industry,90.18779113679193
|
||||
Masters,Industry,90.31389033375308
|
||||
Masters,Industry,90.33657557494007
|
||||
Masters,Industry,89.68851578235626
|
||||
Masters,Industry,89.657391943736
|
||||
Masters,Industry,89.81031844741665
|
||||
PhD,Academia,85.00685522030108
|
||||
Masters,Industry,90.14455051301047
|
||||
Masters,Industry,90.25970029272139
|
||||
PhD,Academia,85.16300668986514
|
||||
Masters,Industry,89.58072764403187
|
||||
PhD,Academia,85.37737160664983
|
||||
PhD,Academia,85.0828845105134
|
||||
Masters,Industry,91.47756954631768
|
||||
Masters,Industry,90.54214000562206
|
||||
Masters,Industry,90.95082530193031
|
||||
Masters,Academia,84.32561727589928
|
||||
Masters,Industry,90.76082284515724
|
||||
Masters,Industry,91.21495885658078
|
||||
Masters,Industry,91.48115599853918
|
||||
Masters,Industry,91.20350587111898
|
||||
Masters,Academia,84.14068312523887
|
||||
Masters,Industry,90.90009946771897
|
||||
Masters,Industry,91.34475201112218
|
||||
Masters,Industry,90.6169246234931
|
||||
Masters,Industry,91.17985331243835
|
||||
Masters,Industry,91.24937468231656
|
||||
Masters,Industry,91.40493377088569
|
||||
Masters,Industry,91.1165353488177
|
||||
Masters,Industry,91.10686429939233
|
||||
PhD,Academia,86.0538539250847
|
||||
Masters,Industry,90.67042803671211
|
||||
Masters,Industry,91.46984667144716
|
||||
Masters,Industry,91.05790561670437
|
||||
PhD,Industry,93.16026216419414
|
||||
PhD,Academia,85.91064599249512
|
||||
PhD,Industry,93.40985550289042
|
||||
Masters,Industry,90.94344162987545
|
||||
Masters,Industry,91.1740557027515
|
||||
PhD,Academia,86.04063351545483
|
||||
PhD,Industry,93.05706270388328
|
||||
Masters,Industry,91.24015223653987
|
||||
Masters,Industry,90.50113883288577
|
||||
Masters,Academia,85.33032013499178
|
||||
Masters,Industry,90.60402934253216
|
||||
Masters,Academia,85.49514183099382
|
||||
Masters,Industry,91.40050469245762
|
||||
Masters,Industry,91.14769996097311
|
||||
Masters,Industry,90.70458788215183
|
||||
Masters,Industry,90.61883719847538
|
||||
Masters,Industry,90.56335103302263
|
||||
Masters,Industry,90.59819543571211
|
||||
Masters,Industry,91.17003402672708
|
||||
Masters,Industry,90.74728795373812
|
||||
PhD,Academia,86.44472820917144
|
||||
Masters,Industry,92.01611478556879
|
||||
Masters,Industry,92.28194353799336
|
||||
Masters,Industry,91.52015182306059
|
||||
Masters,Industry,92.24062326690182
|
||||
PhD,Industry,92.7338204937987
|
||||
PhD,Academia,86.36788870207965
|
||||
Masters,Academia,84.54085364961065
|
||||
Masters,Industry,91.61614312464371
|
||||
Masters,Industry,92.04146937443875
|
||||
Masters,Industry,92.29214980686083
|
||||
Masters,Industry,91.69815122988075
|
||||
Masters,Industry,91.8960476492066
|
||||
Masters,Industry,92.41877216659486
|
||||
PhD,Academia,87.04902912862599
|
||||
Masters,Industry,91.8766731780488
|
||||
Masters,Industry,92.38043254078366
|
||||
Masters,Industry,92.17296759225428
|
||||
PhD,Industry,93.16009169165045
|
||||
Masters,Industry,92.1522822889965
|
||||
Masters,Academia,85.46124948980287
|
||||
Masters,Industry,92.19455609074794
|
||||
PhD,Academia,86.68271354306489
|
||||
Masters,Industry,91.55971896206029
|
||||
Masters,Industry,91.99221259285696
|
||||
Masters,Industry,92.46854129247367
|
||||
PhD,Industry,93.70305993850343
|
||||
PhD,Academia,87.43917947425507
|
||||
Masters,Industry,91.98929925682023
|
||||
Masters,Industry,91.99563476326875
|
||||
Masters,Industry,92.30848569469526
|
||||
Masters,Industry,91.74357159482315
|
||||
PhD,Industry,93.83377221622504
|
||||
PhD,Industry,94.0215112566948
|
|
Двоичный файл не отображается.
|
@ -49,8 +49,8 @@ test_that("Results are identical when data is contained in first function versus
|
|||
})
|
||||
|
||||
test_that("Results are identical regardless of whether summary operation is named or not", {
|
||||
summary_named <- datamation_sanddance("small_salary_data %>% summarize(mean = mean(Salary))")
|
||||
summary_not_named <- datamation_sanddance("small_salary_data %>% summarize(mean(Salary))")
|
||||
summary_named <- datamation_sanddance("small_salary %>% summarize(mean = mean(Salary))")
|
||||
summary_not_named <- datamation_sanddance("small_salary %>% summarize(mean(Salary))")
|
||||
|
||||
expect_identical(summary_named, summary_not_named)
|
||||
})
|
||||
|
|
|
@ -20,14 +20,14 @@ test_that("split_pipeline can split code across multiple lines", {
|
|||
})
|
||||
|
||||
test_that("split_pipeline can handle the data being contained in the first function, and splits it out properly into its own step", {
|
||||
sp <- split_pipeline("group_by(small_salary_data, Degree, Work)")
|
||||
expect_identical(sp, c("small_salary_data", "group_by( Degree, Work)"))
|
||||
sp <- split_pipeline("group_by(small_salary, Degree, Work)")
|
||||
expect_identical(sp, c("small_salary", "group_by( Degree, Work)"))
|
||||
|
||||
sp <- split_pipeline("group_by(small_salary_data, Degree) %>% summarise(mean = mean(x))")
|
||||
expect_identical(sp, c("small_salary_data", "group_by( Degree)", "summarise(mean = mean(x))"))
|
||||
sp <- split_pipeline("group_by(small_salary, Degree) %>% summarise(mean = mean(x))")
|
||||
expect_identical(sp, c("small_salary", "group_by( Degree)", "summarise(mean = mean(x))"))
|
||||
|
||||
sp <- split_pipeline("summarise(small_salary_data, mean = mean(x))")
|
||||
expect_identical(sp, c("small_salary_data", "summarise( mean = mean(x))"))
|
||||
sp <- split_pipeline("summarise(small_salary, mean = mean(x))")
|
||||
expect_identical(sp, c("small_salary", "summarise( mean = mean(x))"))
|
||||
})
|
||||
|
||||
test_that("split_pipeline can handle data in first function, when data is namespaced from package", {
|
||||
|
|
Загрузка…
Ссылка в новой задаче