title: How to automatically set the random seed on current time?
body: <p>Every time one opens a R console, the random seed is set to the same value. On my computer (it might be the same on your machine), if I run <code>rnorm(1)</code>, I always get <code>0.1777571</code> at the first call.</p>
  
  <p>I tried to automatically set the random seed using the computer current time by adding something like </p>
  
  <pre><code>set.seed(
     as.integer(
        as.numeric(
           gsub("[^0-9]","",paste(format(Sys.time(), "%Y %X %x")))
        )%%.Machine$integer.max
     )
  )
  </code></pre>
  
  <p>in the file <code>.Rprofile</code> but it does not change anything. The first call to <code>rnorm(1)</code> always return <code>0.1777571</code>.</p>
  
  <p>How can I automatically set the random seed to the computer current time?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I open R session directly on the terminal. I just hit <code>r</code> and do not explicitly load any previous workspace.</p>