title: How can I make a Heaviside function?
body: <p>I am handling the Stanford heart transplant data in R. </p>
  
  <pre><code>library(survival) 
  head(jasa)
  </code></pre>
  
  <p>I want to analyse survival between transplant vs non-transplant patient. But I want to use a Heaviside function. </p>
  
  <pre><code>&gt; transplant(t) : 0 if did not receive transplant by time, t i.e, if t&lt;wait-time
    1 if received transplant prior to time, i.e,
    if t&gt; wait-time
  &gt; 
  &gt; msscore(t)  0 if t&lt; wait-time
              mscore if t&gt;wait-time
  
  &gt; age(t)      0 if t&lt; wait-time
              AGE if t&gt;wait time
  </code></pre>
  
  <p>I want to evaluate survival process using these Heaviside functions. Although I've searched many documents, there's no function that can make a Heaviside function in R as far as I know. </p>