[R] wireframe advice - with reproducible code

Chris Mcowen chrismcowen at gmail.com
Mon May 16 14:40:41 CEST 2011


Dear List,

i am trying to produce a 3d plot using wireframe using the code:

wireframe(Residuals_FD ~ Elevation * Temperature, data = data2, scales = list(arrows = FALSE), drape = TRUE, colorkey = TRUE)

As you can see when the code (using the data below) is run the plot area is set-up correctly but the actual surface is missing?

Any help would be greatly appreciated.

Chris

#data
Elevation <- c(121.07, 1464.41, 1166.77, 237.22, 370.76, 205.16, 558.46, 314.08, 
298.95, 784.84, 39.96, 112.22, 218.95, 1034.05, 267.85, 1048.41, 
204.46, 153.54, 414.69, 378.67, 114.23, 494.98, 394.87, 573.9, 
121.64, 320.05, 81.87, 142.25, 229.18, 258.99, 257.2, 473.96, 
216.92, 201.18, 1102.58, 3155.11, 1067.99, 258.62, 109.43, 109.85, 
97.82, 304.42, 228.18, 598.87, 399.75, 378.13, 346.74, 125.91, 
200.79, 484.4, 9.2, 1667.28, 300.63, 1238.19, 444.79, 470.39, 
394.79, 1980.41, 1358.6, 394.57, 195.51, 1505.08, 759.22, 212.87, 
495.54, 1015.46, 90.1, 610.36, 168.21, 643.33, 119.3, 510.55, 
347.99, 153.39, 249.65, 230.48, 1107.77, 1232.41, 1164.78, 1166.12, 
595.82, 565.82, 272.05, 1083.03, 877.93, 674.66, 433.06, 1452.49, 
597.18, 1195.78, 1024.62, 656.02, 898.29, 1208.8, 311.28, 598.52, 
523.08, 1083.72, 383.87, 1001.86, 668.11, 336.7, 2417.55, 1258.74, 
3028.61, 1326.89, 2119.13, 2903.13, 1503.51, 1047.67, 1927.01, 
665.66, 694.24, 1461.29, 505.42, 170.09, 790.19, 1064.46, 274.9, 
135.42, 1184.03, 408.54, 490.52, 1051.23, 993.95, 1781.11, 573.77, 
16.28, 27.18, 47.23, 206.54, 767.88, 55.26, 116.99, 248.15, 22.37, 
113.92, 400.58, 816.91, 144.56, 222.1, 563.57, 215.53, 412.66, 
711.04, 42.86, 761.08, 857.34, 219.8, 58.14, 494.69, 234.18, 
371.63, 521.79, 78.62, 405.94, 543.53, 473.38, 1107.79, 491.64, 
908.54, 786.44, 131.85, 195.95, 553.93, 732.91, 305.2, 1306.52, 
169.72, 1133.22, 14.79, 74.49, 6.89, 218.9, 157.4, 771.3, 132.15, 
316.83, 193.75, 812.17, 360.14, 178.55, 314.84, 34.16, 161.63, 
346.12, 402.57, 298.17, 480.07, 263.13, 214.64, 98.41, 1329.15, 
1350.98, 1387.47, 1592.66, 2227.23, 3087.27, 1994.45, 158.11, 
1345.62, 454.73, 163.56, 4.18, 7.83, 18.3, 10.02, 205.08, 1948.43, 
1652.97, 464.08, 493.63, 219.47, 109.81, 177.54, 261.72, 107.95, 
145.57, 251.26, 1339.11, 2721.05, 939.14, 25.2, 72.98, 1889.41, 
2211.03, 41.87, 2465.14, 337.95, 12.14, 246.97, 494.84, 154.31, 
1198.47, 255.11, 576.84, 435.31, 2074.98, 1271.05, 1848.82, 1800.84, 
432.04, 204.12, 1980.02, 801.85, 6.71, 260.18, 605.01, 1421.51, 
229.25, 228.27, 1886.61, 294.74, 1631.89, 1287.22, 147.03, 750.87, 
1485.31, 583.1, 244.86, 1736.33, 628.12, 13.6, 884.42, 173.77, 
290.38, 163.02, 183.02, 326.05, 376.81, 80.03, 81.56, 165.54, 
1654.53, 90.66, 116.07, 302.06, 48.19, 243.18, 146.72, 1645.2, 
1467.84, 11.32, 424.5, 173.38, 2557.5, 255.41, 265.21, 87.83, 
136.34, 503.13, 312.44, 629.45, 103.27, 2, 1375.81, 249.6, 1428.07, 
204.77, 1390.9, 90.57, 92.67, 167.74, 500, 1341.82, 182.35, 192.4, 
81.25, 537.6, 199.61, 547.22, 1782.11, 946, 2590.27, 826.03, 
244.49, 315.76, 754.29, 301.21, 66.82, 200.8, 209.52, 611.82, 
1610.77, 80.83, 75.09, 172.17, 409.62, 448.62, 156.54, 4.8, 155.45, 
1114.35, 112.01, 1161.57, 1644.94, 1563.52, 2074.74, 373.61, 
813.23, 195.79, 1109.61, 514.82, 353.14, 71.2, 142.34, 141.8, 
190.29, 421.75, 97.71, 637.67, 77.95, 146.97, 71.67, 3987.24, 
3946.17, 4201.51, 3528.91, 3590.15, 3594.9, 1819.83, 977.78, 
175.99, 422.61, 286.2, 1861.01, 2139.69, 5.44, 13.04, 6.43, 33.19, 
25.73, 14.36, 144.22, 216.86, 660.25, 355.45, 168.24, 820.17, 
920.08, 1829.84, 393.29, 574.2, 1018.8, 1639.87, 1230.29, 980.85, 
168.89, 227.14, 113.49, 793.65, 972.04, 1436.38, 148.3, 518.26, 
234.32, 1225, 957.62, 244.06, 667.58, 1624.85, 1421.9, 743.71, 
1884.33, 3671.21, 911.76, 3865.85, 1323.31, 3672.57, 3236.9, 
2595.02, 352.35, 180.23, 1808.39, 1717.65, 467.81, 935.51, 120.01, 
1639.72, 4793.9, 4535.31, 4497.12, 784.23, 1793.19, 4095.15, 
4078.37, 2745.93, 4652.81, 4534.94, 323.33, 699.56, 347.55, 516.15, 
305.46, 525.77, 631.81, 396.65, 358.01, 846.5, 690.07, 419.91, 
967.36, 908.45, 1307.22, 177.27, 305.77, 495.11, 1117.47, 2054.31, 
250.01, 1202.26, 418.19, 366.41, 1864.87, 725.19, 874.78, 432.05, 
563.96)

