Skip to content

Error message in ctable: the condition has length > 1 #208

@raffaem

Description

@raffaem

I get this error message when using ctable:

> ctable(
+   findf %>% pull(kohesio_cost) %>% is.na(),
+   findf %>% pull(kohesio_cost_log) %>% is.na()
+ )
Error in if (grepl("^get\\(", deparse(call[[.p$var]]))) { : 
  the condition has length > 1
Warning in parse_call(mc = match.call(), var = "x", var_label = FALSE, caller = "ctable") :
  metadata extraction terminated unexpectedly; inspect results carefully
Error in if (grepl("^get\\(", deparse(call[[.p$var]]))) { : 
  the condition has length > 1
Warning in parse_call(mc = match.call(), var = "y", var_label = FALSE, caller = "ctable") :
  metadata extraction terminated unexpectedly; inspect results carefully
Cross-Tabulation, Row Proportions  
findf %>% pull(kohesio_cost) %>% is.na() * findf %>% pull(kohesio_cost_log) %>% is.na()  

------------------------------------------ ---------------------------------------------- ---------------- --------------- ----------------
                                             findf %>% pull(kohesio_cost_log) %>% is.na()            FALSE            TRUE            Total
  findf %>% pull(kohesio_cost) %>% is.na()                                                                                                 
                                     FALSE                                                  10430 (100.0%)      0 (  0.0%)   10430 (100.0%)
                                      TRUE                                                      0 (  0.0%)   3363 (100.0%)    3363 (100.0%)
                                     Total                                                  10430 ( 75.6%)   3363 ( 24.4%)   13793 (100.0%)
------------------------------------------ ---------------------------------------------- ---------------- --------------- ----------------

It works correctly with base table:


> table(
+   findf %>% pull(kohesio_cost) %>% is.na(),
+   findf %>% pull(kohesio_cost_log) %>% is.na()
+ )
       
        FALSE  TRUE
  FALSE 10430     0
  TRUE      0  3363

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions