geom_density error: object "y" not found

2,389 views
Skip to first unread message

Stavros Macrakis

unread,
Apr 20, 2009, 11:06:31 PM4/20/09
to ggplot2
I ran into the following problem in ggplot2 0.8.2, R 2.8.1, Windows.

I have a workaround, but I'd like to understand if I'm doing something
wrong or if it's a bug.

-s

> zz <- data.frame(T = (1:10)^2, E = runif(10))
# This works
> ggplot(zz,aes(x=T))+geom_density()
# This works, though the density plot's y scale is not very useful
> ggplot(zz,aes(x=T))+geom_density(aes(x=T))+geom_line(aes(x=T,y=E)) # Density + line
# Ditto
> ggplot(zz,aes(x=T))+geom_density()+geom_line(aes(x=T,y=E))

# But this doesn't:
> qplot(T,E,data=zz) + geom_line() + geom_density(aes(x=T)) # Line + density
Error in eval(expr, envir, enclos) : object "y" not found
> qplot(T,E,data=zz) + geom_density(aes(x=T)) # Try simpler case
Error in eval(expr, envir, enclos) : object "y" not found
> traceback()
24: eval(expr, envir, enclos)
23: eval(substitute(list(...)), `_data`, parent.frame())
22: transform.data.frame(df, ymin = 0, ymax = y)
21: transform(df, ymin = 0, ymax = y)
20: get("reparameterise", env = .$geom, inherits = TRUE)(.$geom,
...)
19: .$geom$reparameterise(df, .$geom_params)
18: f(data[[1]], ...)
17: FUN(newX[, i], ...)
16: apply(gg, c(1, 2), function(data) {
f(data[[1]], ...)
})
15: gg_apply(data, function(df) {
if (!is.null(df)) {
.$geom$reparameterise(df, .$geom_params)
}
else {
data.frame()
}
})
14: get("reparameterise", env = p, inherits = TRUE)(p, ...)
13: p$reparameterise(d)
12: function (d, p)
p$reparameterise(d)(d = list(list(x = c(1, 1.19373776908023,
1.38747553816047, 1.58121330724070, 1.77495107632094, 1.96868884540117,
2.16242661448141, 2.35616438356164, 2.54990215264188, 2.74363992172211,
2.93737769080235, 3.13111545988258, 3.32485322896282, 3.51859099804305,
3.71232876712329, 3.90606653620352, 4.09980430528376, 4.29354207436399,
4.48727984344423, 4.68101761252446, 4.8747553816047, 5.06849315068493,
5.26223091976517, 5.4559686888454, 5.64970645792564, 5.84344422700587,
6.0371819960861, 6.23091976516634, 6.42465753424658, 6.61839530332681,
6.81213307240705, 7.00587084148728, 7.19960861056751, 7.39334637964775,
7.58708414872798, 7.78082191780822, 7.97455968688845, 8.16829745596869,
8.36203522504892, 8.55577299412916, 8.7495107632094, 8.94324853228963,
9.13698630136986, 9.3307240704501, 9.52446183953033, 9.71819960861057,
9.9119373776908, 10.1056751467710, 10.2994129158513, 10.4931506849315,
10.6868884540117, 10.8806262230920, 11.0743639921722, 11.2681017612524,
11.4618395303327, 11.6555772994129, 11.8493150684932, 12.0430528375734,
12.2367906066536, 12.4305283757339, 12.6242661448141, 12.8180039138943,
13.0117416829746, 13.2054794520548, 13.3992172211350, 13.5929549902153,
13.7866927592955, 13.9804305283757, 14.1741682974560, 14.3679060665362,
14.5616438356164, 14.7553816046967, 14.9491193737769, 15.1428571428571,
15.3365949119374, 15.5303326810176, 15.7240704500978, 15.9178082191781,
16.1115459882583, 16.3052837573386, 16.4990215264188, 16.6927592954990,
16.8864970645793, 17.0802348336595, 17.2739726027397, 17.4677103718200,
17.6614481409002, 17.8551859099804, 18.0489236790607, 18.2426614481409,
18.4363992172211, 18.6301369863014, 18.8238747553816, 19.0176125244618,
19.2113502935421, 19.4050880626223, 19.5988258317025, 19.7925636007828,
19.986301369863, 20.1800391389432, 20.3737769080235, 20.5675146771037,
20.7612524461840, 20.9549902152642, 21.1487279843444, 21.3424657534247,
21.5362035225049, 21.7299412915851, 21.9236790606654, 22.1174168297456,
22.3111545988258, 22.5048923679061, 22.6986301369863, 22.8923679060665,
23.0861056751468, 23.279843444227, 23.4735812133072, 23.6673189823875,
23.8610567514677, 24.0547945205479, 24.2485322896282, 24.4422700587084,
24.6360078277886, 24.8297455968689, 25.0234833659491, 25.2172211350294,
25.4109589041096, 25.6046966731898, 25.7984344422701, 25.9921722113503,
26.1859099804305, 26.3796477495108, 26.573385518591, 26.7671232876712,
26.9608610567515, 27.1545988258317, 27.3483365949119, 27.5420743639922,
27.7358121330724, 27.9295499021526, 28.1232876712329, 28.3170254403131,
28.5107632093933, 28.7045009784736, 28.8982387475538, 29.0919765166341,
29.2857142857143, 29.4794520547945, 29.6731898238748, 29.866927592955,
30.0606653620352, 30.2544031311155, 30.4481409001957, 30.6418786692759,
30.8356164383562, 31.0293542074364, 31.2230919765166, 31.4168297455969,
31.6105675146771, 31.8043052837573, 31.9980430528376, 32.1917808219178,
32.3855185909980, 32.5792563600783, 32.7729941291585, 32.9667318982387,
33.160469667319, 33.3542074363992, 33.5479452054795, 33.7416829745597,
33.9354207436399, 34.1291585127202, 34.3228962818004, 34.5166340508806,
34.7103718199609, 34.9041095890411, 35.0978473581213, 35.2915851272016,
35.4853228962818, 35.6790606653620, 35.8727984344423, 36.0665362035225,
36.2602739726027, 36.454011741683, 36.6477495107632, 36.8414872798434,
37.0352250489237, 37.2289628180039, 37.4227005870842, 37.6164383561644,
37.8101761252446, 38.0039138943249, 38.1976516634051, 38.3913894324853,
38.5851272015656, 38.7788649706458, 38.972602739726, 39.1663405088063,
39.3600782778865, 39.5538160469667, 39.747553816047, 39.9412915851272,
40.1350293542074, 40.3287671232877, 40.5225048923679, 40.7162426614481,
40.9099804305284, 41.1037181996086, 41.2974559686888, 41.4911937377691,
41.6849315068493, 41.8786692759296, 42.0724070450098, 42.26614481409,
42.4598825831703, 42.6536203522505, 42.8473581213307, 43.0410958904110,
43.2348336594912, 43.4285714285714, 43.6223091976517, 43.8160469667319,
44.0097847358121, 44.2035225048924, 44.3972602739726, 44.5909980430528,
44.7847358121331, 44.9784735812133, 45.1722113502935, 45.3659491193738,
45.559686888454, 45.7534246575342, 45.9471624266145, 46.1409001956947,
46.3346379647749, 46.5283757338552, 46.7221135029354, 46.9158512720157,
47.1095890410959, 47.3033268101761, 47.4970645792564, 47.6908023483366,
47.8845401174168, 48.0782778864971, 48.2720156555773, 48.4657534246575,
48.6594911937378, 48.853228962818, 49.0469667318982, 49.2407045009785,
49.4344422700587, 49.6281800391389, 49.8219178082192, 50.0156555772994,
50.2093933463796, 50.4031311154599, 50.5968688845401, 50.7906066536204,
50.9843444227006, 51.1780821917808, 51.3718199608611, 51.5655577299413,
51.7592954990215, 51.9530332681018, 52.146771037182, 52.3405088062622,
52.5342465753425, 52.7279843444227, 52.9217221135029, 53.1154598825832,
53.3091976516634, 53.5029354207436, 53.6966731898239, 53.8904109589041,
54.0841487279843, 54.2778864970646, 54.4716242661448, 54.665362035225,
54.8590998043053, 55.0528375733855, 55.2465753424658, 55.440313111546,
55.6340508806262, 55.8277886497065, 56.0215264187867, 56.2152641878669,
56.4090019569472, 56.6027397260274, 56.7964774951076, 56.9902152641879,
57.1839530332681, 57.3776908023483, 57.5714285714286, 57.7651663405088,
57.958904109589, 58.1526418786693, 58.3463796477495, 58.5401174168297,
58.73385518591, 58.9275929549902, 59.1213307240704, 59.3150684931507,
59.5088062622309, 59.7025440313112, 59.8962818003914, 60.0900195694716,
60.2837573385519, 60.4774951076321, 60.6712328767123, 60.8649706457926,
61.0587084148728, 61.252446183953, 61.4461839530333, 61.6399217221135,
61.8336594911937, 62.027397260274, 62.2211350293542, 62.4148727984344,
62.6086105675147, 62.8023483365949, 62.9960861056751, 63.1898238747554,
63.3835616438356, 63.5772994129158, 63.7710371819961, 63.9647749510763,
64.1585127201566, 64.3522504892368, 64.545988258317, 64.7397260273973,
64.9334637964775, 65.1272015655577, 65.320939334638, 65.5146771037182,
65.7084148727984, 65.9021526418787, 66.0958904109589, 66.2896281800391,
66.4833659491194, 66.6771037181996, 66.8708414872798, 67.06457925636,
67.2583170254403, 67.4520547945205, 67.6457925636008, 67.839530332681,
68.0332681017613, 68.2270058708415, 68.4207436399217, 68.614481409002,
68.8082191780822, 69.0019569471624, 69.1956947162427, 69.389432485323,
69.5831702544031, 69.7769080234834, 69.9706457925636, 70.1643835616438,
70.3581213307241, 70.5518590998043, 70.7455968688845, 70.9393346379648,
71.133072407045, 71.3268101761252, 71.5205479452055, 71.7142857142857,
71.908023483366, 72.1017612524462, 72.2954990215264, 72.4892367906067,
72.6829745596869, 72.8767123287671, 73.0704500978474, 73.2641878669276,
73.4579256360078, 73.651663405088, 73.8454011741683, 74.0391389432485,
74.2328767123288, 74.426614481409, 74.6203522504892, 74.8140900195695,
75.0078277886497, 75.20156555773, 75.3953033268102, 75.5890410958904,
75.7827788649707, 75.9765166340509, 76.1702544031311, 76.3639921722114,
76.5577299412916, 76.7514677103718, 76.945205479452, 77.1389432485323,
77.3326810176125, 77.5264187866928, 77.720156555773, 77.9138943248532,
78.1076320939335, 78.3013698630137, 78.495107632094, 78.6888454011742,
78.8825831702544, 79.0763209393346, 79.2700587084149, 79.4637964774951,
79.6575342465753, 79.8512720156556, 80.0450097847358, 80.238747553816,
80.4324853228963, 80.6262230919765, 80.8199608610568, 81.013698630137,
81.2074363992172, 81.4011741682975, 81.5949119373777, 81.7886497064579,
81.9823874755382, 82.1761252446184, 82.3698630136986, 82.5636007827789,
82.7573385518591, 82.9510763209393, 83.1448140900196, 83.3385518590998,
83.53228962818, 83.7260273972603, 83.9197651663405, 84.1135029354207,
84.307240704501, 84.5009784735812, 84.6947162426614, 84.8884540117417,
85.0821917808219, 85.2759295499022, 85.4696673189824, 85.6634050880626,
85.8571428571429, 86.0508806262231, 86.2446183953033, 86.4383561643836,
86.6320939334638, 86.825831702544, 87.0195694716243, 87.2133072407045,
87.4070450097847, 87.600782778865, 87.7945205479452, 87.9882583170254,
88.1819960861057, 88.375733855186, 88.5694716242661, 88.7632093933464,
88.9569471624266, 89.1506849315068, 89.3444227005871, 89.5381604696673,
89.7318982387475, 89.9256360078278, 90.119373776908, 90.3131115459883,
90.5068493150685, 90.7005870841487, 90.894324853229, 91.0880626223092,
91.2818003913894, 91.4755381604697, 91.6692759295499, 91.8630136986301,
92.0567514677104, 92.2504892367906, 92.4442270058708, 92.637964774951,
92.8317025440313, 93.0254403131115, 93.2191780821918, 93.412915851272,
93.6066536203522, 93.8003913894325, 93.9941291585127, 94.187866927593,
94.3816046966732, 94.5753424657534, 94.7690802348337, 94.9628180039139,
95.1565557729941, 95.3502935420744, 95.5440313111546, 95.7377690802348,
95.931506849315, 96.1252446183953, 96.3189823874755, 96.5127201565558,
96.706457925636, 96.9001956947162, 97.0939334637965, 97.2876712328767,
97.481409001957, 97.6751467710372, 97.8688845401174, 98.0626223091976,
98.2563600782779, 98.4500978473581, 98.6438356164384, 98.8375733855186,
99.0313111545988, 99.225048923679, 99.4187866927593, 99.6125244618395,
99.8062622309198, 100), density = c(0.00897359670813757,
0.00901755356083976,
0.00906151041354195, 0.00910495130512498, 0.00914779334310052,
0.00919063538107606, 0.00923244437650414, 0.00927413175360716,
0.00931542972248413, 0.0093559245030387, 0.00939641928359326,
0.0094359823754429, 0.0094752486163063, 0.0095142747202557,
0.0095522785469055,
0.0095902823735553, 0.0096274811482799, 0.00966419082466963,
0.00970082912876029, 0.0097362151207151, 0.00977160111266993,
0.00980633085021457, 0.0098403658821669, 0.00987440091411925,
0.00990717337000125, 0.00993983247489473, 0.00997200283390388,
0.0100032633961237, 0.0100345239583435, 0.0100646760099502,
0.0100945178011682,
0.0101240533601909, 0.0101524585680443, 0.0101808637758977,
0.0102083324466314,
0.0102352856961839, 0.0102621263460606, 0.0102876147140267,
0.0103131030819928,
0.0103378409183495, 0.0103618539400921, 0.0103858669618346,
0.0104084847940793,
0.0104310144634216, 0.0104529896418742, 0.0104740304037968,
0.0104950711657195,
0.0105149119449576, 0.0105344606812803, 0.0105536569640986,
0.0105717129722742,
0.0105897689804498, 0.0106068290268051, 0.0106233939919826,
0.0106398105352147,
0.0106548884957521, 0.0106699664562895, 0.0106842572090882,
0.0106978545157218,
0.0107114518223554, 0.0107236308033565, 0.0107357560722589,
0.0107473036357635,
0.0107579676957417, 0.0107686317557200, 0.0107780978276510,
0.0107873136617597,
0.0107961582230216, 0.0108039409048840, 0.0108117235867463,
0.0108185279011225,
0.0108248945262692, 0.0108310896550765, 0.0108360592676296,
0.0108410288801827,
0.0108452352968683, 0.0108488288119094, 0.0108524223269505,
0.0108546807760649,
0.0108569208980395, 0.0108586050953236, 0.0108595162328447,
0.0108604273703657,
0.0108602307866935, 0.0108598389641123, 0.0108590874667002,
0.0108574202328233,
0.0108557529989464, 0.0108531959916881, 0.0108502823260183,
0.0108471914647705,
0.0108430616816565, 0.0108389318985425, 0.0108341179629362,
0.0108288036140128,
0.0108234784316809, 0.0108170122069819, 0.0108105459822829,
0.0108035863700715,
0.0107960019981942, 0.0107884176263169, 0.0107798872632841,
0.0107712194109773,
0.0107622319745985, 0.0107525161461423, 0.0107428003176861,
0.0107323390398927,
0.0107216114766275, 0.0107107195012859, 0.0106990170816393,
0.0106873146619927,
0.0106750493076241, 0.0106624094479736, 0.0106497404853049,
0.0106362010420003,
0.0106226615986957, 0.0106087223000032, 0.0105943214728603,
0.0105799206457174,
0.0105647824268332, 0.0105495586643949, 0.0105340777197479,
0.0105180696265922,
0.0105020615334366, 0.0104854869249275, 0.0104687331712871,
0.0104518439545956,
0.0104343831885331, 0.0104169224224706, 0.0103990448986294,
0.0103809156609976,
0.0103627515788079, 0.0103439922212028, 0.0103252328635977,
0.0103061850967086,
0.0102868337026054, 0.0102674823085023, 0.0102476215172531,
0.0102277158264954,
0.0102076287575817, 0.0101872060943738, 0.0101667834311660,
0.0101459849701831,
0.0101250821747179, 0.0101040841550542, 0.0100827375188862,
0.0100613908827183,
0.0100397804147203, 0.0100180256199764, 0.00999624162870371,
0.0099741136912036, 0.00995198575370349, 0.00992968497265832,
0.00990721818899894, 0.00988475140533956, 0.0098619970295112,
0.00983922492814889, 0.00981635092982562, 0.00979330622617364,
0.00977026152252167, 0.0097470228677215, 0.00972373742326238,
0.00970040215996094, 0.00967690694535608, 0.00965341173075121,
0.00962979621983036, 0.00960612128199386, 0.00958243110176503,
0.0095586055348531, 0.00953477996794118, 0.00951088909665437,
0.00948694101690735, 0.00946299293716034, 0.00943895281081264,
0.00941490933517312, 0.00939083836705254, 0.0093667255954705,
0.00934261282388847, 0.00931846340619445, 0.00929430640751869,
0.00927014414797695, 0.00924596694932114, 0.00922178975066532,
0.00919761447526926, 0.00917344005473157, 0.00914926870079787,
0.00912511898340418, 0.00910096926601048, 0.00907684488727183,
0.00905274074400476, 0.0090286366007377, 0.00900459705514776,
0.00898055830491724, 0.00895655487747044, 0.00893260029187554,
0.00890864570628064, 0.00888477788910129, 0.0088609251998284,
0.00883710611953715, 0.00881337202823571, 0.00878963793693428,
0.00876599988870225, 0.0087424000791764, 0.00871882217971469,
0.008695371332267, 0.00867192048481931, 0.00864856380406247,
0.00862527561182512, 0.00860198931085814, 0.00857887649794626,
0.00855576368503438, 0.00853273371283839, 0.00850980805416097,
0.00848688239548356, 0.00846412988551154, 0.00844140222807655,
0.00841873827032497, 0.0083962185558772, 0.00837369884142942,
0.00835133931488936, 0.00832903660372216, 0.00830677218482712,
0.00828469468061249, 0.00826261717639786, 0.00824067965748622,
0.00821883473297141, 0.00819699787504155, 0.00817539209846474,
0.00815378632188794, 0.00813229458386248, 0.00811093374594488,
0.00808957290802727, 0.00806843640891852, 0.00804732555029543,
0.00802629842654676, 0.00800544186550586, 0.00798458530446496,
0.0079639250548103, 0.00794332641521106, 0.007922778119523,
0.00790244035877774,
0.00788210259803248, 0.00786192929051562, 0.0078418547275189,
0.00782179517863633, 0.00780198552153598, 0.00778217586443563,
0.00776249617048413, 0.00774295254419428, 0.00772340891790442,
0.00770411066359021, 0.00768483363695329, 0.00766565052748263,
0.00764664013999451, 0.00762762975250639, 0.00760882806664316,
0.00759008385466247, 0.0075713969133452, 0.00755291793571493,
0.00753443895808467, 0.00751613088963936, 0.00749791575265594,
0.00747972147859337, 0.00746176836026507, 0.00744381524193678,
0.00742599500021953, 0.00740830167376319, 0.00739060834730685,
0.00737315762743676, 0.0073557214839683, 0.00733838071450936,
0.00732119878489037, 0.00730401685527138, 0.0072870374118221,
0.00727010638763098, 0.00725323443103218, 0.00723655068463473,
0.00721986693823729, 0.00720334641184091, 0.00718690601554137,
0.00717049014799362, 0.00715428889225277, 0.00713808763651191,
0.00712201179120732, 0.00710604520192025, 0.00709007861263317,
0.00707433421132916, 0.00705859756616046, 0.00704295049336616,
0.00702743883714565, 0.00701192718092513, 0.00699659796457227,
0.00698130612375913, 0.00696607042643114, 0.00695099302265932,
0.0069359156188875, 0.00692098309902592, 0.00690611456174771,
0.00689127151893665, 0.00687660609718599, 0.00686194067543533,
0.00684738516361911, 0.0068329169369197, 0.00681844871022029,
0.00680416953770395, 0.00678989242615125, 0.00677569316336154,
0.00676160093691092, 0.0067475087104603, 0.00673356874083431,
0.006719655027831, 0.00670579029662776, 0.00669204859161695,
0.00667830688660614, 0.0066646836922906, 0.0066511073631489,
0.00663755458385213, 0.00662413687828393, 0.00661071917271574,
0.00659738953375035, 0.00658412358519475, 0.00657085939758156,
0.00655773823057754, 0.00654461706357352, 0.00653155703797569,
0.00651857357303485, 0.006505590108094, 0.00649272096324317,
0.00647986802128078, 0.00646705300422657, 0.00645432331060292,
0.00644159361697927, 0.00642894962503216, 0.00641633581325718,
0.00640374058698048, 0.00639123520213522, 0.00637872981728996,
0.00636628529338745, 0.00635388079531671, 0.00634147957170244,
0.00632916833803296, 0.00631685710436349, 0.00630458582496316,
0.00629236015400187, 0.00628013448304059, 0.00626797872546894,
0.00625583083903565, 0.00624370607639964, 0.00623162812264802,
0.00621955016889641, 0.00620751949825743, 0.00619550355453773,
0.00618349810989241, 0.00617153618570817, 0.00615957426152393,
0.0061476411204802, 0.00613572516059051, 0.00612381139798264,
0.0061119332856999, 0.00610005517341714, 0.00608819159810892,
0.00607634315884072, 0.00606449471957252, 0.00605266604674281,
0.00604083905182476, 0.0060290167123878, 0.00601720288325215,
0.00600538905411649, 0.00599357902803834, 0.00598177004076099,
0.00596996028804112, 0.00595814777830756, 0.005946335268574,
0.00593451501980616, 0.00592269058833381, 0.00591086450845101,
0.00589901972690295, 0.00588717494535489, 0.00587531539313559,
0.00586344181055761, 0.00585156822797962, 0.00583965943862447,
0.00582774858843403, 0.0058158205139405, 0.00580386392149299,
0.00579190732904549, 0.00577990690769746, 0.0057678960984514,
0.00575587022972876, 0.00574379673802785, 0.00573172324632694,
0.00571960194829388, 0.00570745732678006, 0.00569530443622161,
0.00568308026588895, 0.00567085609555629, 0.00565858481309063,
0.00564627271398583, 0.00563396061488102, 0.00562155537156783,
0.00560914701413874, 0.00559669689900262, 0.0055841840160917,
0.00557167113318077, 0.00555906454277599, 0.00554643894225103,
0.00553378154189025, 0.00552103511990024, 0.00550828869791024,
0.00549545273783564, 0.00548257749267466, 0.00546968489978699,
0.00545667294634458, 0.00544366099290218, 0.00543056832209189,
0.00541741190686351, 0.00540425549163513, 0.00539094843846454,
0.00537763995509084, 0.00536426408703349, 0.00535079609233271,
0.00533732809763193, 0.00532371762817646, 0.00531008285862939,
0.00529639834537047, 0.00528258973401298, 0.00526878112265549,
0.00525484277356351, 0.00524085346723708, 0.00522683609288221,
0.00521265946978882, 0.00519848284669544, 0.00518419355600558,
0.00516982324350898, 0.00515545022546513, 0.00514088011807659,
0.00512631001068805, 0.00511164832414232, 0.00509687260162535,
0.00508209687910838, 0.00506713594305254, 0.00505214908857759,
0.00503709536947388, 0.00502189218775072, 0.00500668900602757,
0.00499132194106476, 0.00497589757637758, 0.00496043421640346,
0.00494478417047095, 0.00492913412453845, 0.00491334512991012,
0.00489746527949093, 0.00488157690777014, 0.00486546352193187,
0.00484935013609361, 0.00483312582108308, 0.00481677557805213,
0.00480042533502119, 0.00478385926896915, 0.00476726927247726,
0.00475059885385651, 0.0047337666488996, 0.00471693444394269,
0.00469991569250374, 0.00468283928042861, 0.00466571476918401,
0.00464839262201861, 0.00463107047485321, 0.0046135934528639,
0.00459602452680808, 0.00457844090095907, 0.00456062464895387,
0.00454280839694868, 0.0045248706185206, 0.00450680700181613,
0.00448874338511167, 0.00447045186080634, 0.00445214135945061,
0.00443374357601474, 0.00441518719818867, 0.00439663082036259,
0.00437788219402417, 0.00435908148415136, 0.00434022779963196,
0.00432118484519572, 0.00430214189075947, 0.00428294306328313,
0.00426366050028725, 0.00424435846064884, 0.00422483947766382,
0.0042053204946788, 0.00418568186232714, 0.00416593020306825,
0.00414617854380936, 0.00412621082211968, 0.00410623078650923,
0.00408616627569199, 0.00406596271936386, 0.00404575916303573,
0.00402537898449218, 0.00400495731670322, 0.00398448438673895,
0.00396385056665829, 0.00394321674657763, 0.00392244442657752,
0.00390160495793191, 0.00388074457034204, 0.00385970649440253,
0.00383866841846301, 0.00381752772162295, 0.00379629860852549,
0.00377506949542804), scaled = c(0.826265523640751, 0.830312956693168,
0.834360389745585, 0.838360314435617, 0.842305098237812, 0.846249882040008,
0.850099545962274, 0.853938011584425, 0.85774062150654, 0.861469275929944,
0.865197930353347, 0.868840797295913, 0.872456330969158, 0.876049753457843,
0.879549047302715, 0.883048341147587, 0.886473507898033, 0.889853639741637,
0.893227199808954, 0.89648545022103, 0.899743700633107, 0.902941524840228,
0.906075382357218, 0.909209239874208, 0.912226842659475, 0.915234008379544,
0.918196171645507, 0.92107456318147, 0.923952954717432, 0.92672927746961,
0.92947703224945, 0.93219658996255, 0.93481206787007, 0.937427545777589,
0.939956789774806, 0.942438575125726, 0.944909992590378, 0.947256895442069,
0.94960379829376, 0.95188159414038, 0.95409265093618, 0.956303707731982,
0.958386299095411, 0.960460772647325, 0.962484190115455, 0.964421568931697,
0.966358947747938, 0.968185835269165, 0.969985832235766, 0.971753376197313,
0.973415926625564, 0.975078477053815, 0.976649321899374, 0.97817458095343,
0.97968617369948, 0.981074513220863, 0.982462852742245, 0.983778708215642,
0.9850307129637, 0.986282717711756, 0.987404126712134, 0.988520590041699,
0.98958385975575, 0.990565778755306, 0.991547697754862, 0.99241930912043,
0.993267879235994, 0.994082263510234, 0.994798872681947, 0.99551548185366,
0.996142005483362, 0.996728227823382, 0.99729865922503, 0.997756248266751,
0.998213837308473, 0.998601153253063, 0.99893203480298, 0.999262916352896,
0.999470868493029, 0.99967713311764, 0.999832209637805, 0.999916104818902,
1, 0.999981899085042, 0.999945821077448, 0.999876625143758,
0.999723110570156,
0.999569595996554, 0.999334153396451, 0.999065870614345, 0.998781272122743,
0.998401012398775, 0.998020752674807, 0.99757749796281, 0.997088166489725,
0.996597837504472, 0.996002444295858, 0.995407051087244, 0.994766228035433,
0.994067878733085, 0.993369529430738, 0.992584075714976, 0.991785962343267,
0.99095842249862, 0.990063814199625, 0.98916920590063, 0.988205958559005,
0.987218192341399, 0.986215287485984, 0.985137759019792, 0.9840602305536,
0.982930868517432, 0.9817670230057, 0.980600497763495, 0.97935382092078,
0.978107144078066, 0.976823649587736, 0.975497658754062, 0.974171667920389,
0.97277777996663, 0.971376015384155, 0.96995057013057, 0.968476586408778,
0.967002602686985, 0.965476455699958, 0.963933813493618, 0.962378698200682,
0.960770956123224, 0.959163214045766, 0.95751709799236, 0.955847804785605,
0.954175303182287, 0.952447990161782, 0.950720677141276, 0.948966808141502,
0.947184981934926, 0.94540315572835, 0.943574425553017, 0.941741561147327,
0.939891995911201, 0.938011530022393, 0.936131064133585, 0.934215995759788,
0.932291320537323, 0.930357877317485, 0.928392334393623, 0.926426791469762,
0.924436955594891, 0.922433830487374, 0.920428017039177, 0.918390533913928,
0.916353050788679, 0.914299652677844, 0.912230969476602, 0.910162286275361,
0.908067122332693, 0.905970326268805, 0.90386414779689, 0.901742251220807,
0.899620354644724, 0.897480599549673, 0.895336536184114, 0.893187885628693,
0.891024507171877, 0.888861128715061, 0.8866866736853, 0.88450674677919,
0.882325416393107, 0.880131619952192, 0.877937823511277, 0.875738014012804,
0.87353293690761, 0.871327859802416, 0.869114307284833, 0.866900446373141,
0.86468405402506, 0.862463812522609, 0.860243571020158, 0.85801995523871,
0.855795641420114, 0.853570843194617, 0.85134466941422, 0.849118495633822,
0.846892498942197, 0.844666580963716, 0.84244094535018, 0.840217301973163,
0.837993658596146, 0.835772348336802, 0.833552901307227, 0.831333454277653,
0.82911995523474, 0.82690652942646, 0.82469635604854, 0.822490679901738,
0.820285003754935, 0.818087317018916, 0.81589102322131, 0.813697824051612,
0.811512450447789, 0.809327076843966, 0.807150546637012, 0.804977537351,
0.802806545486901, 0.80064725224291, 0.798487958998919, 0.796337336379722,
0.794193020005867, 0.792048877775283, 0.7899207098751, 0.787792541974918,
0.785672001833116, 0.783561066609703, 0.78145013138629, 0.779355139246838,
0.777262435464572, 0.775175596984033, 0.773102040053002, 0.771028483121972,
0.768969675878247, 0.766916100046778, 0.76486605006847, 0.762833210709415,
0.760800371350361, 0.758780421475138, 0.756768997451953, 0.754758316179,
0.75276891227803, 0.75077950837706, 0.748800604850289, 0.746833754266132,
0.744866903681974, 0.742920709633807, 0.740976876495096, 0.739040753446564,
0.737120335370033, 0.735199917293502, 0.733297575060541, 0.731400905721777,
0.729508871919854, 0.727636223629718, 0.725763575339582, 0.723906069476425,
0.722057655752716, 0.720210624489719, 0.718386602614263, 0.716562580738807,
0.714750525533208, 0.71295099908518, 0.711151472637153, 0.709374539404593,
0.707599560761531, 0.705833229767688, 0.704082802566269, 0.70233237536485,
0.700601164868058, 0.698875246417386, 0.697154601300947, 0.695453104941725,
0.693751608582504, 0.692065849098005, 0.690388646501621, 0.688713364908907,
0.687060288311086, 0.685407211713264, 0.683766370049346, 0.682137214413665,
0.680508058777983, 0.678901241727882, 0.677295766835058, 0.675699073733804,
0.674117006193269, 0.672534938652734, 0.670971515513825, 0.669412550694694,
0.66785902466635, 0.666322828545471, 0.664786632424592, 0.663265465178314,
0.661751676103641, 0.66024014557285, 0.658748375940924, 0.657256606308997,
0.655776384144955, 0.654306221991792, 0.65283605983863, 0.651386356178997,
0.649937366684196, 0.648496624781443, 0.647068351685778, 0.645640078590113,
0.644228604084543, 0.642820571021787, 0.641417707505608, 0.640029419249756,
0.638641130993903, 0.637266183272939, 0.635897126902397, 0.634530417996303,
0.633180063977024, 0.631829709957745, 0.630489476160323, 0.629157279350196,
0.62782508254007, 0.626510293349057, 0.625195693926233, 0.623888262615708,
0.622590686933827, 0.621293111251946, 0.620009554983798, 0.618728416357405,
0.617451787848194, 0.616186487271873, 0.614921186695552, 0.61366679827685,
0.612416725081872, 0.61116882029557, 0.609933352748058, 0.608697885200546,
0.607470526597536, 0.606249032442361, 0.605027700430199, 0.603819537384993,
0.602611374339787, 0.601408841036773, 0.600213357240595, 0.599017873444417,
0.597832915945787, 0.596649450367124, 0.595469476815699, 0.594297359624585,
0.593125242433471, 0.591961016430578, 0.590799569339702, 0.589639833553331,
0.588488370133081, 0.58733690671283, 0.586191047210426, 0.585048873182856,
0.58390700065875, 0.58277341417549, 0.58163982769223, 0.580509920094503,
0.579384212003619, 0.578258503912734, 0.577139233265539, 0.57602068737236,
0.574904270658493, 0.573792163985364, 0.572680057312235, 0.571572304345552,
0.57046590739542, 0.569360477172842, 0.568259054201506, 0.56715763123017,
0.566058858535803, 0.564961667837561, 0.563864679459334, 0.562770973670632,
0.56167726788193, 0.56058490062016, 0.559493927045719, 0.558402953471278,
0.557313799939255, 0.556224800904989, 0.555136230535354, 0.554048443772202,
0.55296065700905, 0.551873220421574, 0.550785879484184, 0.549698468066831,
0.548610802790804, 0.547523137514778, 0.546434759648535, 0.545345996649704,
0.544257081869511, 0.543166445088459, 0.542075808307408, 0.540983811481237,
0.539890522776008, 0.538797234070778, 0.53770070361677, 0.53660398340639,
0.535505677226831, 0.534404745187993, 0.533303813149155, 0.53219884545877,
0.531092921277661, 0.529985610458987, 0.52887391463992, 0.527762218820854,
0.526646121118646, 0.525527875850789, 0.524408869190737, 0.523283299273846,
0.522157729356955, 0.521027821476981, 0.51989415530668, 0.518760489136378,
0.517618246488815, 0.516475717101532, 0.515329342772831, 0.51417718895013,
0.51302503512743, 0.511864252961603, 0.510701720393188, 0.509536259778321,
0.508362602282596, 0.507188944786871, 0.506007042856416, 0.504821523657042,
0.503634407123962, 0.502436300180408, 0.501238193236853, 0.500032654047299,
0.498821245436963, 0.497609836826628, 0.496384557865056, 0.495159147214089,
0.493927531956126, 0.492687433915644, 0.491447335875163, 0.490194119128591,
0.488938664892575, 0.487678630384517, 0.486407169245228, 0.485135708105939,
0.483852301052363, 0.482564201988729, 0.481273518493794, 0.479968171787819,
0.478662825081845, 0.477347104235642, 0.476023923111499, 0.474700492867577,
0.473358915147689, 0.472017337427802, 0.470667327336511, 0.469306817108590,
0.46794630688067, 0.466568742670199, 0.465188791958881, 0.463802684525873,
0.462402814962301, 0.461002945398729, 0.459587985891267, 0.458167750373715,
0.456743924271225, 0.455302908609612, 0.453861892948, 0.452408083250657,
0.450945907787606, 0.449482947705193, 0.447999268906122, 0.44651559010705,
0.445021697237347, 0.443516209241951, 0.442010721246556, 0.440485360826833,
0.438957796954239, 0.43742282802049, 0.435872962220288, 0.434323096420086,
0.432756053903381, 0.431183702144764, 0.429606921539304, 0.428011943130566,
0.426416964721828, 0.424807725840769, 0.423190024671499, 0.421570969983375,
0.419930495681801, 0.418290021380227, 0.416638357240653, 0.414975106238786,
0.413311855236919, 0.411627619093944, 0.40994163559336, 0.408247615385088,
0.406538992216472, 0.404830369047856, 0.403104044134568, 0.401372923504443,
0.399636925106181, 0.397883499224599, 0.396130073343016, 0.394362295075954,
0.392586806659311, 0.39080952488391, 0.389012267527512, 0.387215010171114,
0.385406735811189, 0.383588054226633, 0.381769372642077, 0.379930796588969,
0.378091086701955, 0.376243598556876, 0.374383307461587, 0.372523016366297,
0.370646462355250, 0.368766088122033, 0.366880993800594, 0.364981085134296,
0.363081176467998, 0.361168515088135, 0.359249670835056, 0.357328900419815,
0.35539176892194, 0.353454637424066, 0.351508056859681, 0.349553335155507,
0.347598613451334), count = c(0.0897359670813758, 0.0901755356083976,
0.0906151041354195, 0.0910495130512498, 0.0914779334310052,
0.0919063538107606,
0.0923244437650415, 0.0927413175360716, 0.0931542972248413,
0.093559245030387,
0.0939641928359326, 0.094359823754429, 0.0947524861630629,
0.095142747202557,
0.095522785469055, 0.095902823735553, 0.096274811482799,
0.0966419082466963,
0.0970082912876029, 0.0973621512071511, 0.0977160111266993,
0.0980633085021457,
0.098403658821669, 0.0987440091411925, 0.0990717337000125,
0.0993983247489473,
0.0997200283390388, 0.100032633961237, 0.100345239583435,
0.100646760099502,
0.100945178011682, 0.101240533601909, 0.101524585680443, 0.101808637758977,
0.102083324466314, 0.102352856961839, 0.102621263460606, 0.102876147140267,
0.103131030819928, 0.103378409183495, 0.103618539400921, 0.103858669618346,
0.104084847940793, 0.104310144634216, 0.104529896418742, 0.104740304037968,
0.104950711657195, 0.105149119449576, 0.105344606812803, 0.105536569640986,
0.105717129722742, 0.105897689804498, 0.106068290268051, 0.106233939919826,
0.106398105352147, 0.106548884957521, 0.106699664562895, 0.106842572090882,
0.106978545157218, 0.107114518223554, 0.107236308033565, 0.107357560722589,
0.107473036357635, 0.107579676957417, 0.107686317557200, 0.107780978276510,
0.107873136617597, 0.107961582230216, 0.108039409048840, 0.108117235867463,
0.108185279011225, 0.108248945262692, 0.108310896550765, 0.108360592676296,
0.108410288801827, 0.108452352968683, 0.108488288119094, 0.108524223269505,
0.108546807760649, 0.108569208980395, 0.108586050953236, 0.108595162328447,
0.108604273703657, 0.108602307866935, 0.108598389641123, 0.108590874667002,
0.108574202328233, 0.108557529989464, 0.108531959916881, 0.108502823260183,
0.108471914647705, 0.108430616816565, 0.108389318985425, 0.108341179629362,
0.108288036140128, 0.108234784316809, 0.108170122069819, 0.108105459822829,
0.108035863700715, 0.107960019981942, 0.107884176263169, 0.107798872632841,
0.107712194109773, 0.107622319745985, 0.107525161461423, 0.107428003176861,
0.107323390398927, 0.107216114766275, 0.107107195012859, 0.106990170816393,
0.106873146619927, 0.106750493076241, 0.106624094479736, 0.106497404853049,
0.106362010420003, 0.106226615986957, 0.106087223000032, 0.105943214728603,
0.105799206457174, 0.105647824268332, 0.105495586643949, 0.105340777197479,
0.105180696265922, 0.105020615334366, 0.104854869249275, 0.104687331712871,
0.104518439545956, 0.104343831885331, 0.104169224224706, 0.103990448986294,
0.103809156609976, 0.103627515788079, 0.103439922212028, 0.103252328635977,
0.103061850967086, 0.102868337026054, 0.102674823085023, 0.102476215172531,
0.102277158264954, 0.102076287575817, 0.101872060943738, 0.101667834311660,
0.101459849701831, 0.101250821747179, 0.101040841550542, 0.100827375188862,
0.100613908827183, 0.100397804147203, 0.100180256199764,
0.0999624162870371,
0.099741136912036, 0.0995198575370349, 0.0992968497265832,
0.0990721818899894,
0.0988475140533956, 0.098619970295112, 0.0983922492814889,
0.0981635092982562,
0.0979330622617364, 0.0977026152252167, 0.097470228677215,
0.0972373742326238,
0.0970040215996094, 0.0967690694535608, 0.0965341173075121,
0.0962979621983036,
0.0960612128199386, 0.0958243110176503, 0.095586055348531,
0.0953477996794118,
0.0951088909665437, 0.0948694101690735, 0.0946299293716034,
0.0943895281081264,
0.0941490933517312, 0.0939083836705254, 0.093667255954705,
0.0934261282388847,
0.0931846340619445, 0.0929430640751869, 0.0927014414797695,
0.0924596694932114,
0.0922178975066532, 0.0919761447526926, 0.0917344005473157,
0.0914926870079787,
0.0912511898340418, 0.0910096926601048, 0.0907684488727183,
0.0905274074400476,
0.090286366007377, 0.0900459705514776, 0.0898055830491724,
0.0895655487747044,
0.0893260029187554, 0.0890864570628064, 0.0888477788910129,
0.088609251998284,
0.0883710611953715, 0.0881337202823571, 0.0878963793693428,
0.0876599988870225,
0.087424000791764, 0.0871882217971469, 0.08695371332267,
0.0867192048481931,
0.0864856380406247, 0.0862527561182512, 0.0860198931085814,
0.0857887649794626,
0.0855576368503438, 0.0853273371283839, 0.0850980805416097,
0.0848688239548356,
0.0846412988551154, 0.0844140222807656, 0.0841873827032497,
0.083962185558772,
0.0837369884142942, 0.0835133931488936, 0.0832903660372216,
0.0830677218482712,
0.0828469468061249, 0.0826261717639786, 0.0824067965748622,
0.0821883473297141,
0.0819699787504155, 0.0817539209846474, 0.0815378632188794,
0.0813229458386248,
0.0811093374594488, 0.0808957290802727, 0.0806843640891852,
0.0804732555029543,
0.0802629842654676, 0.0800544186550586, 0.0798458530446496,
0.079639250548103,
0.0794332641521106, 0.07922778119523, 0.0790244035877773,
0.0788210259803248,
0.0786192929051562, 0.078418547275189, 0.0782179517863633,
0.0780198552153598,
0.0778217586443563, 0.0776249617048413, 0.0774295254419428,
0.0772340891790442,
0.0770411066359021, 0.0768483363695329, 0.0766565052748263,
0.0764664013999451,
0.0762762975250639, 0.0760882806664316, 0.0759008385466247,
0.075713969133452,
0.0755291793571493, 0.0753443895808467, 0.0751613088963936,
0.0749791575265594,
0.0747972147859337, 0.0746176836026507, 0.0744381524193678,
0.0742599500021953,
0.0740830167376319, 0.0739060834730685, 0.0737315762743676,
0.073557214839683,
0.0733838071450936, 0.0732119878489037, 0.0730401685527138,
0.072870374118221,
0.0727010638763098, 0.0725323443103218, 0.0723655068463473,
0.0721986693823729,
0.0720334641184091, 0.0718690601554137, 0.0717049014799362,
0.0715428889225277,
0.0713808763651191, 0.0712201179120732, 0.0710604520192025,
0.0709007861263317,
0.0707433421132916, 0.0705859756616046, 0.0704295049336616,
0.0702743883714565,
0.0701192718092513, 0.0699659796457227, 0.0698130612375913,
0.0696607042643114,
0.0695099302265932, 0.069359156188875, 0.0692098309902592,
0.0690611456174771,
0.0689127151893665, 0.0687660609718599, 0.0686194067543533,
0.0684738516361911,
0.068329169369197, 0.0681844871022029, 0.0680416953770395,
0.0678989242615125,
0.0677569316336154, 0.0676160093691092, 0.067475087104603,
0.0673356874083431,
0.06719655027831, 0.0670579029662776, 0.0669204859161695,
0.0667830688660614,
0.066646836922906, 0.066511073631489, 0.0663755458385213,
0.0662413687828393,
0.0661071917271574, 0.0659738953375035, 0.0658412358519475,
0.0657085939758156,
0.0655773823057754, 0.0654461706357352, 0.0653155703797569,
0.0651857357303485,
0.06505590108094, 0.0649272096324317, 0.0647986802128078,
0.0646705300422657,
0.0645432331060292, 0.0644159361697927, 0.0642894962503216,
0.0641633581325718,
0.0640374058698048, 0.0639123520213522, 0.0637872981728996,
0.0636628529338745,
0.0635388079531671, 0.0634147957170244, 0.0632916833803296,
0.0631685710436349,
0.0630458582496316, 0.0629236015400187, 0.0628013448304059,
0.0626797872546894,
0.0625583083903565, 0.0624370607639964, 0.0623162812264802,
0.0621955016889641,
0.0620751949825743, 0.0619550355453773, 0.0618349810989241,
0.0617153618570817,
0.0615957426152393, 0.061476411204802, 0.0613572516059051,
0.0612381139798265,
0.061119332856999, 0.0610005517341714, 0.0608819159810892,
0.0607634315884072,
0.0606449471957252, 0.0605266604674281, 0.0604083905182476,
0.060290167123878,
0.0601720288325215, 0.0600538905411649, 0.0599357902803834,
0.0598177004076099,
0.0596996028804112, 0.0595814777830756, 0.05946335268574,
0.0593451501980616,
0.0592269058833381, 0.0591086450845101, 0.0589901972690295,
0.0588717494535489,
0.0587531539313559, 0.0586344181055761, 0.0585156822797962,
0.0583965943862447,
0.0582774858843403, 0.058158205139405, 0.0580386392149299,
0.0579190732904549,
0.0577990690769746, 0.057678960984514, 0.0575587022972876,
0.0574379673802785,
0.0573172324632694, 0.0571960194829388, 0.0570745732678006,
0.0569530443622161,
0.0568308026588895, 0.0567085609555629, 0.0565858481309063,
0.0564627271398583,
0.0563396061488102, 0.0562155537156783, 0.0560914701413874,
0.0559669689900262,
0.055841840160917, 0.0557167113318077, 0.0555906454277599,
0.0554643894225103,
0.0553378154189025, 0.0552103511990024, 0.0550828869791024,
0.0549545273783564,
0.0548257749267466, 0.0546968489978699, 0.0545667294634458,
0.0544366099290218,
0.0543056832209189, 0.0541741190686351, 0.0540425549163513,
0.0539094843846454,
0.0537763995509084, 0.0536426408703349, 0.0535079609233271,
0.0533732809763193,
0.0532371762817646, 0.0531008285862939, 0.0529639834537047,
0.0528258973401298,
0.0526878112265549, 0.0525484277356351, 0.0524085346723708,
0.0522683609288221,
0.0521265946978882, 0.0519848284669544, 0.0518419355600558,
0.0516982324350898,
0.0515545022546513, 0.0514088011807659, 0.0512631001068805,
0.0511164832414232,
0.0509687260162535, 0.0508209687910838, 0.0506713594305254,
0.0505214908857759,
0.0503709536947388, 0.0502189218775072, 0.0500668900602757,
0.0499132194106476,
0.0497589757637758, 0.0496043421640346, 0.0494478417047095,
0.0492913412453845,
0.0491334512991012, 0.0489746527949093, 0.0488157690777014,
0.0486546352193187,
0.048493501360936, 0.0483312582108308, 0.0481677557805213,
0.0480042533502119,
0.0478385926896915, 0.0476726927247726, 0.0475059885385651,
0.047337666488996,
0.0471693444394269, 0.0469991569250374, 0.0468283928042861,
0.0466571476918401,
0.0464839262201861, 0.0463107047485321, 0.046135934528639,
0.0459602452680808,
0.0457844090095907, 0.0456062464895387, 0.0454280839694868,
0.045248706185206,
0.0450680700181613, 0.0448874338511167, 0.0447045186080634,
0.0445214135945061,
0.0443374357601475, 0.0441518719818867, 0.0439663082036259,
0.0437788219402417,
0.0435908148415136, 0.0434022779963196, 0.0432118484519572,
0.0430214189075947,
0.0428294306328313, 0.0426366050028725, 0.0424435846064884,
0.0422483947766382,
0.042053204946788, 0.0418568186232714, 0.0416593020306825,
0.0414617854380936,
0.0412621082211968, 0.0410623078650923, 0.0408616627569199,
0.0406596271936386,
0.0404575916303573, 0.0402537898449218, 0.0400495731670322,
0.0398448438673895,
0.0396385056665829, 0.0394321674657763, 0.0392244442657752,
0.0390160495793191,
0.0388074457034204, 0.0385970649440253, 0.0383866841846301,
0.0381752772162295,
0.0379629860852549, 0.0377506949542804), group = c(1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1))), p = <environment>)
11: do.call(flat, c(args, list(...)))
10: .fun(piece, ...)
9: llply(.data = pieces, .fun = .fun, ..., .progress = .progress)
8: alply(.data = .data, .margins = 1, .fun = f, ..., .progress = .progress)
7: mlply(cbind(d = data, p = layers), f)
6: dlapply(function(d, p) p$reparameterise(d))
5: ggplot_build(plot)
4: ggplotGrob(x, ...)
3: grid.draw(ggplotGrob(x, ...))
2: print.ggplot(list(data = list(T = c(1, 4, 9, 16, 25, 36, 49,
64, 81, 100), E = c(0.497166644548997, 0.810376721434295, 0.646959381410852,
0.709339203080162, 0.47301630419679, 0.395266520092264, 0.916957991663367,
0.619665221078321, 0.164813995128497, 0.204367158003151)), layers = list(
<environment>, <environment>, <environment>), scales = <environment>,
mapping = list(x = T, y = E), options = list(), coordinates =
<environment>,
facet = <environment>, plot_env = <environment>))
1: print(list(data = list(T = c(1, 4, 9, 16, 25, 36, 49, 64, 81,
100), E = c(0.497166644548997, 0.810376721434295, 0.646959381410852,
0.709339203080162, 0.47301630419679, 0.395266520092264, 0.916957991663367,
0.619665221078321, 0.164813995128497, 0.204367158003151)), layers = list(
<environment>, <environment>, <environment>), scales = <environment>,
mapping = list(x = T, y = E), options = list(), coordinates =
<environment>,
facet = <environment>, plot_env = <environment>))
>

