79144411

Date: 2024-10-31 10:53:28
Score: 1
Natty:
Report link

something like this (using vals and arr from your example)?


    the_letter <- 'B'
    
    
    picklist <- Map(vals, f = \(val) ifelse(val == the_letter, 1, TRUE))
    do.call(`[`, c(list(x = arr), picklist))

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-1):
Posted by: I_O