Add missing script generation for small_salary dataset

This commit is contained in:
Sharla Gelfand 2021-05-17 11:04:34 -04:00
Родитель 44da15a1e2
Коммит c68b5501bc
5 изменённых файлов: 114 добавлений и 8 удалений

5
data-raw/small_salary.R Normal file
Просмотреть файл

@ -0,0 +1,5 @@
library(readr)
small_salary <- read_csv(here::here("data-raw", "small_salary.csv"))
usethis::use_data(small_salary, overwrite = TRUE)

101
data-raw/small_salary.csv Normal file
Просмотреть файл

@ -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
1 Degree Work Salary
2 Masters Academia 81.94450138369575
3 PhD Academia 84.48683335236274
4 Masters Academia 82.89530056482181
5 PhD Academia 83.84691398846917
6 PhD Academia 83.75313821574673
7 PhD Academia 85.26832443126477
8 PhD Industry 91.40521181118675
9 PhD Academia 85.33091764966957
10 Masters Academia 83.26561724720523
11 PhD Industry 92.34894080343656
12 Masters Academia 82.89954726654105
13 PhD Academia 84.73846479947679
14 Masters Industry 90.18779113679193
15 Masters Industry 90.31389033375308
16 Masters Industry 90.33657557494007
17 Masters Industry 89.68851578235626
18 Masters Industry 89.657391943736
19 Masters Industry 89.81031844741665
20 PhD Academia 85.00685522030108
21 Masters Industry 90.14455051301047
22 Masters Industry 90.25970029272139
23 PhD Academia 85.16300668986514
24 Masters Industry 89.58072764403187
25 PhD Academia 85.37737160664983
26 PhD Academia 85.0828845105134
27 Masters Industry 91.47756954631768
28 Masters Industry 90.54214000562206
29 Masters Industry 90.95082530193031
30 Masters Academia 84.32561727589928
31 Masters Industry 90.76082284515724
32 Masters Industry 91.21495885658078
33 Masters Industry 91.48115599853918
34 Masters Industry 91.20350587111898
35 Masters Academia 84.14068312523887
36 Masters Industry 90.90009946771897
37 Masters Industry 91.34475201112218
38 Masters Industry 90.6169246234931
39 Masters Industry 91.17985331243835
40 Masters Industry 91.24937468231656
41 Masters Industry 91.40493377088569
42 Masters Industry 91.1165353488177
43 Masters Industry 91.10686429939233
44 PhD Academia 86.0538539250847
45 Masters Industry 90.67042803671211
46 Masters Industry 91.46984667144716
47 Masters Industry 91.05790561670437
48 PhD Industry 93.16026216419414
49 PhD Academia 85.91064599249512
50 PhD Industry 93.40985550289042
51 Masters Industry 90.94344162987545
52 Masters Industry 91.1740557027515
53 PhD Academia 86.04063351545483
54 PhD Industry 93.05706270388328
55 Masters Industry 91.24015223653987
56 Masters Industry 90.50113883288577
57 Masters Academia 85.33032013499178
58 Masters Industry 90.60402934253216
59 Masters Academia 85.49514183099382
60 Masters Industry 91.40050469245762
61 Masters Industry 91.14769996097311
62 Masters Industry 90.70458788215183
63 Masters Industry 90.61883719847538
64 Masters Industry 90.56335103302263
65 Masters Industry 90.59819543571211
66 Masters Industry 91.17003402672708
67 Masters Industry 90.74728795373812
68 PhD Academia 86.44472820917144
69 Masters Industry 92.01611478556879
70 Masters Industry 92.28194353799336
71 Masters Industry 91.52015182306059
72 Masters Industry 92.24062326690182
73 PhD Industry 92.7338204937987
74 PhD Academia 86.36788870207965
75 Masters Academia 84.54085364961065
76 Masters Industry 91.61614312464371
77 Masters Industry 92.04146937443875
78 Masters Industry 92.29214980686083
79 Masters Industry 91.69815122988075
80 Masters Industry 91.8960476492066
81 Masters Industry 92.41877216659486
82 PhD Academia 87.04902912862599
83 Masters Industry 91.8766731780488
84 Masters Industry 92.38043254078366
85 Masters Industry 92.17296759225428
86 PhD Industry 93.16009169165045
87 Masters Industry 92.1522822889965
88 Masters Academia 85.46124948980287
89 Masters Industry 92.19455609074794
90 PhD Academia 86.68271354306489
91 Masters Industry 91.55971896206029
92 Masters Industry 91.99221259285696
93 Masters Industry 92.46854129247367
94 PhD Industry 93.70305993850343
95 PhD Academia 87.43917947425507
96 Masters Industry 91.98929925682023
97 Masters Industry 91.99563476326875
98 Masters Industry 92.30848569469526
99 Masters Industry 91.74357159482315
100 PhD Industry 93.83377221622504
101 PhD Industry 94.0215112566948

Двоичные данные
data/small_salary.rda Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -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", {