Skip to content

Commit

Permalink
Merge pull request #129 from dfe-analytical-services/update-urls-anal…
Browse files Browse the repository at this point in the history
…ysts-guide

Update guidance URLs
  • Loading branch information
cjrace committed Aug 16, 2024
2 parents ec27663 + 8624593 commit 863b853
Show file tree
Hide file tree
Showing 5 changed files with 185 additions and 193 deletions.
6 changes: 3 additions & 3 deletions R/fileValidation.r
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,18 @@ file_separator <- function(data, meta) {
if ((grepl(",", data) == FALSE) && (grepl(",", meta) == FALSE)) {
output <- list(
"result" = "FAIL",
"message" = paste0("Neither of the data and metadata files appear to be using a comma delimited structure. <br> - See the ", "<a href='https://rsconnect/rsc/stats-production-guidance/ud.html#data_format' target='_blank'>guidance on how to save the files</a>", " if you are unsure.")
"message" = paste0("Neither of the data and metadata files appear to be using a comma delimited structure. <br> - See the ", "<a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#data-format' target='_blank'>guidance on data formats</a> and <a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#how-to-export-data-with-utf-8-encoding' target='_blank'>guidance how to save data files in the right format</a>", " if you are unsure.")
)
} else {
if (grepl(",", meta)) {
output <- list(
"result" = "FAIL",
"message" = paste0("The data file does not appear to be using a comma delimited structure. <br> - See the ", "<a href='https://rsconnect/rsc/stats-production-guidance/ud.html#data_format' target='_blank'>guidance on how to save the files</a>", " if you are unsure.")
"message" = paste0("The data file does not appear to be using a comma delimited structure. <br> - See the ", "<a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#data-format' target='_blank'>guidance on how to save the files</a>", " if you are unsure.")
)
} else {
output <- list(
"result" = "FAIL",
"message" = paste0("The metadata file does not appear to be using a comma delimited structure. <br> - See the ", "<a href='https://rsconnect/rsc/stats-production-guidance/ud.html#data_format' target='_blank'>guidance on how to save the files</a>", " if you are unsure.")
"message" = paste0("The metadata file does not appear to be using a comma delimited structure. <br> - See the ", "<a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#data-format' target='_blank'>guidance on how to save the files</a>", " if you are unsure.")
)
}
}
Expand Down
16 changes: 8 additions & 8 deletions R/mainTests.r
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ variable_characteristic <- function(meta) {
"message" = paste(
"The fields characteristic and/or characteristic_group have been included in the data.",
"These are not recommended for use with the EES Table Tool.",
"Please refer to the <a href='https://rsconnect/rsc/stats-production-guidance/ud.html#Introduction_to_filters'>guidance pages on filters</a>."
"Please refer to the <a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#introduction-to-filters'>guidance pages on filters</a>."
),
"result" = "ADVISORY"
)
Expand Down Expand Up @@ -639,7 +639,7 @@ time_period <- function(data) {
if (base_identifier %in% four_digit_identifiers) {
if ((nrow(filter(time_length, digits == 4)) == nrow(time_length)) == FALSE) {
output <- list(
"message" = paste0("The time_period length for '", paste(base_identifier), "' must always be a four digit number. <br> - Please check the ", "<a href='https://rsconnect/rsc/stats-production-guidance/ud.html#list_of_allowable_time_values' target='_blank'>guidance website</a> if you are unsure."),
"message" = paste0("The time_period length for '", paste(base_identifier), "' must always be a four digit number. <br> - Please check the ", "<a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#list-of-allowable-time-values' target='_blank'>guidance website</a> if you are unsure."),
"result" = "FAIL"
)
} else {
Expand All @@ -653,7 +653,7 @@ time_period <- function(data) {
if (base_identifier %in% six_digit_identifiers) {
if ((nrow(filter(time_length, digits == 6)) == nrow(time_length)) == FALSE) {
output <- list(
"message" = paste0("The time_period length for '", paste(base_identifier), "' must always be a six digit number. <br> - Please check the ", "<a href='https://rsconnect/rsc/stats-production-guidance/ud.html#list_of_allowable_time_values' target='_blank'>guidance website</a> if you are unsure."),
"message" = paste0("The time_period length for '", paste(base_identifier), "' must always be a six digit number. <br> - Please check the ", "<a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#list-of-allowable-time-values' target='_blank'>guidance website</a> if you are unsure."),
"result" = "FAIL"
)
} else {
Expand Down Expand Up @@ -850,7 +850,7 @@ geography_level_completed <- function(data) {
output <- list(
"message" = paste0(
"The following columns should be completed for all rows of the associated level that they refer to: <br> - '", paste0(incomplete_geographies, collapse = "', '"), "' . <br> - If you are unsure of the levels that they refer to, please check the ",
"<a href='https://rsconnect/rsc/stats-production-guidance/ud.html#allowable_geographic_levels' target='_blank'>allowable geographic values table</a>."
"<a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#allowable-geographic-levels' target='_blank'>allowable geographic values table</a>."
),
"result" = "FAIL"
)
Expand Down Expand Up @@ -2645,7 +2645,7 @@ ethnicity_values <- function(data) {
"message" = paste0(
"The ethnicity filter ", value_type, " '",
paste(ethnicity_nonstandard, collapse = "', '"),
"' does not conform to the GSS standards. Please cross check against the <a href='https://rsconnect/rsc/stats-production-guidance/ud.html#Ethnicity'>published standards</a>."
"' does not conform to the GSS standards. Please cross check against the <a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#ethnicity'>published standards</a>."
),
"result" = "ADVISORY"
)
Expand All @@ -2654,7 +2654,7 @@ ethnicity_values <- function(data) {
"message" = paste0(
"The following ethnicity filter ", value_type, "s do not conform to the GSS standards: <br> - '",
paste(ethnicity_nonstandard, collapse = "', '"),
"'. <br> - Please cross check against the <a href='https://rsconnect/rsc/stats-production-guidance/ud.html#Ethnicity'>published standards</a>."
"'. <br> - Please cross check against the <a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#ethnicity'>published standards</a>."
),
"result" = "ADVISORY"
)
Expand Down Expand Up @@ -2730,7 +2730,7 @@ ethnicity_characteristic_values <- function(data) {
"message" = paste0(
"The ethnicity filter value '",
paste(ethnicity_nonstandard, collapse = "', '"),
"' does not conform to the GSS standards. Please cross check against the <a href='https://rsconnect/rsc/stats-production-guidance/ud.html#Ethnicity'>published standards</a>."
"' does not conform to the GSS standards. Please cross check against the <a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#ethnicity'>published standards</a>."
),
"result" = "ADVISORY"
)
Expand All @@ -2739,7 +2739,7 @@ ethnicity_characteristic_values <- function(data) {
"message" = paste0(
"The following ethnicity filter values do not conform to the GSS standards: <br> - '",
paste(ethnicity_nonstandard, collapse = "', '"),
"'. <br> - Please cross check against the <a href='https://rsconnect/rsc/stats-production-guidance/ud.html#Ethnicity'>published standards</a>."
"'. <br> - Please cross check against the <a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#ethnicity'>published standards</a>."
),
"result" = "ADVISORY"
)
Expand Down
8 changes: 4 additions & 4 deletions R/preCheck2.r
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ time_identifier_mix <- function(data) {

if (any(is.na(factor(unique(data$time_identifier), base_level))) == TRUE) {
output <- list(
"message" = paste0("The datafile is mixing incompatable time identifiers. <br> - Allowable values with '", paste(base_identifier), "' present, are: '", paste(base_level, collapse = "', '"), "'. <br> - See the <a href='https://rsconnect/rsc/stats-production-guidance/ud.html#list_of_allowable_time_values' target='_blank'>guidance on time values</a> if you are unsure."),
"message" = paste0("The datafile is mixing incompatable time identifiers. <br> - Allowable values with '", paste(base_identifier), "' present, are: '", paste(base_level, collapse = "', '"), "'. <br> - See the <a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#list-of-allowable-time-values' target='_blank'>guidance on time values</a> if you are unsure."),
"result" = "FAIL"
)
} else {
Expand Down Expand Up @@ -259,18 +259,18 @@ utf8 <- function(data, meta) {
} else {
if (number_data_invalid > 0 && number_meta_invalid > 0) {
output <- list(
"message" = paste0("Neither of the data and metadata files are using UTF-8 encoding. <br> - See the ", "<a href='https://rsconnect/rsc/stats-production-guidance/ud.html#data_format' target='_blank'>guidance on how to do this</a>", " if you are unsure."),
"message" = paste0("Neither of the data and metadata files are using UTF-8 encoding. <br> - See the ", "<a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#list-of-allowable-time-values' target='_blank'>guidance on how to do this</a>", " if you are unsure."),
"result" = "FAIL"
)
} else {
if (number_data_invalid > 0) {
output <- list(
"message" = paste0("The data file is not using UTF-8 encoding. <br> - See the ", "<a href='https://rsconnect/rsc/stats-production-guidance/ud.html#data_format' target='_blank'>guidance on how to do this</a>", " if you are unsure."),
"message" = paste0("The data file is not using UTF-8 encoding. <br> - See the ", "<a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#list-of-allowable-time-values' target='_blank'>guidance on how to do this</a>", " if you are unsure."),
"result" = "FAIL"
)
} else {
output <- list(
"message" = paste0("The metadata file is not using UTF-8 encoding. <br> - See the ", "<a href='https://rsconnect/rsc/stats-production-guidance/ud.html#data_format' target='_blank'>guidance on how to do this</a>", " if you are unsure."),
"message" = paste0("The metadata file is not using UTF-8 encoding. <br> - See the ", "<a href='https://dfe-analytical-services.github.io/analysts-guide/statistics-production/ud.html#list-of-allowable-time-values' target='_blank'>guidance on how to do this</a>", " if you are unsure."),
"result" = "FAIL"
)
}
Expand Down
Loading

0 comments on commit 863b853

Please sign in to comment.