Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/Five-weekends/R/five-weekends.r
Normal file
6
Task/Five-weekends/R/five-weekends.r
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
ms = as.Date(sapply(c(1, 3, 5, 7, 8, 10, 12),
|
||||
function(month) paste(1900:2100, month, 1, sep = "-")))
|
||||
ms = format(sort(ms[weekdays(ms) == "Friday"]), "%b %Y")
|
||||
message("There are ", length(ms), " months with five weekends.")
|
||||
message("The first five: ", paste(ms[1:5], collapse = ", "))
|
||||
message("The last five: ", paste(tail(ms, 5), collapse = ", "))
|
||||
Loading…
Add table
Add a link
Reference in a new issue