Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions R/func_discord_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,25 @@
orderedOnOutcome <- do.call(
rbind,
lapply(
X = 1:nrow(data),
X = seq_len(nrow(data)),
FUN = check_sibling_order,
data = data, outcome = outcome,
pair_identifiers = pair_identifiers
)
)

if (!valid_ids(orderedOnOutcome,
id = id
)) {
id = id
)) {

Check notice on line 110 in R/func_discord_data.R

View check run for this annotation

codefactor.io / CodeFactor

R/func_discord_data.R#L110

Hanging indent should be 6 spaces but is 2 spaces. (indentation_linter)
id <- "rowwise_id"
orderedOnOutcome <- cbind(orderedOnOutcome, rowwise_id = 1:nrow(data))
orderedOnOutcome <- cbind(orderedOnOutcome, rowwise_id = seq_len(nrow(data)))
}

out <- vector(mode = "list", length = length(variables))

for (i in 1:length(variables)) {
for (i in seq_along(variables)) {
out[[i]] <- do.call(rbind, lapply(
X = 1:nrow(orderedOnOutcome),
X = seq_len(nrow(orderedOnOutcome)),
FUN = make_mean_diffs,
data = orderedOnOutcome, id = id,
sex = sex, race = race,
Expand Down Expand Up @@ -184,11 +184,11 @@
}


return(output)
output
}
.clean_names <- function(df) {
names(df) <- sub(".*\\.", "", names(df)) # If name has "prefix.name", keep only "name"
return(df)
df
}
#' @title Discord Data Fast
#'
Expand Down Expand Up @@ -220,13 +220,13 @@
)

if (!valid_ids(orderedOnOutcome,
id = id
id = id
)) {
id_original <- id
id <- "rowwise_id"
orderedOnOutcome <- cbind(orderedOnOutcome,
id_original = data[id_original],
rowwise_id = 1:nrow(data)
rowwise_id = seq_len(nrow(data))
)
}

Expand Down Expand Up @@ -307,5 +307,5 @@
}


return(output)
output
}