Skip to content

Commit 1a98499

Browse files
Create R script to build the Job table with valid data
1 parent f2ef35a commit 1a98499

File tree

2 files changed

+85
-1
lines changed

2 files changed

+85
-1
lines changed

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,10 @@ vignettes/*.pdf
4646
docs/
4747

4848
# translation temp files
49-
po/*~
49+
po/*~
50+
51+
# Files to be deleted, but not immediately
52+
Deprecated/
53+
54+
# SQL Files used just for experimenting
55+
/code/SQL/SQL Examples/
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
library(tibble)
2+
library(dplyr)
3+
4+
jobs_guids <- c(
5+
"75db0af2-ef36-4c9d-a7c1-0549eb3e24e9",
6+
"2ee639aa-035a-4dfe-a3ed-e11d5a4b6a30",
7+
"adc12833-475e-4027-8fe8-d7845381b867",
8+
"caa7ba66-f120-45fb-808f-2e0e16aae2bc",
9+
"5f6cdd10-de9c-430a-9143-45b79eba7e44",
10+
"9347dea5-fcfa-48e1-8efd-af486d0fe575",
11+
"f36be466-2b5b-4404-a864-8de1dea27f10",
12+
"240fecb7-b6eb-4f33-b526-ba65cc097c43"
13+
)
14+
15+
employee_guids <- c(
16+
"1d1ca01f-1ada-4463-817b-79e15ffd9875",
17+
"d0d46dba-e96e-4401-b4d9-d8c8c3e7119e",
18+
"13ef8f03-daa0-46a0-8b66-720ea84bc12f",
19+
"5908c141-12d1-4ff5-9f8f-12c1ef71f430",
20+
"88f9ddd6-cfa1-4201-9268-4c0dcff9c017",
21+
"d9537cf4-02a6-4900-805c-cd214a31a6e8",
22+
"baa94efd-fea0-4065-b0f1-98cd1a74a8bf",
23+
"e6878e0a-a8b9-40cc-b73b-530096c7401d"
24+
)
25+
26+
position_guids <- c(
27+
"0550f13e-76d0-4b8e-99bf-fb3f16429f9b",
28+
"5b22cf08-a93e-4457-a869-203cc1e6370e",
29+
"5781d41f-cc64-469b-aba8-637b0204a096",
30+
"041ce313-3b4e-40ca-bcc7-4ba348a60d85",
31+
"b8121811-ca23-4209-a981-20651ec16200",
32+
"df4e534f-82e7-46b2-be90-5829e26eb5bb",
33+
"db7e3090-38bc-49bd-803c-d047be20600c",
34+
"7325831e-7701-42d7-87a0-bdc144cf0558",
35+
"e1b37547-5899-46cd-8af5-2bcf421d0a43"
36+
)
37+
38+
company_guids <- c(
39+
"4c948630-bce9-4aae-ae6d-9898f3539dab",
40+
"78bffbd2-c6db-441f-b981-f92813e1791b",
41+
"ab447037-2255-4882-826b-56f598baba71",
42+
"5a2d1bf8-9367-4f07-9643-64e08dd0e874",
43+
"38a41864-38b6-4a28-b742-5f5ecfe6ad17"
44+
)
45+
46+
lst_comp_pos_guids <- list(
47+
company_guid = company_guids,
48+
position_guid = position_guids
49+
)
50+
51+
tib_all_comp_pos_guids <- as_tibble(
52+
expand.grid(
53+
lst_comp_pos_guids,
54+
stringsAsFactors = FALSE,
55+
KEEP.OUT.ATTRS = FALSE
56+
)
57+
)
58+
59+
jobs <- tibble(
60+
guid = jobs_guids,
61+
company_guid = character(length(employee_guids)),
62+
position_guid = character(length(employee_guids)),
63+
employee_guid = employee_guids
64+
)
65+
66+
set.seed(10852)
67+
68+
tib_rand_comp_pos_combos <- slice_sample(
69+
tib_all_comp_pos_guids,
70+
n = nrow(jobs),
71+
replace = TRUE
72+
)
73+
74+
jobs$company_guid <- tib_rand_comp_pos_combos$company_guid
75+
jobs$position_guid <- tib_rand_comp_pos_combos$position_guid
76+
77+
write.csv(as.data.frame(jobs), "clipboard", row.names = FALSE)
78+

0 commit comments

Comments
 (0)