Temperature <- 
c(26.61, 21.33, 21.68, 25.75, 22.01, 26.37, 24.83, 22.65, 25.71, 
23.59, 26.48, 26.11, 25.53, 22.59, 24.11, 22.57, 26.16, 22.82, 
17.21, 11.72, 14.22, 10.46, 13.86, 9.17, 27.01, 20.92, 26.21, 
26.3, 26.97, 24.27, 26.63, 9.3, 21.02, 18.03, 9.68, 14.97, 7.14, 
16.58, 15.72, 18.25, 16.77, 19, 15.98, 21.04, 24.66, 19.72, 25.29, 
22.44, 19.02, 21.92, 26.6, 18.92, 25.04, 21.52, 24.93, 22.82, 
25.07, 17.19, 19.97, 25.12, 26.41, 21.16, 23.46, 19.69, 21.81, 
19.94, 22.65, 20.75, 26.7, 24.26, 26.5, 24.37, 23.82, 24.5, 25.27, 
24.84, 21.9, 20.89, 21.24, 21.76, 26.21, 23.63, 26.48, 21.53, 
24.31, 24.81, 28.26, 20.53, 25.98, 21.68, 20.1, 24.42, 21.53, 
21.82, 27.8, 23.52, 23.13, 22.06, 28.25, 22.42, 22.58, 23.66, 
9.87, 15.88, 9.7, 18.11, 17.82, 13.67, 16.08, 23.12, 16.62, 17.99, 
22.58, 19.26, 17.27, 17.05, 15.73, 24.23, 26.82, 27.19, 20.04, 
22.35, 27.02, 17.54, 24.8, 20.96, 16.81, 25.53, 26.86, 26.66, 
26.09, 23.77, 26.78, 23.53, 26.33, 28.24, 27.22, 25.84, 24.1, 
26.79, 26.63, 21.46, 25.63, 18.15, 23.68, 25.43, 23.54, 23.3, 
26.02, 27.06, 22.07, 26.12, 25.41, 22.51, 26.35, 25.66, 24.72, 
24.02, 20.6, 25.04, 19.92, 24.26, 26.51, 22.22, 24.93, 23.73, 
25.66, 20.67, 26.54, 23.22, 27.1, 26.87, 26.23, 26.32, 25.29, 
24.24, 26.55, 23.71, 20.79, 19.07, 27.21, 26.7, 25.11, 28.51, 
26.5, 25.77, 25.65, 26.17, 26.13, 25.92, 25.41, 27.27, 17.43, 
20.43, 17.58, 15.73, 11.57, 7.67, 13.4, 24.1, 21.85, 26.75, 25.47, 
28.26, 27.27, 26.84, 27.14, 8.87, 15.91, 18.42, 7.47, 11.71, 
13.55, 19.53, 6, 4.7, 9.53, 16.03, 9.19, 6.26, 3.16, 9.48, 16.37, 
18.11, 8.12, 3.6, 19.87, 4.25, -0.18, 20.94, 12.98, 18.89, 18.9, 
12.38, 3.42, -6.37, 14.06, 16.96, 17.66, 9.66, 18.15, 22.39, 
22.26, 5.27, 17.58, 21.25, 23.61, 21.88, 20.81, 25.77, 26.65, 
18.36, 25.04, 20.1, 20.89, 25.98, 23.07, 19.78, 24.76, 24.71, 
18.2, 24.4, 0, 22.96, 26.05, 24.61, 26.29, 25.63, 24.71, 24.89, 
26.39, 26.11, 26.23, 19.31, 27.54, 26.98, 25.51, 26.82, 25.68, 
26.56, 18.91, 18.17, 26.57, 21.66, 24.25, 14.91, 24.94, 24.06, 
26.46, 26.35, 19.59, 24.1, 23.99, 26.22, 23.65, 18.56, 25.49, 
19.71, 25.75, 20.4, 26.71, 25.97, 26.62, 25.09, 20.71, 24.68, 
26.04, 25.62, 24.74, 26.61, 24.53, 18.8, 24.39, 15.41, 23.42, 
25.8, 22.19, 23.31, 25.43, 25.22, 24.34, 25.33, 25.71, 17.7, 
26.47, 24.23, 27.13, 25.37, 22.72, 25.22, 24.52, 25.25, 21.37, 
24.93, 19.77, 18.73, 20.33, 17.05, 5.63, 8.62, 26.44, 19.29, 
24.28, 25.63, 22.27, 27.19, 18.35, 17.19, 14.75, 15.94, 8.71, 
25.36, 26.03, 20.91, 6.54, 7.22, 6.57, 11.32, 10.33, 4.35, 14.35, 
12.96, 26.06, 25.33, 25.78, 14.63, 16.68, 26.96, 25.32, 26, 25.73, 
24.19, 27.35, 26.53, 24.24, 22.05, 0, 24.5, 23.24, 15, 15.24, 
10.79, 11.66, 13.34, 6.39, 9.86, 8.18, 7.57, 10.69, 16.23, 14.41, 
7.66, 10.65, 13.53, 9.35, 9.87, 11.12, 8.35, 14.35, 10.45, 14.66, 
4.84, 6.35, 10.93, 5.29, 7.33, 3.94, 8.78, 5.08, 0.5, 7.86, -2.24, 
0.84, 8, 8.26, 18.61, 1.32, 8.11, 4.75, -3.58, 0.71, -1.71, 14.26, 
15.84, 1.56, -0.16, -1.04, -0.86, 0.99, -8.83, -0.65, 14.68, 
16.1, 18.06, 17.32, 13.83, 12.66, 13.01, 17.21, 16.38, 12.74, 
10.37, 12.24, 11.31, 16.61, 15.34, 25.1, 19.93, 11.23, 9.69, 
17.36, 20.06, 22.21, 10.22, 24.4, 20.85, 24.5, 23.8)

