Last Friday of each month: Difference between revisions

Content added Content deleted
(Added R.)
Line 950: Line 950:
key=lambda x:int(x.split("-")[1])):
key=lambda x:int(x.split("-")[1])):
print item</lang>
print item</lang>

=={{header|R}}==
<lang rsplus>year = commandArgs(T)
d = as.Date(paste0(year, "-01-01"))
fridays = d + seq(by = 7,
(5 - as.POSIXlt(d)$wday) %% 7,
364 + (months(d + 30 + 29) == "February"))
message(paste(collapse = "\n", fridays[tapply(
seq_along(fridays), as.POSIXlt(fridays)$mon, max)]))</lang>


=={{header|Racket}}==
=={{header|Racket}}==