Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
fix bug when sorting genotypes with NA values
Browse files Browse the repository at this point in the history
  • Loading branch information
TiagoOlivoto committed Jun 9, 2021
1 parent 304ef87 commit c62a1bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/FAI_BLUP.R
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ fai_blup <- function(.data,
GID <- DEM[1:nrow(scores), (nrow(scores) + 1):nrow(sd.scores)]
spatial.prob <- (1/GID)/(replicate(IN, c(as.numeric(apply((1/GID), 1, sum)))))
ideotype.rank <- lapply(1:IN, function(i) {
sort(spatial.prob[, i], decreasing = TRUE)
sort(spatial.prob[, i] %>% replace_na(replace = 0), decreasing = TRUE)
})
names(ideotype.rank) <- paste("ID", 1:IN, sep = "")
means.factor <- means[, names.pos.var.factor]
Expand Down

0 comments on commit c62a1bd

Please sign in to comment.