title: How to unfold user and environment variable in R language?
body: <p>Are there any ways to expand tilde and environment variables in R?</p>
  
  <p>For example, in Python, you can get it by writing out the following set of codes:</p>
  
  <pre><code>import os
  os.path.expanduser("~/r_workspace") # return "/Users/yourname/r_workspace" (in OS X)
  os.path.expandvars("$R") # return "/Users/yourname/r_workspace", if you set "$R" to it in advance
  </code></pre>
  
  <p>Does R provide the sort of functions? I don't like to bother to write the following code:</p>
  
  <pre><code>read.csv("/Users/myname/python_workspace/subdirectory_1/subdirectory_2/data.csv")
  </code></pre>