You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -46,7 +48,11 @@ check_sibling_order_ram_optimized <- function(data, outcome, pair_identifiers, r
46
48
47
49
# Check if either sibling has missing (NA) outcome data
48
50
if (is.na(outcome1) || is.na(outcome2)) {
49
-
stop(paste0("There are missing data, encoded as `NA`, for at least one kinship pair in the '", outcome, "' variable and data cannot be prepped properly.\n Please remove or impute missing data."))
51
+
stop(paste0(
52
+
"There are missing data, encoded as `NA`, for at least one kinship pair in the '",
53
+
outcome, "' variable and data cannot be prepped properly.\n",
54
+
" Please remove or impute missing data."
55
+
))
50
56
}
51
57
# Determine sibling order
52
58
if (outcome1>outcome2) {
@@ -63,7 +69,7 @@ check_sibling_order_ram_optimized <- function(data, outcome, pair_identifiers, r
stop(paste0("There are missing data, encoded as `NA`, for at least one kinship pair in the '", outcome, "' variable and data cannot be prepped properly.\n Please remove or impute missing data."))
84
+
stop(paste0(
85
+
"There are missing data, encoded as `NA`, for at least one kinship pair in the '",
86
+
outcome, "' variable and data cannot be prepped properly.\n",
#' @description This function calculates differences and means of a given variable for each kinship pair. The order of subtraction and the variables' names in the output dataframe depend on the order column set by check_sibling_order().
100
-
#' If the demographics parameter is set to "race", "sex", or "both", it also prepares demographic information accordingly,
109
+
#' @description This function calculates differences and means of a given variable for each
110
+
#' kinship pair. The order of subtraction and the variables' names in the output dataframe
111
+
#' depend on the order column set by check_sibling_order().
112
+
#' If the demographics parameter is set to "race", "sex", or "both", it also prepares
113
+
#' demographic information accordingly,
101
114
#' swapping the order of demographics as per the order column.
#' @description This function checks for common errors in the provided data, including the correct specification of identifiers (ID, sex, race) and their existence in the data.
373
+
#' @description This function checks for common errors in the provided data, including
374
+
#' the correct specification of identifiers (ID, sex, race) and their existence in the data.
355
375
#'
356
376
#
357
377
#' @param data The data to perform a discord regression on.
if (!base::is.null(sex) &&base::sum(base::grepl(sex, base::names(data))) ==0) {
373
-
stop(paste0("The kinship pair sex identifier \"", sex, "\" is not appropriately defined. Please check that you have the correct column name."))
393
+
stop(paste0(
394
+
"The kinship pair sex identifier \"", sex,
395
+
"\" is not appropriately defined. Please check that you have the correct column name."
396
+
))
374
397
}
375
398
if (!base::is.null(race) &&base::sum(base::grepl(race, base::names(data))) ==0) {
376
-
stop(paste0("The kinship pair race identifier \"", race, "\" is not appropriately defined. Please check that you have the correct column name."))
399
+
stop(paste0(
400
+
"The kinship pair race identifier \"", race,
401
+
"\" is not appropriately defined. Please check that you have the correct column name."
402
+
))
377
403
}
378
-
if (base::sum(base::grepl(pair_identifiers[1], base::names(data))) ==0|base::sum(base::grepl(pair_identifiers[2], base::names(data))) ==0) {
379
-
stop(paste0("Please check that the kinship pair identifiers \"", pair_identifiers[1], "\" and \"", pair_identifiers[2], "\" are valid, i.e. ensure that you have the correct labels for each kin."))
404
+
if (base::sum(base::grepl(pair_identifiers[1], base::names(data))) ==0||
0 commit comments