FD <- 
c(-0.002072773, -0.001831423, 0.003787482, -2.95e-05, -0.002908055, 
0.000737272, -0.000406545, 0.006555799, -0.002899681, 0.007919069, 
-0.002843703, -0.000370605, -0.001168412, -0.005990162, -0.004224545, 
-0.005761309, -9.74e-05, -0.005761309, -0.001397048, 8.86e-05, 
-0.005209181, -0.003134873, 0.002696426, -0.002279802, 0.006651779, 
7.71e-05, 0.009864755, -0.001324825, 0.000560099, -0.002690476, 
-0.003134873, -0.003219461, -0.002482258, -0.000288275, -0.001775582, 
0.001333609, -9.49e-05, -0.001805951, -0.001932018, -0.001214875, 
0.001217562, -0.001943945, 0.000559325, -0.000170461, -0.002482258, 
-0.004736827, -0.004528607, -0.002690476, 0.000632045, -0.003668402, 
-0.001805951, 0.004399932, 0.003388659, -0.003361005, 0.006808772, 
-2.95e-05, 0.003583645, 0.003951805, 0.001691226, 0.000123662, 
0.003331855, 0.000676252, 0.003474272, 0.000613065, -0.005368817, 
-0.004837484, 0.000347025, 0.001054758, -0.001042832, 0.001762602, 
-0.002896831, 0.002862176, -0.002930616, 0.002654628, 0.006010489, 
0.006369799, 0.002064545, 0.005934735, -0.002994953, -0.009815406, 
-0.002366964, 0.003501113, 0.003775479, 0.000637922, 0.003308719, 
0.009903976, -0.003745045, -0.003594032, 0.005388119, 0.003619729, 
0.001382219, 0.005935882, 0.002042469, -0.001844541, 0.003966672, 
0.012531375, -0.004375064, -2.95e-05, -0.001057828, 0.003936902, 
-0.002994953, -0.000894262, -0.002447952, 0.003347962, -0.000299668, 
0.000909959, 0.007000955, 0.001931295, -2.4e-05, -0.002851661, 
0.000415175, 0.000882162, -0.000193681, 0.005472919, -0.000894262, 
0.004165462, 0.005606613, -0.005924876, -0.003368547, -0.000894262, 
-0.000490612, 0.001789452, -0.001805951, -0.001556388, 0.003481415, 
-0.002901378, -0.001455018, -0.005209181, -0.000894262, -0.000776012, 
-0.000310873, -0.003591404, 0.001269288, -0.002250472, 0.007473438, 
-0.001805951, 0.003420376, 0.004760523, -2.07e-05, 0.003949692, 
0.001117522, 0.006796205, -0.000743828, 0.003710842, 0.013457696, 
0.010808866, 0.008076235, -0.001981592, 0.006509679, 0.006556805, 
0.006059369, 0.001627928, -0.000316485, 0.004258142, 0.003398305, 
0.000333665, 0.004756022, -0.002843703, 2.1e-05, -0.001805951, 
0.002210235, 0.000311672, 0.013465633, 0.005919859, -0.000393561, 
0.002919942, 0.001878915, 0.003082039, 0.006314792, 0.004586376, 
-0.002072773, -0.000461602, -0.001805951, 0.006740223, 0.005954059, 
0.001015125, 0.000845125, -0.001444538, -0.002023805, -0.000591478, 
0.000535265, 0.005858593, 0.001363755, 0.001918419, -0.003083295, 
-0.004246773, 0.003129245, -0.002042248, 0.002157693, 0.006070799, 
0.005257838, -0.006330844, 0.007508152, -0.001797095, 0.002454648, 
0.004227673, 0.006185102, -0.002072773, -0.002248081, 0.002996692, 
0.004499479, -0.001248721, 0.001581675, -0.000894262, 0.011087059, 
-0.001148568, 0.005163298, 0.000592865, 0.004678769, 0.002663789, 
-0.005209181, -0.003331049, -0.003613345, -0.005680872, -0.003707266, 
-0.003707266, -0.000156888, -0.000292545, -0.003331049, -0.002630649, 
-0.003915486, -0.003668402, 0.000657955, -0.001011962, -0.002630649, 
0.000430342, -0.001892218, -0.003915486, -0.005209181, -0.001336522, 
0.000926872, -0.004576045, -0.002380684, -0.001273558, -0.001805951, 
-0.003368547, -0.000434535, 0.007113326, 0.002090362, 0.000918172, 
0.000202769, 0.001818999, -0.001354275, -0.003915486, -0.000893024, 
-0.003556788, -0.000789657, 0.006641739, -0.01043696, 0.004638415, 
-0.006166218, -0.014315493, -0.001034315, -0.001452768, 0.000640075, 
-0.005504717, 0.003743452, -0.009659774, -0.003896767, -0.003374145, 
-0.015574465, -0.002909211, -0.005209181, 0.010723802, -0.001437743, 
0.003150586, 0.001763052, 0.002695203, 0.001392144, 0.006629402, 
0.002745725, -0.000689563, 0.002750409, -0.00107117, -0.000689563, 
-0.004576045, -0.000102518, 0.003392188, -0.004481403, 0.004712505, 
-0.014021419, 0.003549839, -0.002517944, -0.00701935, -0.005761309, 
-0.009069226, 0.007586323, 0.003036132, -0.002630649, 0.001149328, 
-0.008175666, -0.000671792, -0.000350235, 0.000396122, -0.001805951, 
0.003762762, -0.003056667, -0.00683657, -0.003134873, 0.011663576, 
-0.002018742, 0.007699412, 0.004611682, 0.010188213, 0.000726086, 
0.008817446, -0.002140622, 8.09e-05, 0.003283749, -0.002582593, 
-0.001090708, -0.001913558, 0.010227489, 0.002916582, 0.004454429, 
-0.002631361, 0.002812375, -0.001819095, 0.007006766, 0.005106952, 
0.001812532, -3.8e-05, -0.001471771, 0.000814315, -2.95e-05, 
0.001440055, -0.003101682, -0.002756668, -0.000652392, 0.001345495, 
-0.000799702, 0.002535602, 0.00111382, 0.002613222, -0.000602815, 
0.003794912, -0.001328168, 0.001947045, -0.003915486, 0.001326238, 
-0.003802252, -0.003780877, -0.007355971, 0.010486206, 0.000295479, 
-0.000491351, -0.000446011, -0.006619322, -0.004367824, -0.005209181, 
-0.003594032, -0.003318508, -0.001805951, -0.002630649, 0.001345495, 
0.003258255, -0.004151518, -0.007276765, -0.000841111, -0.00890313, 
-0.004916218, -0.000560572, -0.000689563, 0.002050066, 0.003310849, 
0.004209965, -0.000477518, 0.007697415, 0.003707718, 0.006277412, 
0.001357945, -9.86e-05, 0.004566042, -2.95e-05, 0.001152432, 
0.002226522, -0.000689563, 0.001220268, 0.001220268, -0.001543668, 
0.000500289, -0.000546625, -0.002630649, 0.001345495, 0.002799082, 
0.000234272, -0.005055994, -0.001805951, -0.001805951, -0.000176008, 
-1.78e-05, 0.001345495, -0.001805951, -0.003712465, 0.001384522, 
-0.003357855, -0.005209181, 0.000381358, 0.004663702, 0.000529119, 
-0.000210495, 0.000678225, -0.003149638, -0.003899006, 0.001773742, 
-8.86e-05, 0.001111778, 0.000234272, -0.000287391, -0.005209181, 
-0.002362711, -0.005868561, -0.003368547, -0.000894262, -0.005441006, 
-0.003134873, -0.001543668, -0.003915486, -0.001805951, -0.006150628, 
0.005272819, -0.000532855, -0.003231627, -0.00581913, 0.000901985, 
-8.38e-05, -0.001805951, -0.001148568, -0.002974938, -0.003368547, 
-0.003368547, 0.004087845, -0.001805951, -0.000803485, -0.000834661, 
-0.002006332, -0.002109215, -6.4e-05, -0.001254862, 0.004904699, 
0.006655672, 0.001345495, -0.001805951, 0.000137515, 0.000520795, 
0.001339525, -0.004172625, -0.000894262, -0.003231627, -0.001805951, 
-0.006263893, -0.002006332, -0.000217105, -0.00890313, -0.003368547, 
-0.003134873, -0.002463031, -0.006515148)


More information about the R-help mailing list