title: How to determine if a string "ends with" another string in R?
body: <p>I want to filter out the rows of a table which contain '*' in the string value of the column. Checking just that column.</p>
  
  <pre><code> string_name = c("aaaaa", "bbbbb", "ccccc", "dddd*", "eee*eee")
  
   zz &lt;- sapply(tx$variant_full_name, function(x) {substrRight(x, -1) =="*"})
   Error in FUN(c("Agno I30N", "VP2 E17Q", "VP2 I204*", "VP3 I85F", "VP1 K73R",  : 
     could not find function "substrRight"
  </code></pre>
  
  <p>The 4th value of zz should be TRUE by this.</p>
  
  <p>in python there is endswith function for strings [ string_s.endswith('*') ]
  Is there something similar to that in R ?</p>
  
  <p>Also, is it problem because of '*' as a character as it means any character ? grepl also not working.</p>
  
  <pre><code>&gt; grepl("*^",'dddd*')
  [1] TRUE
  &gt; grepl("*^",'dddd')
  [1] TRUE
  </code></pre>