Merge branch 'master' of https://github.com/haozhu233/kableExtra
diff --git a/R/collapse_rows.R b/R/collapse_rows.R
index ee05cc8..86956aa 100644
--- a/R/collapse_rows.R
+++ b/R/collapse_rows.R
@@ -109,7 +109,7 @@
   mapping_matrix <- list()
   for (i in columns) {
     mapping_matrix[[paste0("x", i)]] <- unlist(lapply(
-      rle(kable_dt[, i])$length, column_block))
+      rle(kable_dt[, i])$lengths, column_block))
   }
   mapping_matrix <- data.frame(mapping_matrix)
   return(mapping_matrix)
diff --git a/inst/kePrint-0.0.1/kePrint.js b/inst/kePrint-0.0.1/kePrint.js
index 4f9728d..e6fbbfc 100644
--- a/inst/kePrint-0.0.1/kePrint.js
+++ b/inst/kePrint-0.0.1/kePrint.js
@@ -1,4 +1,8 @@
 $(document).ready(function(){
-    $('[data-toggle="tooltip"]').tooltip();
-    $('[data-toggle="popover"]').popover();
+    if (typeof $('[data-toggle="tooltip"]').tooltip === 'function') {
+        $('[data-toggle="tooltip"]').tooltip();
+    }
+    if ($('[data-toggle="popover"]').popover === 'function') {
+        $('[data-toggle="popover"]').popover();
+    }
 });