highcharter-helper: improve handling of single query terms
Change-Id: I057f88c5bdf100cc1464b7a2c211db7a41e228c5
diff --git a/DESCRIPTION b/DESCRIPTION
index e933c1d..29c3893 100644
--- a/DESCRIPTION
+++ b/DESCRIPTION
@@ -1,7 +1,7 @@
Package: RKorAPClient
Type: Package
Title: 'KorAP' Web Service Client Package
-Version: 0.5.5.9001
+Version: 0.5.5.9002
Authors@R:
c(person(given = "Marc",
family = "Kupietz",
diff --git a/NEWS.md b/NEWS.md
index 8823dfb..584bb20 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,7 +1,8 @@
-# RKorAPClient 0.5.5.9001
+# RKorAPClient 0.5.5.9002
- Fix some links in Readme.md
- Introduce continuous integration tests via gh-actions, pulled from [highcharter](https://github.com/jbkunst/highcharter) (thanks @pachamaltese)
- Remove redundant curl import
+- Fix handling of single queries in highcharter-helper
# RKorAPClient 0.5.5
- Use TRUE and FALSE instead of T and F
diff --git a/R/highcharter-helper.R b/R/highcharter-helper.R
index 76ebdc7..ad2168c 100644
--- a/R/highcharter-helper.R
+++ b/R/highcharter-helper.R
@@ -49,9 +49,11 @@
queryStringToLabel(vc, excludePubDate = TRUE )))
}
} else {
- title <- base::unique(df$query)
- if(length(base::unique(queryStringToLabel(df$vc, excludePubDate = TRUE ))) > 1) {
+ if (length(base::unique(queryStringToLabel(df$vc, excludePubDate = TRUE ))) > 1) {
+ title <- base::unique(df$query)
df <- df %>% mutate(condition = queryStringToLabel(vc, excludePubDate = TRUE ))
+ } else {
+ df <- df %>% mutate(condition = query)
}
}
}