在ifelse中使用match()的结果不期望的值

时间:2017-04-20 10:36:38

标签: r if-statement dataframe match

我有两个数据框:df1df2df1有一列,df2有两列,但它们共享相同的名称列:numWeek

数据帧的例子:

    df1 :               df2:

numWeek             effective    numWeek
2000-01-03              1       2000-01-03
2000-01-10              1       2000-02-14
2000-01-17              1       2000-02-28
2000-01-24              1       2000-03-13
2000-01-31              1       2000-04-10
2000-02-07              1       2000-05-01
2000-02-14              4       2000-05-08
2000-02-21              3       2000-05-15
2000-02-28              4       2000-05-22
2000-03-06              5       2000-05-29
2000-03-13              8       2000-06-05
2000-03-20              4       2000-06-12

我想要做的是,如果匹配,则将effective的col df2的值提供给df1的新列。为此,我做了:

test_matchso <- match(df1[,1], as.Date(df2[,2]), nomatch = 0)

并在匹配时从ids返回df2,如果不匹配则返回0

1 0 0 0 0 0 2 0 3 0 4 0

我现在要做的就是使用ifelse()

ifelse(test_matchso !=0, df2$effective[test_matchso], 0)

我得到了我预期的结果:

1 0 0 0 0 0 1 0 1 0 1 0

但最大的问题是,当我处理我的真实数据帧时,我得到了一些非预期值,而我在本例中使用的两个数据帧只是这些数据帧的一部分。

我为此次比赛获得的结果(与前一次相同):1 0 0 0 0 0 2 0 3 0 4 0

1 0 0 0 0 0 4 0 4 0 8

这些值完全荒谬,我应该得到与示例相同的结果。

真实数据框的head(n=12)

   effective    numWeek
1          1 2000-01-03
2          1 2000-02-14
3          1 2000-02-28
4          1 2000-03-13
5          1 2000-04-10
6          1 2000-05-01
7          4 2000-05-08
8          3 2000-05-15
9          4 2000-05-22
10         5 2000-05-29
11         8 2000-06-05
12         4 2000-06-12

有了这个,我理解,不管怎样,他没有使用匹配中的id,而是使用行的id:2match的第7个元素,所以它需要数据帧的第七行,但这不是我所想的......

由于我的两个数据帧的大小不同,它可能不起作用吗?

真实的数据帧将在最后给出,以下是尝试它的代码:

test_match <- match(rdf2$numWeek, as.Date(rdf1$numWeek), nomatch = 0)
ifelse(test_match!=0, yes = rdf1$effective[test_match], no = 0)

我真的很感激用ifelse()了解这种奇怪的行为。

示例数据:

df1

structure(list(`head(test$numWeek, n = 12)` = structure(c(10959, 
10966, 10973, 10980, 10987, 10994, 11001, 11008, 11015, 11022, 
11029, 11036), class = "Date")), .Names = "head(test$numWeek, n = 12)", row.names = c(NA, 
-12L), class = "data.frame")

df2

structure(list(effective = c(1, 1, 1, 1, 1, 1, 4, 3, 4, 5, 8, 
4), numWeek = c("2000-01-03", "2000-02-14", "2000-02-28", "2000-03-13", 
"2000-04-10", "2000-05-01", "2000-05-08", "2000-05-15", "2000-05-22", 
"2000-05-29", "2000-06-05", "2000-06-12")), .Names = c("effective", 
"numWeek"), row.names = c(NA, 12L), class = "data.frame")

真实数据:

rdf1

