title: How to get week number and year from date in R
body: <p>I am trying to get both week number and year from a date object in R.</p>
  
  <p>Until then, I did it separately : I used isoweek() function to extract week and year() function to extract year. So that my data.frame has 3 variables : date, week, year</p>
  
  <p>This is working except for beginning/end of year : for example, 2015 has 53 weeks and January 1st, 2016 belongs to the 53rd week of 2015 ... but with my code, it is such that 1/1/2016 is week 53 but year 2016 whereas I would like it to be week 53 in year 2015. </p>
  
  <p>So is there a way in R to extract week numbers and years that make sense together ? </p>
  
  <p>I know there are lots of questions about this but not found anything on this specific beginning/end of year issue. </p>
  
  <p>Thanks !</p>