Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
R xts 時系列があります。月曜日の 12:00 から 18:00 の間に発生するデータ ポイントを除いて、元のすべてのデータを含む新しい時系列を作成するにはどうすればよいですか?
これを行う1つの方法を次に示します。
x <- .xts(rnorm(100), as.POSIXct("2011-01-06 10:00:00")-100:1*3600) x[with(as.POSIXlt(index(x)), !(wday==1 & hour > 12 & hour < 18)),]
12:00 から 18:00 の間の時間だけが必要な場合は、次のように xts-subsetting を使用できます。
x["T12:00/T18:00"]