structure(list(effective = c(1, 1, 1, 1, 1, 1, 4, 3, 4, 5, 8, 
4, 12, 6, 6, 7, 3, 15, 7, 2, 8, 12, 12, 7, 9, 14, 9, 22, 10, 
17, 12, 14, 9, 14, 14, 14, 12, 13, 4, 13, 22, 21, 11, 24, 20, 
20, 20, 26, 23, 43, 16, 30, 29, 20, 25, 35, 48, 35, 43, 35, 34, 
26, 45, 68, 45, 44, 49, 33, 35, 24, 27, 24, 36, 60, 51, 47, 39, 
41, 58, 45, 42, 72, 26, 67, 59, 63, 70, 53, 65, 66, 17, 28, 77, 
95, 69, 91, 89, 84, 77, 91, 80, 109, 92, 116, 87, 87, 87, 102, 
91, 74, 90, 80, 96, 53, 100, 101, 114, 90, 84, 77, 77, 74, 76, 
25, 45, 33, 121, 121, 89, 96, 121, 108, 131, 128, 108, 159, 126, 
136, 135, 112, 171, 132, 35, 54, 168, 160, 150, 140, 131, 186, 
156, 128, 193, 174, 163, 200, 158, 197, 172, 135, 125, 194, 181, 
162, 111, 186, 141, 192, 189, 155, 141, 99, 126, 115, 108, 69, 
74, 99, 199, 148, 175, 200, 218, 225, 226, 215, 143, 240, 235, 
292, 243, 316, 234, 278, 132, 59, 329, 340, 282, 265, 321, 243, 
260, 241, 261, 267, 299, 272, 283, 243, 189, 265, 218, 232, 230, 
184, 200, 176, 240, 223, 217, 251, 216, 140, 172, 143, 107, 86, 
114, 115, 153, 176, 160, 180, 145, 193, 172, 229, 168, 153, 188, 
228, 277, 229, 225, 241, 96, 67, 290, 224, 227, 246, 255, 271, 
208, 205, 278, 262, 247, 259, 233, 305, 299, 280, 239, 265, 311, 
260, 258, 263, 285, 248, 306, 297, 279, 153, 225, 232, 181, 165, 
138, 158, 256, 298, 313, 224, 308, 329, 347, 363, 236, 284, 319, 
393, 324, 328, 374, 413, 245, 58, 360, 420, 426, 375, 407, 468, 
434, 388, 393, 514, 427, 455, 423, 473, 478, 351, 428, 339, 351, 
440, 307, 412, 357, 489, 448, 486, 428, 284, 318, 321, 298, 179, 
134, 288, 325, 406, 442, 434, 400, 507, 468, 545, 495, 282, 616, 
541, 544, 444, 575, 614, 508, 105, 332, 702, 632, 718, 668, 858, 
750, 751, 770, 953, 835, 860, 861, 882, 490, 725, 935, 630, 572, 
591, 941, 551, 806, 751, 796, 678, 709, 582, 530, 472, 434, 361, 
254, 458, 538, 675, 649, 679, 748, 627, 778, 705, 701, 388, 810, 
768, 721, 659, 727, 796, 816, 128, 304, 885, 919, 863, 746, 901, 
913, 715, 776, 837, 942, 770, 686, 744, 897, 701, 705, 612, 627, 
692, 761, 679, 679, 717, 761, 785, 781, 729, 439, 544, 446, 445, 
272, 389, 499, 704, 763, 703, 731, 793, 843, 835, 879, 587, 829, 
702, 736, 933, 790, 801, 891, 270, 190, 858, 913, 851, 823, 823, 
794, 778, 819, 809, 842, 861, 864, 805, 820, 511, 889, 679, 686, 
911, 628, 779, 616, 910, 845, 785, 790, 763, 475, 646, 512, 453, 
398, 477, 567, 773, 778, 825, 801, 907, 936, 929, 911, 710, 908, 
750, 998, 791, 1022, 939, 921, 414, 233, 1058, 921, 1006, 945, 
993, 969, 874, 814, 1102, 897, 1007, 977, 990, 761, 896, 783, 
934, 1015, 676, 1034, 751, 1000, 853, 944, 933, 978, 846, 512, 
695, 701, 549, 436, 488, 660, 826, 924, 899, 835, 900, 1057, 
888, 985, 750, 638, 855, 977, 1117, 789, 977, 969, 554, 258, 
1139, 1026, 1062, 956, 1038, 1000, 1096, 967, 805, 1003, 1112, 
938, 946, 959, 1062, 923, 622, 891, 909, 964, 911, 512, 1011, 
709, 855, 900, 859, 421, 591, 598, 493, 468, 447, 619, 738, 861, 
862, 845, 814, 936, 920, 989, 757, 656, 879, 786, 1017, 906, 
918, 1046, 602, 216, 1085, 922, 1047, 842, 919, 933, 920, 872, 
857, 1016, 934, 892, 924, 961, 638, 846, 930, 598, 660, 670, 
954, 604, 832, 842, 903, 786, 833, 683, 623, 642, 536, 504, 313, 
585, 656, 846, 864, 812, 883, 897, 932, 885, 970, 465, 701, 1039, 
959, 904, 843, 895, 994, 118, 352, 984, 878, 772, 759, 800, 887, 
773, 608, 774, 760, 826, 740, 635, 833, 764, 717, 542, 387, 943, 
573, 670, 684, 745, 783, 740, 664, 646, 476, 526, 415, 463, 265, 
512, 510, 645, 605, 607, 646, 687, 661, 712, 517, 374, 745, 515, 
664, 577, 652, 694, 664, 114, 132, 619, 751, 622, 638, 624, 690, 
672, 685, 542, 657, 670, 616, 642, 641, 666, 532, 445, 345, 704, 
655, 416, 565, 479, 625, 550, 508, 509, 321, 406, 330, 334, 276, 
390, 450, 529, 540, 485, 526, 589, 594, 597, 522, 462, 558, 467, 
598, 626, 601, 630, 717, 144, 133, 707, 686, 579, 599, 552, 587, 
527, 630, 611, 681, 580, 645, 619, 513, 639, 554, 508, 548, 422, 
672, 453, 613, 549, 676, 503, 556, 534, 341, 378, 417, 284, 329, 
410, 521, 516, 605, 570, 618, 547, 641, 472, 458, 420, 516, 500, 
523, 554, 486, 638, 577, 191, 136, 649, 662, 561, 539, 574, 581, 
498, 534, 577, 582, 564, 575, 486, 465, 514, 530, 561, 399, 571, 
453, 512, 485, 533, 543, 515, 480, 503, 307, 435, 353, 293, 184, 
186, 420, 362, 373, 380, 2, 2, 1, 1, 2, 4, 2, 2, 2), numWeek = c("2000-01-03", 
"2000-02-14", "2000-02-28", "2000-03-13", "2000-04-10", "2000-05-01", 
"2000-05-08", "2000-05-15", "2000-05-22", "2000-05-29", "2000-06-05", 
"2000-06-12", "2000-06-19", "2000-06-26", "2000-07-03", "2000-07-10", 
"2000-07-17", "2000-07-31", "2000-08-07", "2000-08-14", "2000-08-21", 
"2000-08-28", "2000-09-04", "2000-09-11", "2000-09-18", "2000-09-25", 
"2000-10-02", "2000-10-09", "2000-10-16", "2000-10-23", "2000-10-30", 
"2000-11-06", "2000-11-13", "2000-11-20", "2000-11-27", "2000-12-04", 
"2000-12-11", "2000-12-18", "2000-12-25", "2001-01-01", "2001-01-08", 
"2001-01-15", "2001-01-22", "2001-01-29", "2001-02-05", "2001-02-12", 
"2001-02-19", "2001-02-26", "2001-03-05", "2001-03-12", "2001-03-19", 
"2001-03-26", "2001-04-02", "2001-04-09", "2001-04-16", "2001-04-23", 
"2001-04-30", "2001-05-07", "2001-05-14", "2001-05-21", "2001-05-28", 
"2001-06-04", "2001-06-11", "2001-06-18", "2001-06-25", "2001-07-02", 
"2001-07-09", "2001-07-16", "2001-07-23", "2001-07-30", "2001-08-06", 
"2001-08-13", "2001-08-20", "2001-08-27", "2001-09-03", "2001-09-10", 
"2001-09-17", "2001-09-24", "2001-10-01", "2001-10-08", "2001-10-15", 
"2001-10-22", "2001-10-29", "2001-11-05", "2001-11-12", "2001-11-19", 
"2001-11-26", "2001-12-03", "2001-12-10", "2001-12-17", "2001-12-24", 
"2001-12-31", "2002-01-07", "2002-01-14", "2002-01-21", "2002-01-28", 
"2002-02-04", "2002-02-11", "2002-02-18", "2002-02-25", "2002-03-04", 
"2002-03-11", "2002-03-18", "2002-03-25", "2002-04-01", "2002-04-08", 
"2002-04-15", "2002-04-22", "2002-04-29", "2002-05-06", "2002-05-13", 
"2002-05-20", "2002-05-27", "2002-06-03", "2002-06-10", "2002-06-17", 
"2002-06-24", "2002-07-01", "2002-07-08", "2002-07-15", "2002-07-22", 
"2002-07-29", "2002-08-05", "2002-08-12", "2002-08-19", "2002-08-26", 
"2002-09-02", "2002-09-09", "2002-09-16", "2002-09-23", "2002-09-30", 
"2002-10-07", "2002-10-14", "2002-10-21", "2002-10-28", "2002-11-04", 
"2002-11-11", "2002-11-18", "2002-11-25", "2002-12-02", "2002-12-09", 
"2002-12-16", "2002-12-23", "2002-12-30", "2003-01-06", "2003-01-13", 
"2003-01-20", "2003-01-27", "2003-02-03", "2003-02-10", "2003-02-17", 
"2003-02-24", "2003-03-03", "2003-03-10", "2003-03-17", "2003-03-24", 
"2003-03-31", "2003-04-07", "2003-04-14", "2003-04-21", "2003-04-28", 
"2003-05-05", "2003-05-12", "2003-05-19", "2003-05-26", "2003-06-02", 
"2003-06-09", "2003-06-16", "2003-06-23", "2003-06-30", "2003-07-07", 
"2003-07-14", "2003-07-21", "2003-07-28", "2003-08-04", "2003-08-11", 
"2003-08-18", "2003-08-25", "2003-09-01", "2003-09-08", "2003-09-15", 
"2003-09-22", "2003-09-29", "2003-10-06", "2003-10-13", "2003-10-20", 
"2003-10-27", "2003-11-03", "2003-11-10", "2003-11-17", "2003-11-24", 
"2003-12-01", "2003-12-08", "2003-12-15", "2003-12-22", "2003-12-29", 
"2004-01-05", "2004-01-12", "2004-01-19", "2004-01-26", "2004-02-02", 
"2004-02-09", "2004-02-16", "2004-02-23", "2004-03-01", "2004-03-08", 
"2004-03-15", "2004-03-22", "2004-03-29", "2004-04-05", "2004-04-12", 
"2004-04-19", "2004-04-26", "2004-05-03", "2004-05-10", "2004-05-17", 
"2004-05-24", "2004-05-31", "2004-06-07", "2004-06-14", "2004-06-21", 
"2004-06-28", "2004-07-05", "2004-07-12", "2004-07-19", "2004-07-26", 
"2004-08-02", "2004-08-09", "2004-08-16", "2004-08-23", "2004-08-30", 
"2004-09-06", "2004-09-13", "2004-09-20", "2004-09-27", "2004-10-04", 
"2004-10-11", "2004-10-18", "2004-10-25", "2004-11-01", "2004-11-08", 
"2004-11-15", "2004-11-22", "2004-11-29", "2004-12-06", "2004-12-13", 
"2004-12-20", "2004-12-27", "2005-01-03", "2005-01-10", "2005-01-17", 
"2005-01-24", "2005-01-31", "2005-02-07", "2005-02-14", "2005-02-21", 
"2005-02-28", "2005-03-07", "2005-03-14", "2005-03-21", "2005-03-28", 
"2005-04-04", "2005-04-11", "2005-04-18", "2005-04-25", "2005-05-02", 
"2005-05-09", "2005-05-16", "2005-05-23", "2005-05-30", "2005-06-06", 
"2005-06-13", "2005-06-20", "2005-06-27", "2005-07-04", "2005-07-11", 
"2005-07-18", "2005-07-25", "2005-08-01", "2005-08-08", "2005-08-15", 
"2005-08-22", "2005-08-29", "2005-09-05", "2005-09-12", "2005-09-19", 
"2005-09-26", "2005-10-03", "2005-10-10", "2005-10-17", "2005-10-24", 
"2005-10-31", "2005-11-07", "2005-11-14", "2005-11-21", "2005-11-28", 
"2005-12-05", "2005-12-12", "2005-12-19", "2005-12-26", "2006-01-02", 
"2006-01-09", "2006-01-16", "2006-01-23", "2006-01-30", "2006-02-06", 
"2006-02-13", "2006-02-20", "2006-02-27", "2006-03-06", "2006-03-13", 
"2006-03-20", "2006-03-27", "2006-04-03", "2006-04-10", "2006-04-17", 
"2006-04-24", "2006-05-01", "2006-05-08", "2006-05-15", "2006-05-22", 
"2006-05-29", "2006-06-05", "2006-06-12", "2006-06-19", "2006-06-26", 
"2006-07-03", "2006-07-10", "2006-07-17", "2006-07-24", "2006-07-31", 
"2006-08-07", "2006-08-14", "2006-08-21", "2006-08-28", "2006-09-04", 
"2006-09-11", "2006-09-18", "2006-09-25", "2006-10-02", "2006-10-09", 
"2006-10-16", "2006-10-23", "2006-10-30", "2006-11-06", "2006-11-13", 
"2006-11-20", "2006-11-27", "2006-12-04", "2006-12-11", "2006-12-18", 
"2006-12-25", "2007-01-01", "2007-01-08", "2007-01-15", "2007-01-22", 
"2007-01-29", "2007-02-05", "2007-02-12", "2007-02-19", "2007-02-26", 
"2007-03-05", "2007-03-12", "2007-03-19", "2007-03-26", "2007-04-02", 
"2007-04-09", "2007-04-16", "2007-04-23", "2007-04-30", "2007-05-07", 
"2007-05-14", "2007-05-21", "2007-05-28", "2007-06-04", "2007-06-11", 
"2007-06-18", "2007-06-25", "2007-07-02", "2007-07-09", "2007-07-16", 
"2007-07-23", "2007-07-30", "2007-08-06", "2007-08-13", "2007-08-20", 
"2007-08-27", "2007-09-03", "2007-09-10", "2007-09-17", "2007-09-24", 
"2007-10-01", "2007-10-08", "2007-10-15", "2007-10-22", "2007-10-29", 
"2007-11-05", "2007-11-12", "2007-11-19", "2007-11-26", "2007-12-03", 
"2007-12-10", "2007-12-17", "2007-12-24", "2007-12-31", "2008-01-07", 
"2008-01-14", "2008-01-21", "2008-01-28", "2008-02-04", "2008-02-11", 
"2008-02-18", "2008-02-25", "2008-03-03", "2008-03-10", "2008-03-17", 
"2008-03-24", "2008-03-31", "2008-04-07", "2008-04-14", "2008-04-21", 
"2008-04-28", "2008-05-05", "2008-05-12", "2008-05-19", "2008-05-26", 
"2008-06-02", "2008-06-09", "2008-06-16", "2008-06-23", "2008-06-30", 
"2008-07-07", "2008-07-14", "2008-07-21", "2008-07-28", "2008-08-04", 
"2008-08-11", "2008-08-18", "2008-08-25", "2008-09-01", "2008-09-08", 
"2008-09-15", "2008-09-22", "2008-09-29", "2008-10-06", "2008-10-13", 
"2008-10-20", "2008-10-27", "2008-11-03", "2008-11-10", "2008-11-17", 
"2008-11-24", "2008-12-01", "2008-12-08", "2008-12-15", "2008-12-22", 
"2008-12-29", "2009-01-05", "2009-01-12", "2009-01-19", "2009-01-26", 
"2009-02-02", "2009-02-09", "2009-02-16", "2009-02-23", "2009-03-02", 
"2009-03-09", "2009-03-16", "2009-03-23", "2009-03-30", "2009-04-06", 
"2009-04-13", "2009-04-20", "2009-04-27", "2009-05-04", "2009-05-11", 
"2009-05-18", "2009-05-25", "2009-06-01", "2009-06-08", "2009-06-15", 
"2009-06-22", "2009-06-29", "2009-07-06", "2009-07-13", "2009-07-20", 
"2009-07-27", "2009-08-03", "2009-08-10", "2009-08-17", "2009-08-24", 
"2009-08-31", "2009-09-07", "2009-09-14", "2009-09-21", "2009-09-28", 
"2009-10-05", "2009-10-12", "2009-10-19", "2009-10-26", "2009-11-02", 
"2009-11-09", "2009-11-16", "2009-11-23", "2009-11-30", "2009-12-07", 
"2009-12-14", "2009-12-21", "2009-12-28", "2010-01-04", "2010-01-11", 
"2010-01-18", "2010-01-25", "2010-02-01", "2010-02-08", "2010-02-15", 
"2010-02-22", "2010-03-01", "2010-03-08", "2010-03-15", "2010-03-22", 
"2010-03-29", "2010-04-05", "2010-04-12", "2010-04-19", "2010-04-26", 
"2010-05-03", "2010-05-10", "2010-05-17", "2010-05-24", "2010-05-31", 
"2010-06-07", "2010-06-14", "2010-06-21", "2010-06-28", "2010-07-05", 
"2010-07-12", "2010-07-19", "2010-07-26", "2010-08-02", "2010-08-09", 
"2010-08-16", "2010-08-23", "2010-08-30", "2010-09-06", "2010-09-13", 
"2010-09-20", "2010-09-27", "2010-10-04", "2010-10-11", "2010-10-18", 
"2010-10-25", "2010-11-01", "2010-11-08", "2010-11-15", "2010-11-22", 
"2010-11-29", "2010-12-06", "2010-12-13", "2010-12-20", "2010-12-27", 
"2011-01-03", "2011-01-10", "2011-01-17", "2011-01-24", "2011-01-31", 
"2011-02-07", "2011-02-14", "2011-02-21", "2011-02-28", "2011-03-07", 
"2011-03-14", "2011-03-21", "2011-03-28", "2011-04-04", "2011-04-11", 
"2011-04-18", "2011-04-25", "2011-05-02", "2011-05-09", "2011-05-16", 
"2011-05-23", "2011-05-30", "2011-06-06", "2011-06-13", "2011-06-20", 
"2011-06-27", "2011-07-04", "2011-07-11", "2011-07-18", "2011-07-25", 
"2011-08-01", "2011-08-08", "2011-08-15", "2011-08-22", "2011-08-29", 
"2011-09-05", "2011-09-12", "2011-09-19", "2011-09-26", "2011-10-03", 
"2011-10-10", "2011-10-17", "2011-10-24", "2011-10-31", "2011-11-07", 
"2011-11-14", "2011-11-21", "2011-11-28", "2011-12-05", "2011-12-12", 
"2011-12-19", "2011-12-26", "2012-01-02", "2012-01-09", "2012-01-16", 
"2012-01-23", "2012-01-30", "2012-02-06", "2012-02-13", "2012-02-20", 
"2012-02-27", "2012-03-05", "2012-03-12", "2012-03-19", "2012-03-26", 
"2012-04-02", "2012-04-09", "2012-04-16", "2012-04-23", "2012-04-30", 
"2012-05-07", "2012-05-14", "2012-05-21", "2012-05-28", "2012-06-04", 
"2012-06-11", "2012-06-18", "2012-06-25", "2012-07-02", "2012-07-09", 
"2012-07-16", "2012-07-23", "2012-07-30", "2012-08-06", "2012-08-13", 
"2012-08-20", "2012-08-27", "2012-09-03", "2012-09-10", "2012-09-17", 
"2012-09-24", "2012-10-01", "2012-10-08", "2012-10-15", "2012-10-22", 
"2012-10-29", "2012-11-05", "2012-11-12", "2012-11-19", "2012-11-26", 
"2012-12-03", "2012-12-10", "2012-12-17", "2012-12-24", "2012-12-31", 
"2013-01-07", "2013-01-14", "2013-01-21", "2013-01-28", "2013-02-04", 
"2013-02-11", "2013-02-18", "2013-02-25", "2013-03-04", "2013-03-11", 
"2013-03-18", "2013-03-25", "2013-04-01", "2013-04-08", "2013-04-15", 
"2013-04-22", "2013-04-29", "2013-05-06", "2013-05-13", "2013-05-20", 
"2013-05-27", "2013-06-03", "2013-06-10", "2013-06-17", "2013-06-24", 
"2013-07-01", "2013-07-08", "2013-07-15", "2013-07-22", "2013-07-29", 
"2013-08-05", "2013-08-12", "2013-08-19", "2013-08-26", "2013-09-02", 
"2013-09-09", "2013-09-16", "2013-09-23", "2013-09-30", "2013-10-07", 
"2013-10-14", "2013-10-21", "2013-10-28", "2013-11-04", "2013-11-11", 
"2013-11-18", "2013-11-25", "2013-12-02", "2013-12-09", "2013-12-16", 
"2013-12-23", "2013-12-30", "2014-01-06", "2014-01-13", "2014-01-20", 
"2014-01-27", "2014-02-03", "2014-02-10", "2014-02-17", "2014-02-24", 
"2014-03-03", "2014-03-10", "2014-03-17", "2014-03-24", "2014-03-31", 
"2014-04-07", "2014-04-14", "2014-04-21", "2014-04-28", "2014-05-05", 
"2014-05-12", "2014-05-19", "2014-05-26", "2014-06-02", "2014-06-09", 
"2014-06-16", "2014-06-23", "2014-06-30", "2014-07-07", "2014-07-14", 
"2014-07-21", "2014-07-28", "2014-08-04", "2014-08-11", "2014-08-18", 
"2014-08-25", "2014-09-01", "2014-09-08", "2014-09-15", "2014-09-22", 
"2014-09-29", "2014-10-06", "2014-10-13", "2014-10-20", "2014-10-27", 
"2014-11-03", "2014-11-10", "2014-11-17", "2014-11-24", "2014-12-01", 
"2014-12-08", "2014-12-15", "2014-12-22", "2014-12-29", "2015-01-05", 
"2015-01-12", "2015-01-19", "2015-01-26", "2015-02-02", "2015-02-09", 
"2015-02-16", "2015-02-23", "2015-03-02", "2015-03-09", "2015-03-16", 
"2015-03-23", "2015-03-30", "2015-04-06", "2015-04-13", "2015-04-20", 
"2015-04-27", "2015-05-04", "2015-05-11", "2015-05-18", "2015-05-25", 
"2015-06-01", "2015-06-08", "2015-06-15", "2015-06-22", "2015-06-29", 
"2015-07-06", "2015-07-13", "2015-07-20", "2015-07-27", "2015-08-03", 
"2015-08-10", "2015-08-17", "2015-08-24", "2015-08-31", "2015-09-07", 
"2015-09-14", "2015-09-21", "2015-09-28", "2015-10-05", "2015-10-12", 
"2015-10-19", "2015-10-26", "2015-11-02", "2015-11-09", "2015-11-16", 
"2015-11-23", "2015-11-30", "2015-12-07", "2015-12-14", "2015-12-21", 
"2015-12-28", "2016-01-04", "2016-01-11", "2016-01-18", "2016-01-25", 
"2016-02-01", "2016-02-08", "2016-02-15", "2016-02-22", "2016-02-29", 
"2016-03-07", "2016-03-14", "2016-03-21", "2016-03-28", "2016-04-04", 
"2016-04-11", "2016-04-18", "2016-04-25", "2016-05-02", "2016-05-09", 
"2016-05-16", "2016-05-23", "2016-05-30", "2016-06-06", "2016-06-13", 
"2016-06-20", "2016-06-27", "2016-07-04", "2016-07-11", "2016-07-18", 
"2016-07-25", "2016-08-01", "2016-08-08", "2016-08-15", "2016-08-22", 
"2016-08-29", "2016-09-05", "2016-09-12", "2016-09-19", "2016-09-26", 
"2016-10-24", "2016-11-07", "2016-11-21", "2016-12-05", "2016-12-12", 
"2016-12-19", "2016-12-26")), .Names = c("effective", "numWeek"
), row.names = c(NA, 868L), class = "data.frame")

