Skip to content

Instantly share code, notes, and snippets.

@terashim
Last active May 29, 2019 09:47
Show Gist options
  • Save terashim/c24e29d75a5d7fa1058868c0aefaabfc to your computer and use it in GitHub Desktop.
Save terashim/c24e29d75a5d7fa1058868c0aefaabfc to your computer and use it in GitHub Desktop.
10日おきに12:00の時刻ベクトルを生成
# サンプルコード: 10日おきに12:00の時刻ベクトルを生成
library(tidyverse)
library(lubridate)
# 日付のベクトルを作成
sent_time <- seq(as_date("2018-01-01"), as_date("2019-12-31"), by = "10 days")
# POSIXct型に変換
sent_time <- as_datetime(sent_time)
# 12時間をプラス
sent_time <- sent_time + hours(12)
# 確認
class(sent_time)
sent_time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment