In corpusQuery explicitely use dplyr::select
Fixes:
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘select’ for signature
‘"tbl_df"’
Change-Id: Idced6cb1631b0a2e95be950cf45ddb986aacf7df
diff --git a/R/KorAPQuery.R b/R/KorAPQuery.R
index b4fbe6a..9894d87 100644
--- a/R/KorAPQuery.R
+++ b/R/KorAPQuery.R
@@ -117,12 +117,12 @@
#' fetchAll() %>%
#' slot("collectedMatches") %>%
#' mutate(year = lubridate::year(pubDate)) %>%
-#' select(year) %>%
+#' dplyr::select(year) %>%
#' group_by(year) %>%
#' summarise(Count = n()) %>%
#' mutate(Freq = mapply(function(f, y)
#' f / corpusStats(kco, paste("pubDate in", y))@tokens, Count, year)) %>%
-#' select(-Count) %>%
+#' dplyr::select(-Count) %>%
#' complete(year = min(year):max(year), fill = list(Freq = 0)) %>%
#' plot(type = "l")
#'
@@ -202,7 +202,7 @@
#' @aliases fetchNext
#' @rdname KorAPQuery-class
#' @importFrom purrr map_dfr
-#' @importFrom dplyr rowwise bind_rows
+#' @importFrom dplyr rowwise bind_rows select
#' @export
setMethod("fetchNext", "KorAPQuery", function(kqo, offset = kqo@nextStartIndex, maxFetch = maxResultsPerPage, verbose = kqo@korapConnection@verbose) {
if (kqo@totalResults == 0 || offset >= kqo@totalResults) {
@@ -226,7 +226,7 @@
kqo@fields %>%
map_dfr( ~tibble(!!.x := logical() ) ) %>%
bind_rows(res$matches) %>%
- select(kqo@fields)
+ dplyr::select(kqo@fields)
if ("pubDate" %in% kqo@fields) {
currentMatches$pubDate <- currentMatches$pubDate %>% as.Date(format = "%Y-%m-%d")
factorCols <- currentMatches %>% select(-pubDate) %>% colnames()