title: Using multiple gsubs in one r function
body: <p>So keep in mind I started using R for two days now, and for our first assignment we have to create a function, and I'm planning on just doing basic encryption kind of thing.</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>g &lt;- c("Hello, this is a test, do you understand?")
  
  convert &lt;- function(a) {
      gsub("H","$",a)
      gsub("e","f",a)
      gsub("l","*",a)
      gsub("o","7",a)
  }
  
  convert(g)
  </code></pre>
  
  <p>See the problem is this outputs:</p>
  
  <pre><code>"Hell7, this is a test, d7 y7u undertstand?"
  </code></pre>
  
  <p>How would I get the multiple <code>gsub</code>s to work?</p>