title: Using sprintf with multiple variables of different length in R
body: <p>I am working with R trying to use the sprintf function to print multiple urls. The URL is in the form <a href="http://www.weather.unh.edu/data/year/day.txt" rel="nofollow">http://www.weather.unh.edu/data/year/day.txt</a>. I want to print the url for each day of multiple years. I tried:</p>
  
  <p><code>day &lt;-c(1:365)
  year &lt;-c(2001:2004)
  urls&lt;- sprintf("http://www.weather.unh.edu/data/%s/%s.txt", year, day)</code></p>
  
  <p>but received the error</p>
  
  <p><code>Error in sprintf("http://www.weather.unh.edu/data/%s/%s.txt", year, day) : 
    arguments cannot be recycled to the same length</code></p>
  
  <p>I am printing these urls so I can import raw data from them in bulk.
   If anyone has any idea how to make this work with sprintf or another function please let me know </p>