Write a function with date as input in R
<p>I would like to write a function that will take date as input argument and output will be day, month, week and week year. My sample code shown some error. Kindly help me
in this regards, thank you.</p>

<p>My Sample code as follows:</p>

<pre><code>       myFunction &lt;- function(date){
       date &lt;-as.numeric(as.Date(date, format = "%m/%d/%Y",origin = "1899-12-30"))
       date$month&lt;- strftime(date,"%m")
       date$day&lt;- strftime(date,"%d")
       data$week&lt;-strftime(date,"%w")
       date$week_year&lt;-strftime(date,"%W")
       return(date$day,date$month,date$week,date$week_year)
       }
</code></pre>

<p>When I called function ,It shown error:</p>

<pre><code>       myFunction(2016-07-26)
 Error in as.POSIXlt.numeric(x, tz = tz) : 'origin' must be supplied 
</code></pre>