Skip to content

Commit 56ca04b

Browse files
committed
add additional expression of FoR-classification
1 parent d111266 commit 56ca04b

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

server/preprocessing/other-scripts/subject_cleaning.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,12 @@ drop_not_elsewhere_classified <- function(keywords) {
125125
}
126126

127127
drop_for <- function(keywords) {
128-
# ANZSRC Fields of Research, three serialisations:
129-
# "01 Mathematical Sciences (for)", "38 Economics (for-2020)", "FoR 03 (Chemical Sciences)".
128+
# ANZSRC Fields of Research, serialisations seen in the data:
129+
# "01 Mathematical Sciences (for)", "38 Economics (for-2020)", "FoR 03 (Chemical Sciences)",
130+
# "anzsrc-for: 3402 Inorganic Chemistry".
130131
# The FoR-prefix form requires a letter after "(" so a stray "... (89.8%)" is not matched.
131-
keywords[!grepl("\\(for(-2020)?\\)\\s*$|^FoR [0-9]+ \\([A-Za-z]", keywords, ignore.case = TRUE)]
132+
keywords[!grepl("\\(for(-2020)?\\)\\s*$|^FoR [0-9]+ \\([A-Za-z]|^anzsrc-for ?: ?[0-9]+",
133+
keywords, ignore.case = TRUE)]
132134
}
133135

134136
drop_hrcs <- function(keywords) {

server/preprocessing/other-scripts/test/test_subject_cleaning.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,13 @@ test_that("rcdc keywords are dropped", {
7171
test_that("'not elsewhere classified' keywords are dropped", {
7272
drops_to_cooperation("Biological Sciences not elsewhere classified")
7373
})
74-
test_that("FoR keywords are dropped (all three serialisations)", {
74+
test_that("FoR keywords are dropped (all serialisations)", {
7575
drops_to_cooperation("01 Mathematical Sciences (for)")
7676
drops_to_cooperation("38 Economics (for-2020)")
7777
drops_to_cooperation("FoR 03 (Chemical Sciences)")
78+
drops_to_cooperation("anzsrc-for: 3402 Inorganic Chemistry")
79+
drops_to_cooperation("anzsrc-for: 34 Chemical Sciences")
80+
drops_to_cooperation("anzsrc-for: 03 Chemical Sciences")
7881
})
7982
test_that("hrcs keywords are dropped", {
8083
drops_to_cooperation("2.1 Biological and endogenous factors (hrcs-rac)")

0 commit comments

Comments
 (0)