Hi Daniele
This can simply be done by using the as.Date function where you can provide an origin date. I wrote a quick example:
calculateDate <- function(year, minutes){
# here the 1440 is number of minutes in a day. as the function needs that value in days.
z <- as.Date(minutes/1440, origin = paste0(year,"-01-01"))
## covert to POSIXct date to show the time also, otherwise these wont show
z <- as.POSIXct.Date(z)
print(z)
}
this would output:
> calculateDate(2016, 16543)
[1] "2016-01-12 12:43:00 CET"
Hope this helps.
Best,
H