Skip to content

Commit 9e7766f

Browse files
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 <garrissm@wfu.edu> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: smasongarrison <6001608+smasongarrison@users.noreply.github.com>
1 parent 91eafd6 commit 9e7766f

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

R/summarizePedigree.R

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ summarizePedigrees <- function(ped,
7878
)
7979
}
8080
if (!is.null(founder_sort_var) &&
81-
!founder_sort_var %in% names(ped)) {
81+
!founder_sort_var %in% names(ped)) {
8282
stop(
8383
"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."
8484
)
@@ -265,7 +265,7 @@ summarizePedigrees <- function(ped,
265265
)
266266
}
267267
}
268-
return(output)
268+
output
269269
}
270270

271271

@@ -316,7 +316,7 @@ calculateSummaryDT <- function(data,
316316
]
317317
# Flatten the nested lists
318318
summary_stats <- data.table::as.data.table(summary_stats[, lapply(.SD, unlist), by = group_var])
319-
return(summary_stats)
319+
summary_stats
320320
}
321321

322322
#' Function to find the originating member for each line
@@ -363,7 +363,7 @@ summarizeFounder <- function(ped_dt,
363363
by = group_var,
364364
suffixes = c("", "_founder")
365365
)
366-
return(foo_summary_dt)
366+
foo_summary_dt
367367
}
368368

369369

@@ -392,7 +392,7 @@ findFooest <- function(foo_summary_dt,
392392
}
393393
))
394394

395-
return(subset_foo)
395+
subset_foo
396396
}
397397

398398
#' Function to find the oldest individuals in a pedigree
@@ -414,7 +414,7 @@ findOldest <- function(foo_summary_dt,
414414
n_fooest = n_fooest,
415415
decreasing = FALSE
416416
)
417-
return(oldest_foo)
417+
oldest_foo
418418
}
419419

420420
#' Function to find the biggest families in a pedigree
@@ -436,7 +436,7 @@ findBiggest <- function(foo_summary_dt,
436436
n_fooest = n_fooest,
437437
decreasing = TRUE
438438
)
439-
return(biggest_foo)
439+
biggest_foo
440440
}
441441

442442
#' Function to prepare the pedigree for summarization
@@ -492,7 +492,7 @@ prepSummarizePedigrees <- function(ped,
492492
}
493493

494494

495-
return(ped)
495+
ped
496496
}
497497

498498
#' Function to summarize the oldest individuals in a pedigree
@@ -548,5 +548,5 @@ summarizeOldest <- function(byr = NULL,
548548
)
549549
}
550550
}
551-
return(output)
551+
output
552552
}

README.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ options(citation.bibtex.max = 0)
2525
[![Package downloads](https://cranlogs.r-pkg.org/badges/grand-total/BGmisc)](https://cran.r-project.org/package=BGmisc)</br>
2626
[![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)
2727
[![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)
28+
[![CodeFactor](https://www.codefactor.io/repository/github/r-computing-lab/bgmisc/badge)](https://www.codefactor.io/repository/github/r-computing-lab/bgmisc)
2829
[![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)
2930
![License](https://img.shields.io/badge/License-GPL_v3-blue.svg)
3031
<!-- badges: end -->

0 commit comments

Comments
 (0)