From 9e7766f68d9c98738276640e5bec46a01acf844a Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Feb 2026 21:53:16 -0500 Subject: [PATCH] Fix style issues in R/summarizePedigree.R (#131) * Add CodeFactor badge to README * Initial plan * Fix 9 style issues in R/summarizePedigree.R Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com> --------- Co-authored-by: Mason Garrison Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com> --- R/summarizePedigree.R | 18 +++++++++--------- README.Rmd | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/R/summarizePedigree.R b/R/summarizePedigree.R index 07ecd5ac..b77d9d92 100644 --- a/R/summarizePedigree.R +++ b/R/summarizePedigree.R @@ -78,7 +78,7 @@ summarizePedigrees <- function(ped, ) } if (!is.null(founder_sort_var) && - !founder_sort_var %in% names(ped)) { + !founder_sort_var %in% names(ped)) { stop( "If you set founder_sort_var, that variable must be a column in the pedigree data. If you want to sort by using the default, set founder_sort_var = NULL. The default is to sort by birth year if that's present and by personID otherwise." ) @@ -265,7 +265,7 @@ summarizePedigrees <- function(ped, ) } } - return(output) + output } @@ -316,7 +316,7 @@ calculateSummaryDT <- function(data, ] # Flatten the nested lists summary_stats <- data.table::as.data.table(summary_stats[, lapply(.SD, unlist), by = group_var]) - return(summary_stats) + summary_stats } #' Function to find the originating member for each line @@ -363,7 +363,7 @@ summarizeFounder <- function(ped_dt, by = group_var, suffixes = c("", "_founder") ) - return(foo_summary_dt) + foo_summary_dt } @@ -392,7 +392,7 @@ findFooest <- function(foo_summary_dt, } )) - return(subset_foo) + subset_foo } #' Function to find the oldest individuals in a pedigree @@ -414,7 +414,7 @@ findOldest <- function(foo_summary_dt, n_fooest = n_fooest, decreasing = FALSE ) - return(oldest_foo) + oldest_foo } #' Function to find the biggest families in a pedigree @@ -436,7 +436,7 @@ findBiggest <- function(foo_summary_dt, n_fooest = n_fooest, decreasing = TRUE ) - return(biggest_foo) + biggest_foo } #' Function to prepare the pedigree for summarization @@ -492,7 +492,7 @@ prepSummarizePedigrees <- function(ped, } - return(ped) + ped } #' Function to summarize the oldest individuals in a pedigree @@ -548,5 +548,5 @@ summarizeOldest <- function(byr = NULL, ) } } - return(output) + output } diff --git a/README.Rmd b/README.Rmd index 1f3df649..ad429fab 100644 --- a/README.Rmd +++ b/README.Rmd @@ -25,6 +25,7 @@ options(citation.bibtex.max = 0) [![Package downloads](https://cranlogs.r-pkg.org/badges/grand-total/BGmisc)](https://cran.r-project.org/package=BGmisc)
[![R-CMD-check](https://github.com/R-Computing-Lab/BGmisc/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/R-Computing-Lab/BGmisc/actions/workflows/R-CMD-check.yaml) [![Dev Main branch](https://github.com/R-Computing-Lab/BGmisc/actions/workflows/R-CMD-dev_maincheck.yaml/badge.svg)](https://github.com/R-Computing-Lab/BGmisc/actions/workflows/R-CMD-dev_maincheck.yaml) +[![CodeFactor](https://www.codefactor.io/repository/github/r-computing-lab/bgmisc/badge)](https://www.codefactor.io/repository/github/r-computing-lab/bgmisc) [![Codecov test coverage](https://codecov.io/gh/R-Computing-Lab/BGmisc/graph/badge.svg?token=2IARK2XSA6)](https://app.codecov.io/gh/R-Computing-Lab/BGmisc) ![License](https://img.shields.io/badge/License-GPL_v3-blue.svg)