hadley wickham

unread,
Apr 21, 2009, 12:06:07 AM4/21/09
to macr...@alum.mit.edu, ggplot2
On Mon, Apr 20, 2009 at 10:06 PM, Stavros Macrakis <macr...@gmail.com> wrote:
>
> I ran into the following problem in ggplot2 0.8.2, R 2.8.1, Windows.
>
> I have a workaround, but I'd like to understand if I'm doing something
> wrong or if it's a bug.

Could you explain what you're trying to do? Why are you trying to
overlay an arbitrary line on a density plot?

Hadley

--
http://had.co.nz/

Stavros Macrakis

unread,
Apr 21, 2009, 3:32:47 PM4/21/09
to hadley wickham, ggplot2
Well, actually it should be a geom_point.

Here's an example.  Suppose I'm measuring traffic passing some
particular point.  T is the time I detect a car and E is its speed.  I
want to know the amount of traffic intensity (geom_density) and I want
a scatterplot of speed, both plotted against time, something like:

ggplot(zz,aes(x=T))+geom_density()+geom_point(aes(x=T,y=E))

Of course, the vertical scales for density and for speed need to be
different. I can't find secondary axis scales
in the doc right now, but they must be there somewhere....

By the way, I might also want a scatterplot of speed vs. traffic
intensity, but that's no longer a job for geom_stat, but for
preprocessing....

           -s

