简体   繁体   English

R 中的子集时间序列数据

[英]subset time series data in R

I got a time series data and I use windown to get the subset from 1201 until 1700. The data on the same row would be truncated or kept.我得到了一个时间序列数据,我使用windown来获取从 1201 到 1700 的子集。同一行上的数据将被截断或保留。 How to get exactly time data I want?如何获得我想要的准确时间数据?

Time Series:
Start = 1203 
End = 1499 
Frequency = 0.125 
      V1  V2  V3  V4  V5  V6  V7  V8
1203  88 121  50  95  74  76  88  97
1211 140  45 145  76 100  66  40  55
1219  74  21  81  78  55  97  76 123
1227  52  83  57  17  78  55  71  62
1235  88  17  78 142  97 128 221 195
1243 128 190  52  95  74  97 100 100
......

You can use the column name to subset.您可以使用列名进行子集化。 Change "data" to your database name and the "column_name" to the column you want use as filter.将“data”更改为您的数据库名称,将“column_name”更改为您要用作过滤器的列。

new_data <- data[data$column_name >= 1201 & data$column_name <= 1700, ]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM