id: list_comparison-1
language: r
severity: warning
rule:
  any:
    - pattern: $FUN($$$) > $$$
    - pattern: $FUN($$$) >= $$$
    - pattern: $FUN($$$) < $$$
    - pattern: $FUN($$$) <= $$$
    - pattern: $FUN($$$) == $$$
    - pattern: $FUN($$$) != $$$
constraints:
  FUN:
    regex: ^(lapply|map|Map|\.mapply)$
message: |
  The output of ~~FUN~~(), a list, is being coerced for comparison. 
  Instead, use a mapper that generates a vector with the correct type directly, 
  for example vapply(x, FUN, character(1L)) if the output is a string.