hadley wickham

unread,
Apr 26, 2009, 6:59:44 PM4/26/09
to Stavros Macrakis, ggplot2
On Tue, Apr 21, 2009 at 2:28 PM, Stavros Macrakis <macr...@alum.mit.edu> wrote:
> Well, actually it should be a geom_point.
>
> Here's an example.  Suppose I'm measuring traffic passing some
> particular point.  T is the time I detect a car and E is its speed.  I
> want to know the amount of traffic intensity (geom_density) and I want
> a scatterplot of speed, both plotted against time, something like:
>
> ggplot(zz,aes(x=T))+geom_density()+geom_point(aes(x=T,y=E))
>
> Of course, the vertical scales for density and for speed need to be
> different. I can't find secondary axis scales
> in the doc right now, but they must be there somewhere....

There are no secondary scales in ggplot2, and I don't currently have
any intention of adding them, because of the way they distort the
data.

I don't see any particularly easy way to work around this. Your best
bet would be to calculate the density yourself with density() and then
scale it to match your other x variable. I'm not sure how useful a
plot this will create, however.

Hadley


--
http://had.co.nz/

hadley wickham

unread,
Apr 27, 2009, 11:16:57 AM4/27/09
to Stavros Macrakis, ggplot2
> By "distort" I guess you mean that you find that it confuses the user
> to overlay two time series using different vertical scales?  The

Yes. The theoretical reason that I don't like multiple y scales is
because there is no longer a unique mapping between position and data
value. The practical implication of this is that it's essentially
impossible to compare two series because you can arbitrarily change
their relationship by differences in scaling.

> alternative is presumably to stack the two graphs, one over the other,
> and let the user try to see correlations by lining them up by eye?

Well, I'd recommend a scatterplot. But if you could provide a bit
more data I could offer more concrete suggestions.

Hadley

--
http://had.co.nz/

Reply all
Reply to author
Forward
0 new messages