title: how to encode url on R
body: <p>how can I encode a url as this</p>
  
  <p><a href="http://www.chemspider.com/inchi.asmx/InChIToSMILES?inchi=InchI=1S/C21H30O9/c1-11%285-6-21%2828%2912%282%298-13%2823%299-20%2821,3%294%297-15%2824%2930-19-18%2827%2917%2826%2916%2825%2914%2810-22%2929-19/h5-8,14,16-19,22,25-28H,9-10H2,1-4H3/b6-5+,11-7-/t14-,16-,17+,18-,19+,21-/m1/s1&amp;token=e4a6d6fb-ae07-4cf6-bae8-c0e6115bc681" rel="nofollow">http://www.chemspider.com/inchi.asmx/InChIToSMILES?inchi=InchI=1S/C21H30O9/c1-11(5-6-21(28)12(2)8-13(23)9-20(21,3)4)7-15(24)30-19-18(27)17(26)16(25)14(10-22)29-19/h5-8,14,16-19,22,25-28H,9-10H2,1-4H3/b6-5+,11-7-/t14-,16-,17+,18-,19+,21-/m1/s1&amp;token=e4a6d6fb-ae07-4cf6-bae8-c0e6115bc681</a></p>
  
  <p>to make this</p>
  
  <p><a href="http://www.chemspider.com/inchi.asmx/InChIToSMILES?inchi=InChI%3D1S%2FC21H30O9%2Fc1-11%285-6-21%2828%2912%282%298-13%2823%299-20%2821%2C3%294%297-15%2824%2930-19-18%2827%2917%2826%2916%2825%2914%2810-22%2929-19%2Fh5-8%2C14%2C16-19%2C22%2C25-28H%2C9-10H2%2C1-4H3%2Fb6-5%2B%2C11-7-%2Ft14-%2C16-%2C17%2B%2C18-%2C19%2B%2C21-%2Fm1%2Fs1" rel="nofollow">http://www.chemspider.com/inchi.asmx/InChIToSMILES?inchi=InChI%3D1S%2FC21H30O9%2Fc1-11(5-6-21(28)12(2)8-13(23)9-20(21%2C3)4)7-15(24)30-19-18(27)17(26)16(25)14(10-22)29-19%2Fh5-8%2C14%2C16-19%2C22%2C25-28H%2C9-10H2%2C1-4H3%2Fb6-5%2B%2C11-7-%2Ft14-%2C16-%2C17%2B%2C18-%2C19%2B%2C21-%2Fm1%2Fs1</a></p>
  
  <p>on R?</p>
  
  <p>I tried</p>
  
  <p>URLencode</p>
  
  <p>but it does not work.</p>
  
  <p>Thanks</p>