Skip to content

Commit

Permalink
0.99.5
Browse files Browse the repository at this point in the history
Handle NULL in combine function
  • Loading branch information
stefangraw committed Feb 14, 2019
1 parent a563fa7 commit f3b6656
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: pwrEWAS
Title: A user-friendly tool for comprehensive power estimation for epigenome wide association studies (EWAS)
Version: 0.99.4
Version: 0.99.5
Description: pwrEWAS is a user-friendly tool to assists researchers in the design and planning of EWAS to help circumvent under- and overpowered studies.
Author: Stefan Graw
Maintainer: Stefan Graw <sgraw@kumc.edu>
Expand Down
2 changes: 2 additions & 0 deletions R/pwrEWAS_v1.7.R
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ pwrEWAS <- function(minTotSampleSize, # min total sample size

# combining function for foreach loops
combine_tau <- function(listA, listB){
if(is.null(listA)) return(listB)
if(!is(listA[["power"]], "array") & !is(listA[["power"]], "matrix")) listA[["power"]] <- matrix(listA[["power"]])
if(!is(listB[["power"]], "array") & !is(listB[["power"]], "matrix")) listB[["power"]] <- matrix(listB[["power"]])
if(!is(listA[["metric"]]$marTypeI, "array") & !is(listA[["metric"]]$marTypeI, "matrix")) listA[["metric"]]$marTypeI <- matrix(listA[["metric"]]$marTypeI)
Expand All @@ -134,6 +135,7 @@ pwrEWAS <- function(minTotSampleSize, # min total sample size
}

combine_totSampleSizes <- function(listA, listB){
if(is.null(listA)) return(listB)
returnList <- list()
returnList[["power"]] <- cbind(listA[["power"]], listB[["power"]])
returnList[["delta"]] <- cbind(listA[["delta"]], listB[["delta"]])
Expand Down

0 comments on commit f3b6656

Please sign in to comment.