rdf2

structure(list(numWeek = structure(c(10959, 10966, 10973, 10980, 
10987, 10994, 11001, 11008, 11015, 11022, 11029, 11036, 11043, 
11050, 11057, 11064, 11071, 11078, 11085, 11092, 11099, 11106, 
11113, 11120, 11127, 11134, 11141, 11148, 11155, 11162, 11169, 
11176, 11183, 11190, 11197, 11204, 11211, 11218, 11225, 11232, 
11239, 11246, 11253, 11260, 11267, 11274, 11281, 11288, 11295, 
11302, 11309, 11316, 11323, 11330, 11337, 11344, 11351, 11358, 
11365, 11372, 11379, 11386, 11393, 11400, 11407, 11414, 11421, 
11428, 11435, 11442, 11449, 11456, 11463, 11470, 11477, 11484, 
11491, 11498, 11505, 11512, 11519, 11526, 11533, 11540, 11547, 
11554, 11561, 11568, 11575, 11582, 11589, 11596, 11603, 11610, 
11617, 11624, 11631, 11638, 11645, 11652, 11659, 11666, 11673, 
11680, 11687, 11694, 11701, 11708, 11715, 11722, 11729, 11736, 
11743, 11750, 11757, 11764, 11771, 11778, 11785, 11792, 11799, 
11806, 11813, 11820, 11827, 11834, 11841, 11848, 11855, 11862, 
11869, 11876, 11883, 11890, 11897, 11904, 11911, 11918, 11925, 
11932, 11939, 11946, 11953, 11960, 11967, 11974, 11981, 11988, 
11995, 12002, 12009, 12016, 12023, 12030, 12037, 12044, 12051, 
12058, 12065, 12072, 12079, 12086, 12093, 12100, 12107, 12114, 
12121, 12128, 12135, 12142, 12149, 12156, 12163, 12170, 12177, 
12184, 12191, 12198, 12205, 12212, 12219, 12226, 12233, 12240, 
12247, 12254, 12261, 12268, 12275, 12282, 12289, 12296, 12303, 
12310, 12317, 12324, 12331, 12338, 12345, 12352, 12359, 12366, 
12373, 12380, 12387, 12394, 12401, 12408, 12415, 12422, 12429, 
12436, 12443, 12450, 12457, 12464, 12471, 12478, 12485, 12492, 
12499, 12506, 12513, 12520, 12527, 12534, 12541, 12548, 12555, 
12562, 12569, 12576, 12583, 12590, 12597, 12604, 12611, 12618, 
12625, 12632, 12639, 12646, 12653, 12660, 12667, 12674, 12681, 
12688, 12695, 12702, 12709, 12716, 12723, 12730, 12737, 12744, 
12751, 12758, 12765, 12772, 12779, 12786, 12793, 12800, 12807, 
12814, 12821, 12828, 12835, 12842, 12849, 12856, 12863, 12870, 
12877, 12884, 12891, 12898, 12905, 12912, 12919, 12926, 12933, 
12940, 12947, 12954, 12961, 12968, 12975, 12982, 12989, 12996, 
13003, 13010, 13017, 13024, 13031, 13038, 13045, 13052, 13059, 
13066, 13073, 13080, 13087, 13094, 13101, 13108, 13115, 13122, 
13129, 13136, 13143, 13150, 13157, 13164, 13171, 13178, 13185, 
13192, 13199, 13206, 13213, 13220, 13227, 13234, 13241, 13248, 
13255, 13262, 13269, 13276, 13283, 13290, 13297, 13304, 13311, 
13318, 13325, 13332, 13339, 13346, 13353, 13360, 13367, 13374, 
13381, 13388, 13395, 13402, 13409, 13416, 13423, 13430, 13437, 
13444, 13451, 13458, 13465, 13472, 13479, 13486, 13493, 13500, 
13507, 13514, 13521, 13528, 13535, 13542, 13549, 13556, 13563, 
13570, 13577, 13584, 13591, 13598, 13605, 13612, 13619, 13626, 
13633, 13640, 13647, 13654, 13661, 13668, 13675, 13682, 13689, 
13696, 13703, 13710, 13717, 13724, 13731, 13738, 13745, 13752, 
13759, 13766, 13773, 13780, 13787, 13794, 13801, 13808, 13815, 
13822, 13829, 13836, 13843, 13850, 13857, 13864, 13871, 13878, 
13885, 13892, 13899, 13906, 13913, 13920, 13927, 13934, 13941, 
13948, 13955, 13962, 13969, 13976, 13983, 13990, 13997, 14004, 
14011, 14018, 14025, 14032, 14039, 14046, 14053, 14060, 14067, 
14074, 14081, 14088, 14095, 14102, 14109, 14116, 14123, 14130, 
14137, 14144, 14151, 14158, 14165, 14172, 14179, 14186, 14193, 
14200, 14207, 14214, 14221, 14228, 14235, 14242, 14249, 14256, 
14263, 14270, 14277, 14284, 14291, 14298, 14305, 14312, 14319, 
14326, 14333, 14340, 14347, 14354, 14361, 14368, 14375, 14382, 
14389, 14396, 14403, 14410, 14417, 14424, 14431, 14438, 14445, 
14452, 14459, 14466, 14473, 14480, 14487, 14494, 14501, 14508, 
14515, 14522, 14529, 14536, 14543, 14550, 14557, 14564, 14571, 
14578, 14585, 14592, 14599, 14606, 14613, 14620, 14627, 14634, 
14641, 14648, 14655, 14662, 14669, 14676, 14683, 14690, 14697, 
14704, 14711, 14718, 14725, 14732, 14739, 14746, 14753, 14760, 
14767, 14774, 14781, 14788, 14795, 14802, 14809, 14816, 14823, 
14830, 14837, 14844, 14851, 14858, 14865, 14872, 14879, 14886, 
14893, 14900, 14907, 14914, 14921, 14928, 14935, 14942, 14949, 
14956, 14963, 14970, 14977, 14984, 14991, 14998, 15005, 15012, 
15019, 15026, 15033, 15040, 15047, 15054, 15061, 15068, 15075, 
15082, 15089, 15096, 15103, 15110, 15117, 15124, 15131, 15138, 
15145, 15152, 15159, 15166, 15173, 15180, 15187, 15194, 15201, 
15208, 15215, 15222, 15229, 15236, 15243, 15250, 15257, 15264, 
15271, 15278, 15285, 15292, 15299, 15306, 15313, 15320, 15327, 
15334, 15341, 15348, 15355, 15362, 15369, 15376, 15383, 15390, 
15397, 15404, 15411, 15418, 15425, 15432, 15439, 15446, 15453, 
15460, 15467, 15474, 15481, 15488, 15495, 15502, 15509, 15516, 
15523, 15530, 15537, 15544, 15551, 15558, 15565, 15572, 15579, 
15586, 15593, 15600, 15607, 15614, 15621, 15628, 15635, 15642, 
15649, 15656, 15663, 15670, 15677, 15684, 15691, 15698, 15705, 
15712, 15719, 15726, 15733, 15740, 15747, 15754, 15761, 15768, 
15775, 15782, 15789, 15796, 15803, 15810, 15817, 15824, 15831, 
15838, 15845, 15852, 15859, 15866, 15873, 15880, 15887, 15894, 
15901, 15908, 15915, 15922, 15929, 15936, 15943, 15950, 15957, 
15964, 15971, 15978, 15985, 15992, 15999, 16006, 16013, 16020, 
16027, 16034, 16041, 16048, 16055, 16062, 16069, 16076, 16083, 
16090, 16097, 16104, 16111, 16118, 16125, 16132, 16139, 16146, 
16153, 16160, 16167, 16174, 16181, 16188, 16195, 16202, 16209, 
16216, 16223, 16230, 16237, 16244, 16251, 16258, 16265, 16272, 
16279, 16286, 16293, 16300, 16307, 16314, 16321, 16328, 16335, 
16342, 16349, 16356, 16363, 16370, 16377, 16384, 16391, 16398, 
16405, 16412, 16419, 16426, 16433, 16440, 16447, 16454, 16461, 
16468, 16475, 16482, 16489, 16496, 16503, 16510, 16517, 16524, 
16531, 16538, 16545, 16552, 16559, 16566, 16573, 16580, 16587, 
16594, 16601, 16608, 16615, 16622, 16629, 16636, 16643, 16650, 
16657, 16664, 16671, 16678, 16685, 16692, 16699, 16706, 16713, 
16720, 16727, 16734, 16741, 16748, 16755, 16762, 16769, 16776, 
16783, 16790, 16797, 16804, 16811, 16818, 16825, 16832, 16839, 
16846, 16853, 16860, 16867, 16874, 16881, 16888, 16895, 16902, 
16909, 16916, 16923, 16930, 16937, 16944, 16951, 16958, 16965, 
16972, 16979, 16986, 16993, 17000, 17007, 17014, 17021, 17028, 
17035, 17042, 17049, 17056, 17063, 17070, 17077, 17084, 17091, 
17098, 17105, 17112, 17119, 17126, 17133, 17140, 17147, 17154, 
17161), class = "Date")), .Names = "numWeek", row.names = c(NA, 
-887L), class = "data.frame")

0 个答案:

没有答案