From d76fbdb75837f3ebf9006690f489c1fe4c9bce68 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 23 Feb 2017 12:45:21 -0800 Subject: [PATCH] Fixed chunk size issue --- R/doAzureParallel.R | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/R/doAzureParallel.R b/R/doAzureParallel.R index e37597c5..321ab366 100644 --- a/R/doAzureParallel.R +++ b/R/doAzureParallel.R @@ -181,12 +181,14 @@ getparentenv <- function(pkgname) { startIndices <- seq(1, length(argsList), chunkSize) - if(chunkSize > length(argsList)){ - endIndices <- seq(length(argsList), length(argsList)) - } - else{ - endIndices <- seq(chunkSize, length(argsList), chunkSize) - } + endIndices <- + if(chunkSize >= length(argsList)) + { + c(length(argsList)) + } + else { + seq(chunkSize, length(argsList), chunkSize) + } minLength <- min(length(startIndices), length(endIndices))