From f8141e0466098c19768533f0d590042bfd618408 Mon Sep 17 00:00:00 2001 From: randyzwitch Date: Fri, 3 Mar 2017 10:57:56 -0500 Subject: [PATCH] Fix #207 --- DESCRIPTION | 4 ++-- NEWS | 11 +++++++++++ R/BuildInnerBreakdownsRecursively.R | 3 ++- R/RSiteCatalyst.R | 4 ++-- man/RSiteCatalyst.Rd | 4 ++-- tests/testthat/test-queuetrended.R | 24 ++++++++++++++++++++++++ 6 files changed, 43 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index b10355c..13d7517 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: RSiteCatalyst Type: Package Title: R Client for Adobe Analytics API V1.4 -Version: 1.4.10.20170301 -Date: 2017-03-01 +Version: 1.4.10.20170303 +Date: 2017-03-03 Author: Willem Paling, Randy Zwitch & Jowanza Joseph Maintainer: Randy Zwitch Depends: diff --git a/NEWS b/NEWS index 93e2703..157e43e 100755 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +RSiteCatalyst 1.4.11 +================= + +* Fixed issue with QueueDatawarehouse not returning the proper number of results when enqueueOnly = FALSE, fixed encoding for UTF-8-BOM (#198) + +* Added GetClickMapReporting, GetPreviousServerCalls (work towards #179) + +* Fixed parser for GetFeeds, to unnest `activity` data frame into discrete columns + +* Fixed issue where message 'Error in if (!is.null(elements[i, ]$classification) && nchar(elements[i, : missing value where TRUE/FALSE needed' displayed when using multiple elements (#207) + RSiteCatalyst 1.4.10 ================= diff --git a/R/BuildInnerBreakdownsRecursively.R b/R/BuildInnerBreakdownsRecursively.R index 62150b8..ca47e04 100644 --- a/R/BuildInnerBreakdownsRecursively.R +++ b/R/BuildInnerBreakdownsRecursively.R @@ -80,9 +80,10 @@ BuildInnerBreakdownsRecursively <- function(parent.element,elements,metrics, names(outer.elements) <- "name" # build named elements, with classifications if they exist + #RZ: Have no idea why is.na and is.null and nchar is here, with is.na fixing GitHub #207 elements.named <- elements$id for(i in 1:nrow(elements)) { - if(!is.null(elements[i,]$classification) && !is.na(elements[i,]$classification)) { + if(!is.na(elements[i,]$classification) && !is.null(elements[i,]$classification) && nchar(elements[i,]$classification) > 0) { elements.named[i] <- paste0(elements[i,]$id,": ",elements[i,]$classification) } } diff --git a/R/RSiteCatalyst.R b/R/RSiteCatalyst.R index d2fc5e4..986e053 100644 --- a/R/RSiteCatalyst.R +++ b/R/RSiteCatalyst.R @@ -1,7 +1,7 @@ #' Package: RSiteCatalyst \cr #' Type: Package \cr -#' Version: 1.4.10.20170301 \cr -#' Date: 2017-03-01 \cr +#' Version: 1.4.10.20170303 \cr +#' Date: 2017-03-03 \cr #' License: MIT + file LICENSE \cr #' #' diff --git a/man/RSiteCatalyst.Rd b/man/RSiteCatalyst.Rd index 0ea82c9..00c6259 100644 --- a/man/RSiteCatalyst.Rd +++ b/man/RSiteCatalyst.Rd @@ -14,8 +14,8 @@ This package is not intended for Adobe Analytics administration. \details{ Package: RSiteCatalyst \cr Type: Package \cr -Version: 1.4.10.20170301 \cr -Date: 2017-03-01 \cr +Version: 1.4.10.20170303 \cr +Date: 2017-03-03 \cr License: MIT + file LICENSE \cr } \references{ diff --git a/tests/testthat/test-queuetrended.R b/tests/testthat/test-queuetrended.R index 110d25e..a7a47d9 100644 --- a/tests/testthat/test-queuetrended.R +++ b/tests/testthat/test-queuetrended.R @@ -242,4 +242,28 @@ test_that("Validate QueueTrended using legacy credentials", { #Validate returned value is a numeric expect_is(ss, "numeric") + + #GitHub issue 207, fixes Error in if (!is.null(elements[i, ]$classification) && nchar(elements[i, : + #missing value where TRUE/FALSE needed + issue207 <- QueueTrended( + reportsuite.id = "zwitchdev", + date.from = "2016-02-01", + date.to = "2016-02-01", + top ="1000", + metrics = c("visits"), + elements = c("page", "mobiledevicetype"), + classification = "JuliaPages", + date.granularity = "week", + segment.id = "", + data.current = TRUE, + expedite = FALSE, + interval.seconds = 5, + max.attempts = 10000, + validate = TRUE, + enqueueOnly = FALSE + ) + + #Validate returned value is a data.frame + expect_is(issue207, "data.frame") + })