I want to subset a dataframe with .id values specified but it gives me this error:
Warning in .id == c(3, 5:12, 14, 20:64, 66:72, 75, 78:79, 81:111, 113:136, :
longer object length is not a multiple of shorter object length
when using this code:
newdatarev = subset(newdata, .id == c(3,5:12,14,20:64,66:72,75,78:79,81:111,113:136,138:149,151:160,
162:183,185:225,227:233,235:247,249,251:264,266:328,330:364,366:383,
385:411,413:471,473:490,492:580,582:598,600:603,605:606,608:619,621:646,
648:686,688:718,720:746,748,750:753,755:762,764:861,863:875,877:894,
897:911,913:914,916:926,928:941))
For reference, here is a small bit of newdata:
> newdata
.id V1 V2
1: 1 -2.870109 8273.632
2: 1 4.829891 8273.632
3: 1 21.329891 8279.132
4: 1 25.729891 8281.332
5: 1 32.329891 8285.732
---
17937: 941 1834.113417 1411.605
17938: 941 1818.713417 1392.905
17939: 941 1814.313417 1386.305
17940: 941 1814.313417 1364.305
17941: 941 1828.613417 1224.605
I have a feeling it has to do with how .id is structured and me using the code interferes with how it interprets the rows vs. .id values that overlap. It does get me a result of a very strange recollection of data here:
> newdatarev
.id V1 V2
1: 55 158.8030 2045.753
2: 100 227.7387 8250.454
3: 153 356.8675 1383.835
4: 205 483.6464 3946.844
5: 299 635.8744 8387.862
6: 347 722.9303 5147.715
7: 393 850.1742 2115.559
8: 439 857.9288 8243.071
9: 482 926.5706 1608.928
10: 532 1107.8380 2616.635
11: 632 1234.6482 4957.055
12: 633 1201.8700 3252.570
13: 683 1315.2215 2068.050
14: 684 1325.5905 6253.692
15: 734 1414.3443 2267.337
16: 784 1551.0153 5184.641
17: 831 1634.2056 7159.362
18: 880 1724.5570 5726.908
19: 933 1879.6398 3465.536
Thank you in advance!