Different results in Stata and R with the "same" anova code - r

I have some Stata code and I want to replicate the results in R. However, even with the same dataset and, I think, the same code, I get different results in R from those in Stata. I think it could be because Stata makes the order of the regression different than keyed in.
Do I need exactly the same order as in Stata to get the same results and how can I do this?
I changed all the variables to factors and tried again but the problem is still there.
I noticed that when I change the order of the explanatory variables I get different results, but I don`t find "the right order" to replicate the Stata results.
Stata code:
. anova testm2 c.testm1 i.hptreat c.cortm1 c.cortm2 i.female if inelig == 0 & anyoutv1 == 0
Number of obs =39 R-squared =0.7048
Root MSE= 16.0144 Adj R-squared =0.6601
Source | Partial SS df MS F Prob>F
---------------------------------------------------------------
Model | 20209.281 5 4041.8563 15.76 0.0000
testm1 | 3516.6527 1 3516.6527 13.71 0.0008
hptreat| 1183.5007 1 1183.5007 4.61 0.0391
cortm1 | 8.5753841 1 8.5753841 0.03 0.8560
cortm2 | 2810.9353 1 2810.9353 10.96 0.0023
female | 2557.3444 1 2557.3444 9.97 0.0034
Residual| 8463.2532 33 256.46222
----------------------------------------------------------------
Total | 28672.535 38 754.54038
R code:
FosseTest<-aov(testm2~testm1+hptreat+cortm1+cortm2+female,data=X2data)
summary(FosseTest)
Df Sum Sq Mean Sq F value Pr(>F)
testm1 1 15121 15121 58.962 7.68e-09 ***
hptreat 1 524 524 2.043 0.16228
cortm1 1 23 23 0.089 0.76715
cortm2 1 1984 1984 7.735 0.00888 **
female 1 2557 2557 9.972 0.00339 **
Residuals 33 8463 256
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
You can see that I get totally different values in the replication.
in the X2data Set I already subset the values for if inelig == 0 & anyoutv1 == 0
for the reconstruction of the data:
dput(X2data)
structure(list(id = c(29L, 30L, 31L, 32L, 34L, 35L, 36L, 37L,
39L, 41L, 42L, 43L, 44L, 46L, 47L, 49L, 50L, 51L, 52L, 53L, 54L,
55L, 57L, 58L, 59L, 60L, 61L, 62L, 64L, 65L, 66L, 67L, 68L, 69L,
70L, 71L, 72L, 73L, 74L), inelig = structure(c(1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L), .Label = c("Analytic sample (keep)", "Ineligible (drop)"
), class = "factor"), ccydrop = c(0L, 0L, 0L, 0L, 1L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
), cortm1v2 = c(0.003, 0.086, 0.047, 0.106, NA, 0.153, 0.086,
0.005, 0.133, 0.036, 0.03, 0.015, 0.014, 0.111, 0.389, 0.298,
0.4, 0.215, 0.062, 0.021, 0.075, 0.073, 0.033, 0.243, 0.126,
0.147, 0.019, 0.048, 0.28, 0.052, 0.039, 0.105, 0.111, 0.133,
0.065, 0.051, 0.143, 0.127, 0.095), cortm2v2 = c(0.025, 0.167,
0.059, 0.112, 0.171, 0.183, 0.102, 0.018, 0.08, 0.015, 0.027,
0.05, 0.025, 0.046, 0.085, 0.144, 0.155, 0.09, 0.057, 0.023,
0.038, 0.205, 0.035, 0.198, 0.112, 0.211, 0.042, 0.142, 0.328,
0.076, 0.067, 0.094, 0.245, 0.153, 0.115, 0.127, 0.257, 0.125,
0.096), cdiffv2 = c(0.022, 0.081, 0.012, 0.006, NA, 0.03, 0.016,
0.013, -0.053, -0.021, -0.003, 0.035, 0.011, -0.065, -0.304,
-0.154, -0.245, -0.125, -0.005, 0.002, -0.037, 0.132, 0.002,
-0.045, -0.014, 0.064, 0.023, 0.094, 0.048, 0.024, 0.028, -0.011,
0.134, 0.02, 0.05, 0.076, 0.114, -0.002, 0.001), testm1v2 = c(38.72,
32.77, 32.32, 17.99, 73.58, 80.69, 48.56, 21.92, 27.24, 40.93,
31.73, 60.05, 38.04, 30.17, 59.07, 26.92, 25.41, 47.81, 63.02,
34.49, 104.38, 38.08, 30.99, 35.23, 104.81, 49.33, 50.03, 11.65,
143.57, 48.31, 90.37, 48.56, 41.67, 75.23, 60.56, 39.03, 18.16,
37.9, 84.5), testm2v2 = c(62.37, 29.23, 27.51, 28.66, 44.67,
105.48, 42.67, 15.01, 21.33, 10.87, 2.14, 44.53, 35.8, 10.43,
47.54, 48.5, 38.98, 91.32, 52.94, 22.43, 58.68, 81.63, 34.79,
38.57, 94.86, 50.83, 55.75, 45.33, 111.62, 65.15, 81.08, 50.08,
44.86, 58.63, 85.85, 58.69, 16.35, 35.97, 99.08), tdiffv2 = c(23.65,
-3.54, -4.81, 10.67, -28.91, 24.79, -5.89, -6.91, -5.91, -30.06,
-29.59, -15.52, -2.24, -19.74, -11.53, 21.58, 13.57, 43.51, -10.08,
-12.06, -45.7, 43.55, 3.8, 3.34, -9.95, 1.5, 5.72, 33.68, -31.95,
16.84, -9.29000000000001, 1.52, 3.19, -16.6, 25.29, 19.66, -1.81,
-1.93, 14.58), testoutv1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L), .Label = c("Not selected", "Selected"), class = "factor"),
cortoutv1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
), .Label = c("Not selected", "Selected"), class = "factor"),
anyoutv1 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
), .Label = c("Not selected", "Selected"), class = "factor"),
testoutv2 = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
), .Label = c("Not selected", "Selected"), class = "factor"),
cortoutv2 = structure(c(1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
), .Label = c("Not selected", "Selected"), class = "factor"),
anyoutv2 = structure(c(1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
), .Label = c("Not selected", "Selected"), class = "factor"),
pose1rate = c(6L, 7L, 6L, 6L, 7L, 7L, 6L, 7L, 5L, 6L, 7L,
4L, 7L, 7L, 7L, 6L, 7L, 7L, 7L, 7L, 6L, 7L, 7L, 7L, 7L, 7L,
7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L), pose2rate = c(6L,
6L, 5L, 7L, 7L, 7L, 7L, 7L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 6L,
6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 6L, 7L, 6L, 7L, 7L, 7L,
6L, 7L, 7L, 7L, 7L, 7L, 6L, 6L), poseratem = c(6, 6.5, 5.5,
6.5, 7, 7, 6.5, 7, 5.5, 6.5, 7, 5.5, 7, 7, 7, 6, 6.5, 7,
7, 7, 6.5, 7, 7, 7, 7, 6.5, 7, 6.5, 7, 7, 7, 6.5, 7, 7, 7,
7, 7, 6.5, 6.5), saldiff = c(24.30555556, 20.83333333, 29.16666667,
18.75, 23.61111111, 34.02777778, 18.05555556, 19.44444444,
21.52777778, 15.97222222, 22.91666667, 13.88888889, 22.22222222,
25, 22.22222222, 22.22222222, 18.05555556, 17.36111111, 22.22222222,
27.08333333, 20.83333333, 24.30555556, 22.22222222, 28.47222222,
24.30555556, 25, 27.77777778, 22.22222222, 15.97222222, 24.30555556,
21.52777778, 19.44444444, 15.97222222, 15.27777778, 15.97222222,
24.30555556, 19.44444444, 24.30555556, 15.27777778), sal2manip = c(19.80555556,
16.33333333, 24.66666667, 14.25, 19.11111111, 29.52777778,
13.55555556, 14.94444444, 17.02777778, 11.47222222, 18.41666667,
9.38888889, 17.72222222, 20.5, 17.72222222, 17.72222222,
13.55555556, 12.86111111, 17.72222222, 22.58333333, 16.33333333,
19.80555556, 17.72222222, 23.97222222, 19.80555556, 20.5,
23.27777778, 17.72222222, 11.47222222, 19.80555556, 17.02777778,
14.94444444, 11.47222222, 10.77777778, 11.47222222, 19.80555556,
14.94444444, 19.80555556, 10.77777778), hptreat = structure(c(2L,
1L, 2L, 1L, 1L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 2L,
1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 1L,
2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L), .Label = c("0", "1"), class = "factor"),
female = structure(c(1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L,
1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 1L
), .Label = c("0", "1"), class = "factor"), age = c(19L,
20L, 20L, 18L, 21L, 20L, 18L, 21L, 35L, 20L, 18L, 20L, 20L,
18L, 20L, 25L, 18L, 23L, 21L, 19L, 20L, 20L, 30L, 19L, 22L,
18L, 19L, 22L, 19L, 20L, 28L, 28L, 19L, 19L, 20L, 25L, 20L,
25L, 23L), cort1a1 = c(0.004, 0.085, 0.049, 0.107, 0.486,
0.159, 0.088, 0.004, 0.138, 0.035, 0.03, 0.018, 0.017, 0.111,
0.39, 0.292, 0.396, 0.213, 0.065, 0.022, 0.074, 0.077, 0.035,
0.241, 0.126, 0.154, 0.021, 0.05, 0.296, 0.054, 0.04, 0.109,
0.114, 0.133, 0.063, 0.055, 0.149, 0.134, 0.098), cort1a2 = c(0.001,
0.086, 0.045, 0.105, 0.482, 0.147, 0.085, 0.005, 0.127, 0.037,
0.031, 0.013, 0.011, 0.111, 0.389, 0.304, 0.405, 0.218, 0.059,
0.02, 0.076, 0.069, 0.032, 0.246, 0.126, 0.141, 0.017, 0.046,
0.264, 0.051, 0.038, 0.101, 0.109, 0.133, 0.068, 0.048, 0.137,
0.12, 0.092), cort2a1 = c(0.027, 0.174, 0.056, 0.111, 0.175,
0.179, 0.103, 0.021, 0.079, 0.014, 0.028, 0.051, 0.024, 0.051,
0.083, 0.148, 0.156, 0.086, 0.062, 0.024, 0.038, 0.209, 0.036,
0.199, 0.114, 0.207, 0.041, 0.141, 0.333, 0.078, 0.065, 0.088,
0.238, 0.157, 0.119, 0.132, 0.268, 0.132, 0.099), cort2a2 = c(0.023,
0.161, 0.062, 0.113, 0.166, 0.188, 0.101, 0.016, 0.081, 0.015,
0.026, 0.049, 0.026, 0.041, 0.086, 0.139, 0.154, 0.093, 0.052,
0.022, 0.038, 0.202, 0.034, 0.198, 0.111, 0.215, 0.042, 0.142,
0.324, 0.075, 0.068, 0.101, 0.252, 0.149, 0.111, 0.123, 0.247,
0.118, 0.093), cortm1 = c(0.0024999999, 0.085500002, 0.046999998,
0.106, 0.484, 0.153, 0.086499996, 0.0044999998, 0.13249999,
0.035999998, 0.0305, 0.0155, 0.014, 0.111, 0.38949999, 0.29800001,
0.4005, 0.2155, 0.061999999, 0.021, 0.075000003, 0.072999999,
0.033500001, 0.24349999, 0.126, 0.14749999, 0.018999999,
0.048, 0.28, 0.052499998, 0.039000001, 0.105, 0.1115, 0.133,
0.065499999, 0.0515, 0.14300001, 0.127, 0.094999999), cortm2 = c(0.025,
0.1675, 0.059, 0.112, 0.1705, 0.18350001, 0.102, 0.0185,
0.079999998, 0.0145, 0.027000001, 0.050000001, 0.025, 0.046,
0.0845, 0.1435, 0.155, 0.089500003, 0.057, 0.023, 0.037999999,
0.20550001, 0.035, 0.19850001, 0.1125, 0.211, 0.041499998,
0.1415, 0.3285, 0.076499999, 0.066500001, 0.094499998, 0.245,
0.153, 0.115, 0.1275, 0.25749999, 0.125, 0.096000001), cdiff = c(0.022500001,
0.082000002, 0.012000002, 0.0060000047, -0.31349999, 0.03050001,
0.015500002, 0.014, -0.052499995, -0.021499999, -0.0034999996,
0.034500003, 0.011, -0.064999998, -0.30500001, -0.15450001,
-0.2455, -0.12599999, -0.004999999, 0.0020000003, -0.037000004,
0.13250001, 0.0014999993, -0.044999987, -0.013500005, 0.063500002,
0.022499999, 0.093499996, 0.048500001, 0.024, 0.0275, -0.010499999,
0.13350001, 0.019999996, 0.049500003, 0.075999998, 0.11449999,
-0.0020000041, 0.001000002), test1a1 = c(39.87, 33.22, 32.52,
19.74, 78.85, 83.51, 48.37, 22.31, 28.17, 41.44, 32.92, 61.4,
40.31, 30.36, 59.44, 27.52, 26.14, 46.75, 63.73, 34.03, 98.47,
36.62, 30.26, 37.15, 105.64, 47.99, 50.15, 11.33, 149.12,
48.57, 92.04, 51.22, 42.25, 77.07, 62.75, 38.8, 17.91, 40.28,
88.47), test1a2 = c(37.58, 32.32, 32.12, 16.25, 68.31, 77.88,
48.75, 21.53, 26.32, 40.42, 30.55, 58.7, 35.78, 29.97, 58.7,
26.32, 24.69, 48.87, 62.32, 34.95, 110.29, 39.53, 31.72,
33.32, 103.99, 50.67, 49.9, 11.97, 138.02, 48.05, 88.7, 45.89,
41.08, 73.39, 58.38, 39.25, 18.41, 35.53, 80.54), test2a1 = c(64.22,
29.43, 27.98, 28.17, 46.14, 105.92, 43.68, 16.41, 21.42,
11.35, 1.66, 44.17, 38.58, 11.11, 48.57, 48.31, 39.71, 92.04,
52.73, 22.3, 58.23, 82.01, 35.76, 39.59, 94.06, 50.52, 55.82,
45.91, 115.13, 67.59, 82.97, 49.89, 45.09, 57.86, 86.76,
58.83, 16.53, 36.7, 100.4), test2a2 = c(60.53, 29.04, 27.04,
29.14, 43.2, 105.05, 41.66, 13.62, 21.25, 10.39, 2.63, 44.9,
33.02, 9.75, 46.52, 48.7, 38.25, 90.59, 53.15, 22.57, 59.14,
81.24, 33.81, 37.55, 95.66, 51.14, 55.69, 44.74, 108.1, 62.71,
79.18, 50.27, 44.63, 59.39, 84.94, 58.55, 16.16, 35.24, 97.75
), testm1 = c(38.724998, 32.77, 32.32, 17.995001, 73.580002,
80.695, 48.560001, 21.92, 27.245001, 40.93, 31.735001, 60.049999,
38.044998, 30.165001, 59.07, 26.92, 25.415001, 47.810001,
63.025002, 34.490002, 104.38, 38.075001, 30.99, 35.235001,
104.815, 49.330002, 50.025002, 11.65, 143.57001, 48.310001,
90.370003, 48.555, 41.665001, 75.230003, 60.564999, 39.025002,
18.16, 37.904999, 84.504997), testm2 = c(62.375, 29.235001,
27.51, 28.655001, 44.669998, 105.485, 42.669998, 15.015,
21.334999, 10.87, 2.145, 44.535, 35.799999, 10.43, 47.544998,
48.505001, 38.98, 91.315002, 52.939999, 22.434999, 58.685001,
81.625, 34.785, 38.57, 94.860001, 50.830002, 55.755001, 45.325001,
111.615, 65.150002, 81.074997, 50.080002, 44.860001, 58.625,
85.849998, 58.689999, 16.344999, 35.970001, 99.074997), tdiff = c(23.650002,
-3.5349998, -4.8099995, 10.66, -28.910004, 24.790001, -5.8900032,
-6.9049997, -5.9100018, -30.060001, -29.59, -15.514999, -2.2449989,
-19.735001, -11.525002, 21.585001, 13.564999, 43.505001,
-10.085003, -12.055002, -45.694996, 43.549999, 3.7950001,
3.3349991, -9.9550018, 1.5, 5.7299995, 33.675003, -31.955009,
16.84, -9.2950058, 1.5250015, 3.1949997, -16.605003, 25.285,
19.664997, -1.8150005, -1.9349976, 14.57), feelpower = structure(c(2L,
3L, 1L, 2L, 1L, 2L, 3L, 3L, 3L, 3L, 3L, 4L, 3L, 1L, 2L, 1L,
1L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 3L, 4L, 3L,
4L, 3L, 1L, 3L, 4L, 2L, 2L, 3L), .Label = c("2", "3", "Not at all",
"Very much"), class = "factor"), incharge = structure(c(1L,
1L, 3L, 4L, 1L, 2L, 3L, 3L, 1L, 1L, 3L, 4L, 3L, 2L, 2L, 1L,
3L, 2L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L,
1L, 3L, 1L, 1L, 4L, 3L, 1L, 1L), .Label = c("2", "3", "Not at all",
"Very much"), class = "factor"), powm = structure(c(3L, 1L,
1L, 5L, 2L, 4L, 6L, 6L, 1L, 1L, 6L, 7L, 6L, 3L, 4L, 2L, 1L,
4L, 4L, 3L, 2L, 4L, 2L, 2L, 3L, 3L, 3L, 4L, 1L, 5L, 1L, 4L,
6L, 2L, 1L, 7L, 2L, 3L, 1L), .Label = c("1.5", "2", "2.5",
"3", "3.5", "Not at all", "Very much"), class = "factor"),
diceroll = structure(c(2L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L,
1L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 2L, 2L, 1L, 2L, 2L, 2L,
2L, 2L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 1L, 1L
), .Label = c("No", "Yes"), class = "factor")), row.names = c(2L,
3L, 4L, 5L, 7L, 8L, 9L, 10L, 12L, 14L, 15L, 16L, 17L, 19L, 20L,
22L, 23L, 24L, 25L, 26L, 27L, 28L, 30L, 31L, 32L, 33L, 34L, 35L,
37L, 38L, 39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L), class = "data.frame")

You can get the same results in R using drop1(FosseTest, test = "F"). This will test the effect of leaving one of the variables off the aov.
drop1(FosseTest, test = "F")
#
# Single term deletions
#
# Model:
# testm2 ~ testm1 + hptreat + cortm1 + cortm2 + female
# Df Sum of Sq RSS AIC F value Pr(>F)
# <none> 8463.3 221.82
# testm1 1 3516.7 11979.9 233.37 13.7122 0.0007751 ***
# hptreat 1 1183.5 9646.8 224.92 4.6147 0.0391333 *
# cortm1 1 8.6 8471.8 219.86 0.0334 0.8560279
# cortm2 1 2810.9 11274.2 231.00 10.9604 0.0022605 **
# female 1 2557.3 11020.6 230.11 9.9716 0.0033895 **
# ---
# Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
summary(FosseTest) displays the sequential effect of addeding the variables one after another.
There was a different way how to access this, but at the moment I can't remember...

Related

Weighted proportions and confidence intervals

I have tried to follow this post to calculate a weighted proportion and standard error. However, the answer provided did not have a lot of explanation so I was unsure if my calculations were correct.
I would love confirmation that what I've done is indeed correct, or alternate ways to achieve my desired outcome if incorrect?
# Test data
test <- structure(list(koala = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1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L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 3L, 2L, 3L,
2L, 2L, 3L, 2L, 1L, 1L, 1L, 3L, 3L, 2L, 3L, 2L, 2L, 1L, 1L,
1L, 1L), .Label = c("Absent", "Day", "Night"), class = "factor"),
habitat = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L), .Label = c("Exposed Sandstone Scribbly Gum", "Sheltered sandstone Blue leafed stringybark forest",
"Transitional Shale Dry Ironbark Forest"), class = "factor"),
tree.sp = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 7L, 7L, 7L, 9L, 9L,
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 12L, 12L, 13L, 13L,
13L, 13L, 13L, 14L, 14L, 14L, 14L, 2L, 2L, 2L, 7L, 7L, 7L,
9L, 13L, 1L, 1L, 1L, 2L, 2L, 10L, 11L, 11L, 13L, 13L, 1L,
1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L,
6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L,
7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 8L, 8L, 8L,
8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L,
8L, 8L, 8L, 8L, 8L, 8L, 8L, 11L, 11L, 11L, 11L, 11L, 11L,
11L, 11L, 11L, 11L, 12L, 12L, 12L, 12L), .Label = c("A. littoralis",
"C. gummifera", "E. amplifolia", "E. beyeriana", "E. crebra",
"E. fibrosa", "E. globoidea", "E. longifolia", "E. oblonga",
"E. piperita", "E. punctata", "E. resinifera", "E. sclerophylla",
"E. sieberi"), class = "factor"), cbh = c(0.76, 0.98, 0.42,
0.34, 0.4, 0.44, 0.45, 0.47, 0.66, 0.59, 0.99, 0.43, 0.35,
0.36, 0.4, 0.46, 0.52, 0.49, 0.4, 1.56, 1.26, 0.83, 1.1,
1.22, 1.04, 1.04, 1.08, 1.7, 1.35, 1.89, 0.88, 0.63, 1.26,
0.45, 1.2, 1.33, 0.41, 1.22, 0.75, 0.32, 0.52, 0.6, 1.37,
1.51, 1.29, 0.51, 0.46, 0.44, 2.35, 1.68, 1.24, 0.58, 0.53,
0.69, 0.45, 0.5, 0.5, 0.51, 1.46, 1.23, 0.32, 1.47, 2.27,
0.41, 0.59, 0.61, 0.83, 0.56, 0.41, 0.47, 0.6, 0.35, 1.91,
0.65, 0.52, 1.41, 0.95, 0.91, 1.51, 1.08, 0.95, 0.52, 1.7,
0.76, 1.03, 0.88, 1.45, 1.81, 0.4, 0.39, 0.34, 0.35, 0.89,
0.8, 1.1, 1.77, 0.52, 1.23, 0.49, 0.46, 2.27, 0.41, 1.4,
0.58, 0.66, 0.41, 0.44, 0.87, 0.51, 0.57, 0.78, 1.18, 1.41,
1.13, 1, 1.48, 1.48, 0.4, 1.8, 0.78, 0.82, 1.23, 1.51, 3.82,
0.51, 1.59, 0.95, 1.04, 1.98, 1.3, 0.88, 0.52, 1, 1.27, NA,
1.07, 0.35, 1.33, 0.45, 0.63, 0.45, 0.32, 0.56, 0.68, 1.67,
1.3, 1.83, 0.58, 0.56, 0.44, 0.9, 0.99, 0.59, 0.63, 2.53,
1.33, 2.1, 0.91, 1.24, 1.13, 1.22, 1.64, 2.35, 1.07, 1.27,
1.4, 1.88, 0.56, 1.86, 1.3, 1.97, 0.92, 1.23, 0.34, 0.8),
dbh = c(0.2419, 0.3119, 0.1337, 0.1082, 0.1273, 0.1401, 0.1432,
0.1496, 0.2101, 0.1878, 0.3151, 0.1369, 0.1114, 0.1146, 0.1273,
0.1464, 0.1655, 0.156, 0.1273, 0.4966, 0.4011, 0.2642, 0.3501,
0.3883, 0.331, 0.331, 0.3438, 0.5411, 0.4297, 0.6016, 0.2801,
0.2005, 0.4011, 0.1432, 0.382, 0.4234, 0.1305, 0.3883, 0.2387,
0.1019, 0.1655, 0.191, 0.4361, 0.4806, 0.4106, 0.1623, 0.1464,
0.1401, 0.748, 0.5348, 0.3947, 0.1846, 0.1687, 0.2196, 0.1432,
0.1592, 0.1592, 0.1623, 0.4647, 0.3915, 0.1019, 0.4679, 0.7226,
0.1305, 0.1878, 0.1942, 0.2642, 0.1783, 0.1305, 0.1496, 0.191,
0.1114, 0.608, 0.2069, 0.1655, 0.4488, 0.3024, 0.2897, 0.4806,
0.3438, 0.3024, 0.1655, 0.5411, 0.2419, 0.3279, 0.2801, 0.4615,
0.5761, 0.1273, 0.1241, 0.1082, 0.1114, 0.2833, 0.2546, 0.3501,
0.5634, 0.1655, 0.3915, 0.156, 0.1464, 0.7226, 0.1305, 0.4456,
0.1846, 0.2101, 0.1305, 0.1401, 0.2769, 0.1623, 0.1814, 0.2483,
0.3756, 0.4488, 0.3597, 0.3183, 0.4711, 0.4711, 0.1273, 0.573,
0.2483, 0.261, 0.3915, 0.4806, 1.2159, 0.1623, 0.5061, 0.3024,
0.331, 0.6303, 0.4138, 0.2801, 0.1655, 0.3183, 0.4043, NA,
0.3406, 0.1114, 0.4234, 0.1432, 0.2005, 0.1432, 0.1019, 0.1783,
0.2165, 0.5316, 0.4138, 0.5825, 0.1846, 0.1783, 0.1401, 0.2865,
0.3151, 0.1878, 0.2005, 0.8053, 0.4234, 0.6685, 0.2897, 0.3947,
0.3597, 0.3883, 0.522, 0.748, 0.3406, 0.4043, 0.4456, 0.5984,
0.1783, 0.5921, 0.4138, 0.6271, 0.2928, 0.3915, 0.1082, 0.2546
), tree.hgt = c(11.2, 9, 9.2, 6.8, 6.2, 6, 6, 6.3, 12.2,
12, 16.5, 7.4, 6.2, 9.8, 9.7, 6, 9, 7.8, 9.2, 16.6, 16.6,
13.8, 14.5, 8.4, 14.2, 15.6, 15.8, 17.8, 14.2, 17.2, 11.6,
11, 16.2, 10.6, 16.2, 14.2, 7.2, 10.2, 12.4, 9.2, 8, 16,
16.8, 15.4, 15.2, 6.6, 6.8, 7.8, 16.3, 17, 12.4, 10.8, 11,
12, 8, 9, 11.2, 14.4, 14.4, 10, 7, 15.6, 18, 6.8, 9, 6, 9.4,
10, 8.2, 8.4, 9, 6, 18.8, 12.2, 7.2, 9.4, 19.2, 14.8, 21.4,
17.4, 17.8, 11.8, 17.8, 13, 14, 14.4, 16.7, 18, 7, 7.2, 5.5,
9.2, 9.6, 14, 16, 19.2, 11, 15.5, 7.2, 9, 19.5, 7.2, 23,
17.6, 11.8, 7.2, 7.5, 14, 11.6, 9.3, 16.8, 16.6, 15, 18.6,
22.8, 20, 19.8, 9, 18.2, 14, 19.2, 16.4, 19.8, 5.8, 11.8,
17.6, 17.8, 14.6, 17.6, 16.9, 16.3, 10.8, 17.8, 17, 20, 15,
8.4, 20.6, 9.2, 14, 8.5, 8.2, 11.2, 6.6, 18.4, 18.4, 21,
9.8, 9.2, 9, 15.2, 17.2, 10.4, 8.8, 19.2, 19, 25, 14.9, 19,
17.8, 11.3, 20, 23, 12, 17.9, 17.9, 15.2, 8, 17, 13, 14,
18, 19.4, 5.4, 16), rel.abu.tree.in.hr = c(18.7, 18.7, 18.7,
18.7, 18.7, 18.7, 18.7, 18.7, 18.7, 18.7, 18.7, 18.7, 18.7,
18.7, 18.7, 18.7, 18.7, 18.7, 18.7, 17.6, 17.6, 17.6, 4.78,
4.78, 4.78, 4.78, 4.78, 4.78, 4.78, 4.78, 4.78, 4.78, 4.78,
4.78, 0.74, 0.74, 2.7, 2.7, 2.7, 2.7, 2.7, 1.47, 1.47, 1.47,
1.47, 18.7, 18.7, 18.7, 17.6, 17.6, 17.6, 4.78, 2.7, 0.78,
0.78, 0.78, 18.7, 18.7, 0.26, 3.4, 3.4, 2.7, 2.7, 0.78, 0.78,
18.7, 18.7, 18.7, 18.7, 18.7, 18.7, 18.7, 18.7, 18.7, 18.7,
18.7, 0.004, 9.19, 9.19, 9.19, 9.19, 9.19, 9.19, 9.19, 9.19,
9.19, 9.19, 9.19, 9.19, 9.19, 9.19, 9.19, 9.19, 9.19, 9.19,
9.19, 9.19, 9.19, 14.7, 14.7, 14.7, 14.7, 14.7, 14.7, 14.7,
14.7, 14.7, 14.7, 14.7, 14.7, 14.7, 14.7, 14.7, 17.6, 17.6,
17.6, 17.6, 17.6, 17.6, 17.6, 17.6, 17.6, 17.6, 17.6, 17.6,
17.6, 17.6, 17.6, 17.6, 17.6, 17.6, 17.6, 17.6, 17.6, 17.6,
17.6, 16.53, 16.53, 16.53, 16.53, 16.53, 16.53, 16.53, 16.53,
16.53, 16.53, 16.53, 16.53, 16.53, 16.53, 16.53, 16.53, 16.53,
16.53, 16.53, 16.53, 16.53, 16.53, 16.53, 16.53, 16.53, 3.4,
3.4, 3.4, 3.4, 3.4, 3.4, 3.4, 3.4, 3.4, 3.4, 0.74, 0.74,
0.74, 0.74), prop.hab.class.in.hr = c(18.42105263, 18.42105263,
18.42105263, 18.42105263, 18.42105263, 18.42105263, 18.42105263,
18.42105263, 18.42105263, 18.42105263, 18.42105263, 18.42105263,
18.42105263, 18.42105263, 18.42105263, 18.42105263, 18.42105263,
18.42105263, 18.42105263, 18.42105263, 18.42105263, 18.42105263,
18.42105263, 18.42105263, 18.42105263, 18.42105263, 18.42105263,
18.42105263, 18.42105263, 18.42105263, 18.42105263, 18.42105263,
18.42105263, 18.42105263, 18.42105263, 18.42105263, 18.42105263,
18.42105263, 18.42105263, 18.42105263, 18.42105263, 18.42105263,
18.42105263, 18.42105263, 18.42105263, 18.42105263, 18.42105263,
18.42105263, 18.42105263, 18.42105263, 18.42105263, 18.42105263,
18.42105263, 2.631578947, 2.631578947, 2.631578947, 2.631578947,
2.631578947, 2.631578947, 2.631578947, 2.631578947, 2.631578947,
2.631578947, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842, 78.94736842, 78.94736842,
78.94736842, 78.94736842, 78.94736842), k.pres = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L,
1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L,
2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L), .Label = c("0", "1"), class = "factor"),
rel_abun = c(344.473684181, 344.473684181, 344.473684181,
344.473684181, 344.473684181, 344.473684181, 344.473684181,
344.473684181, 344.473684181, 344.473684181, 344.473684181,
344.473684181, 344.473684181, 344.473684181, 344.473684181,
344.473684181, 344.473684181, 344.473684181, 344.473684181,
324.210526288, 324.210526288, 324.210526288, 88.0526315714,
88.0526315714, 88.0526315714, 88.0526315714, 88.0526315714,
88.0526315714, 88.0526315714, 88.0526315714, 88.0526315714,
88.0526315714, 88.0526315714, 88.0526315714, 13.6315789462,
13.6315789462, 49.736842101, 49.736842101, 49.736842101,
49.736842101, 49.736842101, 27.0789473661, 27.0789473661,
27.0789473661, 27.0789473661, 344.473684181, 344.473684181,
344.473684181, 324.210526288, 324.210526288, 324.210526288,
88.0526315714, 49.736842101, 2.05263157866, 2.05263157866,
2.05263157866, 49.2105263089, 49.2105263089, 0.68421052622,
8.9473684198, 8.9473684198, 7.1052631569, 7.1052631569, 61.5789473676,
61.5789473676, 1476.315789454, 1476.315789454, 1476.315789454,
1476.315789454, 1476.315789454, 1476.315789454, 1476.315789454,
1476.315789454, 1476.315789454, 1476.315789454, 1476.315789454,
0.31578947368, 725.5263157798, 725.5263157798, 725.5263157798,
725.5263157798, 725.5263157798, 725.5263157798, 725.5263157798,
725.5263157798, 725.5263157798, 725.5263157798, 725.5263157798,
725.5263157798, 725.5263157798, 725.5263157798, 725.5263157798,
725.5263157798, 725.5263157798, 725.5263157798, 725.5263157798,
725.5263157798, 725.5263157798, 1160.526315774, 1160.526315774,
1160.526315774, 1160.526315774, 1160.526315774, 1160.526315774,
1160.526315774, 1160.526315774, 1160.526315774, 1160.526315774,
1160.526315774, 1160.526315774, 1160.526315774, 1160.526315774,
1160.526315774, 1389.473684192, 1389.473684192, 1389.473684192,
1389.473684192, 1389.473684192, 1389.473684192, 1389.473684192,
1389.473684192, 1389.473684192, 1389.473684192, 1389.473684192,
1389.473684192, 1389.473684192, 1389.473684192, 1389.473684192,
1389.473684192, 1389.473684192, 1389.473684192, 1389.473684192,
1389.473684192, 1389.473684192, 1389.473684192, 1389.473684192,
1304.9999999826, 1304.9999999826, 1304.9999999826, 1304.9999999826,
1304.9999999826, 1304.9999999826, 1304.9999999826, 1304.9999999826,
1304.9999999826, 1304.9999999826, 1304.9999999826, 1304.9999999826,
1304.9999999826, 1304.9999999826, 1304.9999999826, 1304.9999999826,
1304.9999999826, 1304.9999999826, 1304.9999999826, 1304.9999999826,
1304.9999999826, 1304.9999999826, 1304.9999999826, 1304.9999999826,
1304.9999999826, 268.421052628, 268.421052628, 268.421052628,
268.421052628, 268.421052628, 268.421052628, 268.421052628,
268.421052628, 268.421052628, 268.421052628, 58.4210526308,
58.4210526308, 58.4210526308, 58.4210526308)), row.names = c(NA,
-175L), class = "data.frame")
# Calculate a weighted proportion for test$tree.sp
# Weighting variable is test$rel.abu.tree.in.hr
# Calculate weighted proportion
library(survey)
dsurvey <- svydesign(ids = ~1, data = test, weights = ~rel.abu.tree.in.hr)
wpct <- data.frame(svymean(~tree.sp, design = dsurvey))
Outcome of above
wpct
mean SE
tree.spA. littoralis 1.830415e-03 8.345005e-04
tree.spC. gummifera 3.071812e-01 4.180415e-02
tree.spE. amplifolia 1.877349e-06 1.889682e-06
tree.spE. beyeriana 4.744530e-02 1.424895e-02
tree.spE. crebra 4.313209e-02 1.359431e-02
tree.spE. fibrosa 1.034889e-01 2.547820e-02
tree.spE. globoidea 2.395497e-01 3.825613e-02
tree.spE. longifolia 1.939536e-01 3.472975e-02
tree.spE. oblonga 2.916462e-02 8.264006e-03
tree.spE. piperita 1.220277e-04 1.228147e-04
tree.spE. punctata 1.914896e-02 5.681831e-03
tree.spE. resinifera 2.083857e-03 8.701564e-04
tree.spE. sclerophylla 1.013768e-02 3.663735e-03
tree.spE. sieberi 2.759703e-03 1.400363e-03

Connecting points by levels of a variable

I have a dataset that I'm using in RStudio, and I have the code ggplot(desktop_2015) + geom_point(aes(Month, CV, color = Day), size = 2.5) in order to get a graph that I need.
I am plotting the variable CV by Month, and for each month there are 7 points along the vertical, each a different color representing a level of the variable Day.
What I am trying to do is connect the points for each day across the months, ie a line connecting each Friday point across the 12 months, and so on for each day of the week. I have attached images of what my dataset looks like in addition to the graph I currently have. TIA!
Here's the dput output of my dataset:
structure(list(Year = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("2015",
"2016", "2017", "2018", "2019"), class = "factor"), Quarter = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L), .Label = c("1", "2", "3", "4"), class = "factor"),
Month = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L,
6L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 8L, 8L, 8L, 8L, 8L, 8L,
8L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 10L, 10L, 10L, 10L, 10L,
10L, 10L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 12L, 12L, 12L,
12L, 12L, 12L, 12L), .Label = c("Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"), class = "factor"),
Device = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L
), .Label = c("D", "M", "T"), class = "factor"), Day = structure(c(4L,
2L, 6L, 7L, 5L, 1L, 3L, 4L, 2L, 6L, 7L, 5L, 1L, 3L, 4L, 2L,
6L, 7L, 5L, 1L, 3L, 4L, 2L, 6L, 7L, 5L, 1L, 3L, 4L, 2L, 6L,
7L, 5L, 1L, 3L, 4L, 2L, 6L, 7L, 5L, 1L, 3L, 4L, 2L, 6L, 7L,
5L, 1L, 3L, 4L, 2L, 6L, 7L, 5L, 1L, 3L, 4L, 2L, 6L, 7L, 5L,
1L, 3L, 4L, 2L, 6L, 7L, 5L, 1L, 3L, 4L, 2L, 6L, 7L, 5L, 1L,
3L, 4L, 2L, 6L, 7L, 5L, 1L, 3L), .Label = c("Friday", "Monday",
"Saturday", "Sunday", "Thursday", "Tuesday", "Wednesday"), class = "factor"),
Clicks = c(1479, 1631, 1471, 1382, 1926, 1724, 1928, 1233,
1380, 1164, 1145, 1187, 1082, 1201, 1927, 1825, 1592, 1232,
1225, 1181, 1320, 1437, 1357, 1487, 1769, 1655, 1256, 1318,
1512, 1508, 1358, 1176, 1111, 1364, 1316, 1441, 2131, 1956,
1455, 1431, 1280, 1288, 2106, 2326, 2109, 2474, 2397, 2200,
1721, 2598, 2767, 2112, 2045, 1997, 1771, 2352, 2075, 2441,
2670, 2543, 1973, 1876, 1920, 2206, 2529, 2134, 2000, 2514,
2551, 2758, 3087, 3219, 2314, 2150, 1906, 1997, 2335, 1957,
2272, 2617, 2489, 2199, 1657, 1945), Conversions = c(67,
95, 110, 101, 88, 105, 114, 89, 92, 79, 67, 72, 96, 76, 139,
125, 89, 47, 63, 73, 78, 97, 127, 69, 96, 61, 50, 90, 83,
91, 85, 56, 117, 66, 94, 48, 86, 71, 63, 53, 46, 56, 67,
75, 64, 64, 63, 55, 59, 74, 71, 62, 59, 57, 40, 71, 69, 84,
80, 101, 61, 76, 56, 93, 69, 50, 47, 73, 67, 98, 108, 127,
59, 67, 68, 88, 77, 60, 69, 82, 72, 55, 44, 54), CV = c(9089.21,
7811.24, 13201.19, 11394.8, 12631.15, 12389.61, 11742.6,
10265.62, 12449.76, 9329.68, 8255.08, 9002.71, 13173.41,
6235.05, 15480.72, 17940.65, 13667.19, 5766.98, 7583.03,
6817.59, 6412.43, 10441.66, 23018.46, 9243.69, 10521.5, 15117.06,
5791.93, 7783.52, 8156.31, 9996.18, 12973.64, 6329.24, 20080.53,
6289.64, 10891.91, 7176.93, 10281.64, 10292.1, 10077.85,
9299.89, 5979.86, 6888.64, 6799.56, 13162.34, 10267.85, 10599.65,
8868.4, 7285.48, 8393, 9930.09, 10857.6, 12568.96, 9998.93,
8465.09, 6733.55, 11107.85, 10919.87, 12933.21, 14653.55,
22648.43, 13272.86, 15214.25, 9733.4, 18128.61, 12915.65,
10267.21, 9804.48, 11928.58, 14135.84, 19990.35, 15482.84,
20116.57, 12705.79, 12891.93, 11266.43, 16632.9, 11890.34,
9290.67, 11417.62, 18980.21, 11025.63, 7806.93, 7246.12,
7737.87), `Conv. rate` = c(0.0453, 0.0582, 0.0748, 0.0731,
0.0457, 0.0609, 0.0591, 0.0722, 0.0667, 0.0679, 0.0585, 0.0607,
0.0887, 0.0633, 0.0721, 0.0685, 0.0559, 0.0381, 0.0514, 0.0618,
0.0591, 0.0675, 0.0936, 0.0464, 0.0543, 0.0369, 0.0398, 0.0683,
0.0549, 0.0603, 0.0626, 0.0476, 0.1053, 0.0484, 0.0714, 0.0333,
0.0404, 0.0363, 0.0433, 0.037, 0.0359, 0.0435, 0.0318, 0.0322,
0.0303, 0.0259, 0.0263, 0.025, 0.0343, 0.0285, 0.0257, 0.0294,
0.0289, 0.0285, 0.0226, 0.0302, 0.0333, 0.0344, 0.03, 0.0397,
0.0309, 0.0405, 0.0292, 0.0422, 0.0273, 0.0234, 0.0235, 0.029,
0.0263, 0.0355, 0.035, 0.0395, 0.0255, 0.0312, 0.0357, 0.0441,
0.033, 0.0307, 0.0304, 0.0313, 0.0289, 0.025, 0.0266, 0.0278
), `CV/Click` = c(6.15, 4.79, 8.97, 8.25, 6.56, 7.19, 6.09,
8.33, 9.02, 8.02, 7.21, 7.58, 12.18, 5.19, 8.03, 9.83, 8.58,
4.68, 6.19, 5.77, 4.86, 7.27, 16.96, 6.22, 5.95, 9.13, 4.61,
5.91, 5.39, 6.63, 9.55, 5.38, 18.07, 4.61, 8.28, 4.98, 4.82,
5.26, 6.93, 6.5, 4.67, 5.35, 3.23, 5.66, 4.87, 4.28, 3.7,
3.31, 4.88, 3.82, 3.92, 5.95, 4.89, 4.24, 3.8, 4.72, 5.26,
5.3, 5.49, 8.91, 6.73, 8.11, 5.07, 8.22, 5.11, 4.81, 4.9,
4.74, 5.54, 7.25, 5.02, 6.25, 5.49, 6, 5.91, 8.33, 5.09,
4.75, 5.03, 7.25, 4.43, 3.55, 4.37, 3.98), Impressions = c(86045,
89512, 81503, 81356, 101254, 95972, 100790, 73492, 81709,
71678, 67884, 68429, 61978, 69537, 99440, 99735, 95689, 71773,
71414, 65363, 69422, 77640, 76419, 81980, 97540, 90953, 67780,
68886, 81265, 79079, 70807, 65774, 59298, 72504, 71965, 92817,
132684, 120931, 93380, 89791, 82604, 79651, 121598, 141042,
132627, 167622, 146056, 133295, 103366, 151998, 170043, 142676,
126557, 121835, 121060, 139303, 113975, 127019, 151171, 140981,
110230, 108527, 106218, 123960, 136940, 123136, 120845, 145673,
136340, 144527, 185146, 210133, 157902, 135150, 124981, 132650,
136682, 127909, 156160, 219576, 187283, 143617, 107303, 128768
), Cost = c(1376.23, 1799.57, 1646.93, 1631.22, 2088.67,
1869.83, 1779.56, 1152.91, 1643.25, 1281.38, 1368.1, 1299.16,
1184.99, 1183.82, 1690.38, 2065.43, 1737.26, 1351.85, 1432.21,
1395.46, 1192.53, 1385.88, 1548.41, 1754.96, 2148.9, 2061.52,
1481.82, 1400.12, 1595.65, 1808.54, 1643.06, 1417.31, 1343.52,
1794.69, 1317.59, 1436.56, 2344.1, 2124.41, 1602.12, 1449.17,
1417.73, 1337.39, 1773.49, 2018.75, 1813.7, 2181.56, 2069.48,
1938.4, 1528.46, 1907.15, 2163.95, 1645.47, 1620.2, 1552.78,
1326.68, 1749.51, 1466.75, 1851.91, 1997.14, 1909.85, 1506.9,
1391.86, 1420.54, 1671.03, 1948.89, 1657.35, 1577.12, 1888.6,
1934.2, 2055.61, 2357.6, 2426.16, 1730.51, 1652.82, 1464.03,
1550.73, 1736.98, 1364.01, 1625.97, 1835.38, 1714.8, 1584.55,
1109.67, 1340.77)), row.names = c(2L, 4L, 7L, 12L, 15L, 18L,
19L, 23L, 26L, 28L, 31L, 36L, 38L, 40L, 44L, 47L, 51L, 52L, 57L,
58L, 63L, 64L, 69L, 72L, 74L, 78L, 81L, 82L, 85L, 89L, 92L, 95L,
97L, 100L, 105L, 107L, 111L, 113L, 116L, 119L, 121L, 124L, 127L,
130L, 135L, 136L, 141L, 142L, 147L, 149L, 152L, 154L, 158L, 161L,
163L, 167L, 171L, 174L, 177L, 178L, 181L, 185L, 188L, 191L, 194L,
198L, 201L, 202L, 207L, 208L, 211L, 215L, 218L, 221L, 225L, 228L,
230L, 232L, 236L, 238L, 242L, 246L, 247L, 250L), class = "data.frame")
I think you need to provide both group and color in your aes:
library(ggplot2)
ggplot(df, aes(x = Month, y = CV, color = Day, group = Day))+
geom_point()+
geom_line()

combine facet_grid (ggplot2) with denscomp (fitdistrplus)

First off, I am an R newbie. I am trying to apply density plots to various groups within my data. Using fitdistrplus, I have created a single distribution density plot for all of my data.
plot(my_data, pch=20)
plotdist(my_data$Capture_Rate, histo = TRUE, demp = TRUE)
fit_w <- fitdist(my_data$Capture_Rate, "weibull")
fit_g <- fitdist(my_data$Capture_Rate, "gamma")
fit_ln <- fitdist(my_data$Capture_Rate, "lnorm")
par(mfrow=c(2,2))
plot.legend <- c("Weibull", "lognormal", "gamma")
denscomp(list(fit_w, fit_ln, fit_g), legendtext = plot.legend)
Using facet_grid in ggplot, I have created a grid of histograms for each grouping of my data.
df_data <- data.frame(my_data)
cdat <- ddply(df_data, c("sYear", "Season"), summarise, Capture_Rate.mean=mean(Capture_Rate))
ggplot(df_data, aes(x=Capture_Rate, fill=sYear))+
geom_histogram(binwidth = .025,
alpha = .5,
position = "identity")+
#geom_density(alpha=.2, fill="#FF6666")+
geom_vline(data=cdat, aes(xintercept=Capture_Rate.mean),
color="red", linetype="dashed", size=1)+
facet_grid(Season ~ sYear)
What I am looking for is to combine the two results where I get a density plot for each histogram in my grouping grid. Thank you for the assistance.
Sample Data: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, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L), .Label = "38K", class = "factor"), sDate = structure(c(17664,
17665, 17666, 17667, 17668, 17669, 17670, 17672, 17674, 17675,
17676, 17677, 17678, 17679, 17680, 17681, 17682, 17683, 17684,
17685, 17686, 17687, 17688, 17689, 17690, 17691, 17692, 17693,
17694, 17696, 17697, 17698, 17699, 17700, 17701, 17702, 17703,
17704, 17705, 17706, 17707, 17708, 17710, 17711, 17712, 17713,
17714, 17715, 17716, 17717, 17718, 17719, 17720, 17721, 17722,
17723, 17724, 17725, 17728, 17729, 17730, 17731, 17732, 17733,
17734, 17735, 17736, 17737, 17738, 17739, 17740, 17741, 17742,
17743, 17744, 17745, 17746, 17747, 17748, 17749, 17750, 17751,
17753, 17754, 17755, 17758, 17759, 17761, 17762, 17763, 17764,
17765, 17766, 17767, 17768, 17769, 17770, 17771, 17772, 17773,
17774, 17775, 17776, 17777, 17778, 17779, 17781, 17782, 17783,
17784, 17785, 17786, 17787, 17788, 17789, 17790, 17791, 17792,
17793, 17794, 17795, 17796, 17797, 17798, 17799, 17800, 17801,
17802, 17803, 17804, 17805, 17806, 17807, 17808, 17809, 17810,
17811, 17812, 17813, 17814, 17815, 17816, 17817, 17818, 17819,
17820, 17821, 17822, 17823, 17824, 17825, 17826, 17827, 17828,
17829, 17830, 17831, 17832, 17833, 17834, 17835, 17836, 17837,
17838, 17839, 17840, 17841, 17842, 17843, 17844, 17845, 17846,
17847, 17848, 17849, 17850, 17851, 17852, 17853, 17854, 17855,
17856, 17857, 17858, 17859, 17860, 17861, 17862, 17863, 17864,
17865, 17866, 17867, 17868, 17869, 17870, 17871, 17872, 17873,
17874, 17875, 17876, 17877, 17878, 17879, 17880, 17881, 17882,
17883, 17884, 17885, 17886, 17887, 17888, 17889, 17890, 17891,
17892, 17893, 17894, 17895, 17896, 17897, 17898, 17899, 17900,
17901, 17902, 17903, 17904, 17905, 17906, 17907, 17908, 17909,
17910, 17911, 17912, 17913, 17914, 17915, 17916, 17917, 17918,
17919, 17920, 17921, 17922, 17923, 17924, 17925, 17926, 17927,
17928, 17929, 17930, 17931, 17932, 17933, 17934, 17935, 17936,
17937, 17938, 17939, 17940, 17941, 17942, 17943, 17944, 17945,
17946, 17947, 17948, 17949, 17950, 17951, 17952, 17953, 17954,
17955, 17956, 17957, 17958, 17959, 17960, 17961, 17962, 17963,
17964, 17965, 17966, 17967, 17968, 17969, 17970, 17971, 17972,
17973, 17974, 17975, 17976, 17977, 17978, 17979, 17980, 17981,
17982, 17983, 17984, 17985, 17986, 17987, 17988, 17989, 17990,
17991, 17992, 17993, 17994, 17995, 17996, 17997, 17998, 17999,
18000, 18001, 18002, 18003, 18004, 18005, 18006, 18007, 18008,
18009, 18010, 18011, 18012, 18013, 18014, 18015, 18016, 18017,
18018, 18019, 18020, 18021, 18022, 18023, 18024, 18025, 18026,
18027, 18028, 18029, 18030, 18031, 18032, 18033, 18034, 18035,
18036, 18037, 18038, 18039, 18040, 18041, 18042, 18043, 18044,
18045, 18046, 18047, 18048, 18049, 18050, 18051, 18052, 18053,
18054, 18055, 18056, 18057, 18058, 18059, 18060, 18061, 18062,
18063, 18064, 18065, 18066, 18067, 18068, 18069, 18070, 18071,
18072, 18073, 18074, 18075, 18076, 18077, 18078, 18079, 18080,
18081, 18082, 18083, 18084, 18085, 18086, 18087, 18088, 18089,
18090, 18091, 18092), class = "Date"), Active_Tails = c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L,
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 7L, 8L, 10L,
10L, 10L, 11L, 11L, 11L, 11L, 11L, 12L, 12L, 12L, 12L, 12L,
12L, 13L, 13L, 14L, 14L, 14L, 14L, 15L, 16L, 16L, 16L, 16L,
16L, 16L, 16L, 17L, 18L, 18L, 19L, 19L, 19L, 20L, 21L, 21L,
21L, 22L, 22L, 23L, 24L, 25L, 26L, 26L, 26L, 26L, 25L, 26L,
26L, 27L, 27L, 28L, 28L, 28L, 28L, 28L, 29L, 30L, 30L, 31L,
32L, 33L, 33L, 34L, 34L, 34L, 35L, 35L, 36L, 36L, 36L, 37L,
37L, 37L, 37L, 38L, 40L, 41L, 41L, 41L, 41L, 41L, 41L, 41L,
41L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 43L, 45L, 46L,
46L, 46L, 46L, 46L, 46L, 47L, 48L, 48L, 49L, 49L, 49L, 49L,
50L, 51L, 51L, 52L, 52L, 52L, 52L, 53L, 53L, 54L, 55L, 55L,
55L, 55L, 56L, 56L, 56L, 58L, 58L, 58L, 58L, 60L, 59L, 59L,
60L, 60L, 60L, 60L, 61L, 62L, 63L, 63L, 63L, 63L, 65L, 65L,
65L, 66L, 66L, 66L, 66L, 66L, 66L, 66L, 67L, 67L, 67L, 67L,
67L, 68L, 68L, 68L, 68L, 69L, 69L, 69L, 69L, 69L, 69L, 69L,
69L, 69L, 69L, 69L, 69L, 69L, 69L, 69L, 69L, 69L, 69L, 69L,
69L, 69L, 69L, 69L, 69L, 69L, 69L, 70L, 70L, 70L, 69L, 70L,
70L, 71L, 71L, 70L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L,
71L, 71L, 70L, 70L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L,
71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L,
71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L,
71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L,
71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L,
71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L, 71L,
71L, 71L, 71L, 71L, 71L, 71L, 71L), MX_Credits = c(1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 1L,
2L, 2L, 1L, 2L, 1L, 3L, 4L, 3L, 2L, 4L, 4L, 1L, 3L, 2L, 4L,
4L, 3L, 3L, 4L, 2L, 5L, 5L, 4L, 4L, 6L, 7L, 2L, 4L, 6L, 4L,
7L, 9L, 6L, 4L, 7L, 3L, 9L, 6L, 9L, 7L, 7L, 8L, 7L, 5L, 8L,
10L, 11L, 9L, 6L, 8L, 5L, 7L, 6L, 9L, 10L, 8L, 10L, 7L, 9L,
11L, 9L, 10L, 11L, 8L, 10L, 11L, 11L, 9L, 8L, 9L, 13L, 13L,
16L, 15L, 10L, 13L, 16L, 12L, 10L, 14L, 17L, 12L, 12L, 13L,
15L, 18L, 14L, 24L, 15L, 20L, 17L, 17L, 14L, 22L, 19L, 21L,
23L, 16L, 19L, 23L, 16L, 22L, 17L, 17L, 15L, 22L, 21L, 16L,
19L, 19L, 18L, 14L, 23L, 23L, 25L, 17L, 15L, 22L, 21L, 17L,
19L, 17L, 20L, 23L, 22L, 22L, 22L, 19L, 19L, 25L, 22L, 25L,
25L, 21L, 22L, 24L, 24L, 22L, 20L, 26L, 22L, 22L, 26L, 25L,
24L, 27L, 27L, 26L, 24L, 28L, 23L, 27L, 25L, 25L, 27L, 27L,
23L, 28L, 23L, 23L, 29L, 32L, 23L, 19L, 30L, 27L, 30L, 29L,
25L, 29L, 26L, 24L, 30L, 30L, 33L, 24L, 31L, 30L, 28L, 28L,
29L, 35L, 33L, 30L, 33L, 35L, 37L, 32L, 32L, 36L, 30L, 31L,
33L, 33L, 31L, 33L, 33L, 37L, 33L, 33L, 38L, 37L, 37L, 38L,
34L, 36L, 38L, 28L, 35L, 30L, 33L, 38L, 39L, 30L, 34L, 32L,
28L, 37L, 33L, 36L, 39L, 33L, 36L, 34L, 39L, 28L, 39L, 39L,
32L, 30L, 35L, 33L, 37L, 25L, 32L, 30L, 28L, 39L, 36L, 33L,
38L, 40L, 37L, 33L, 35L, 43L, 30L, 32L, 40L, 36L, 30L, 31L,
41L, 29L, 31L, 38L, 41L, 34L, 35L, 42L, 34L, 33L, 40L, 33L,
31L, 38L, 37L, 29L, 33L, 35L, 38L, 34L, 33L, 36L, 39L, 33L,
33L, 31L, 33L, 36L, 33L, 38L, 33L, 30L, 28L, 30L, 28L, 37L,
34L, 33L, 33L, 34L, 35L, 31L, 38L, 30L, 35L, 30L, 45L, 35L,
31L, 30L, 26L, 26L, 35L, 34L, 26L, 34L, 36L, 31L, 31L), Capture_Rate = 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, 0.5, 0.5,
1, 1, 0.5, 1, 0.5, 1, 1, 1, 1, 1, 0.5, 0.5, 1, 1, 0.5, 1,
0.33, 1, 1, 0.75, 0.5, 1, 1, 0.25, 0.6, 0.4, 0.8, 0.8, 0.6,
0.6, 0.8, 0.4, 1, 1, 0.67, 0.67, 1, 1, 0.25, 0.4, 0.6, 0.4,
0.64, 0.82, 0.55, 0.36, 0.64, 0.25, 0.75, 0.5, 0.75, 0.58,
0.58, 0.62, 0.54, 0.36, 0.57, 0.71, 0.79, 0.6, 0.38, 0.5,
0.31, 0.44, 0.38, 0.56, 0.63, 0.47, 0.56, 0.39, 0.47, 0.58,
0.47, 0.5, 0.52, 0.38, 0.48, 0.5, 0.5, 0.39, 0.33, 0.36,
0.5, 0.5, 0.62, 0.58, 0.4, 0.5, 0.62, 0.44, 0.37, 0.5, 0.61,
0.43, 0.43, 0.46, 0.52, 0.6, 0.47, 0.77, 0.47, 0.61, 0.52,
0.5, 0.41, 0.65, 0.54, 0.6, 0.64, 0.44, 0.53, 0.62, 0.43,
0.59, 0.46, 0.45, 0.38, 0.54, 0.51, 0.39, 0.46, 0.46, 0.44,
0.34, 0.56, 0.53, 0.58, 0.4, 0.35, 0.51, 0.49, 0.4, 0.44,
0.4, 0.44, 0.5, 0.48, 0.48, 0.48, 0.41, 0.41, 0.53, 0.46,
0.52, 0.51, 0.43, 0.45, 0.49, 0.48, 0.43, 0.39, 0.5, 0.42,
0.42, 0.5, 0.47, 0.45, 0.5, 0.49, 0.47, 0.44, 0.51, 0.41,
0.48, 0.45, 0.43, 0.47, 0.47, 0.4, 0.47, 0.39, 0.39, 0.48,
0.53, 0.38, 0.32, 0.49, 0.44, 0.48, 0.46, 0.4, 0.46, 0.4,
0.37, 0.46, 0.45, 0.5, 0.36, 0.47, 0.45, 0.42, 0.42, 0.43,
0.52, 0.49, 0.45, 0.49, 0.51, 0.54, 0.47, 0.47, 0.52, 0.43,
0.45, 0.48, 0.48, 0.45, 0.48, 0.48, 0.54, 0.48, 0.48, 0.55,
0.54, 0.54, 0.55, 0.49, 0.52, 0.55, 0.41, 0.51, 0.43, 0.48,
0.55, 0.57, 0.43, 0.49, 0.46, 0.4, 0.53, 0.48, 0.51, 0.56,
0.46, 0.51, 0.49, 0.55, 0.39, 0.55, 0.55, 0.45, 0.42, 0.49,
0.46, 0.52, 0.35, 0.46, 0.43, 0.39, 0.55, 0.51, 0.46, 0.54,
0.56, 0.52, 0.46, 0.49, 0.61, 0.42, 0.45, 0.56, 0.51, 0.42,
0.44, 0.58, 0.41, 0.44, 0.54, 0.58, 0.48, 0.49, 0.59, 0.48,
0.46, 0.56, 0.46, 0.44, 0.54, 0.52, 0.41, 0.46, 0.49, 0.54,
0.48, 0.46, 0.51, 0.55, 0.46, 0.46, 0.44, 0.46, 0.51, 0.46,
0.54, 0.46, 0.42, 0.39, 0.42, 0.39, 0.52, 0.48, 0.46, 0.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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.5, 0.5, 1, 1, 0.5,
1, 0.5, 1, 1, 1, 1, 1, 0.5, 0.5, 1, 1, 0.5, 1, 0.33, 1, 1,
0.75, 0.5, 1, 1, 0.25, 0.6, 0.4, 0.8, 0.8, 0.6, 0.6, 0.8,
0.4, 1, 1, 0.67, 0.67, 1, 1, 0.25, 0.4, 0.6, 0.4, 0.64, 0.82,
0.55, 0.36, 0.64, 0.25, 0.75, 0.5, 0.75, 0.58, 0.58, 0.62,
0.54, 0.36, 0.57, 0.71, 0.79, 0.6, 0.38, 0.5, 0.31, 0.44,
0.38, 0.56, 0.63, 0.47, 0.56, 0.39, 0.47, 0.58, 0.47, 0.5,
0.52, 0.38, 0.48, 0.5, 0.5, 0.39, 0.33, 0.36, 0.5, 0.5, 0.62,
0.58, 0.4, 0.5, 0.62, 0.44, 0.37, 0.5, 0.61, 0.43, 0.43,
0.46, 0.52, 0.6, 0.47, 0.77, 0.47, 0.61, 0.52, 0.5, 0.41,
0.65, 0.54, 0.6, 0.64, 0.44, 0.53, 0.62, 0.43, 0.59, 0.46,
0.45, 0.38, 0.54, 0.51, 0.39, 0.46, 0.46, 0.44, 0.34, 0.56,
0.53, 0.58, 0.4, 0.35, 0.51, 0.49, 0.4, 0.44, 0.4, 0.44,
0.5, 0.48, 0.48, 0.48, 0.41, 0.41, 0.53, 0.46, 0.52, 0.51,
0.43, 0.45, 0.49, 0.48, 0.43, 0.39, 0.5, 0.42, 0.42, 0.5,
0.47, 0.45, 0.5, 0.49, 0.47, 0.44, 0.51, 0.41, 0.48, 0.45,
0.43, 0.47, 0.47, 0.4, 0.47, 0.39, 0.39, 0.48, 0.53, 0.38,
0.32, 0.49, 0.44, 0.48, 0.46, 0.4, 0.46, 0.4, 0.37, 0.46,
0.45, 0.5, 0.36, 0.47, 0.45, 0.42, 0.42, 0.43, 0.52, 0.49,
0.45, 0.49, 0.51, 0.54, 0.47, 0.47, 0.52, 0.43, 0.45, 0.48,
0.48, 0.45, 0.48, 0.48, 0.54, 0.48, 0.48, 0.55, 0.54, 0.54,
0.55, 0.49, 0.52, 0.55, 0.41, 0.51, 0.43, 0.48, 0.55, 0.57,
0.43, 0.49, 0.46, 0.4, 0.53, 0.48, 0.51, 0.56, 0.46, 0.51,
0.49, 0.55, 0.39, 0.55, 0.55, 0.45, 0.42, 0.49, 0.46, 0.52,
0.35, 0.46, 0.43, 0.39, 0.55, 0.51, 0.46, 0.54, 0.56, 0.52,
0.46, 0.49, 0.61, 0.42, 0.45, 0.56, 0.51, 0.42, 0.44, 0.58,
0.41, 0.44, 0.54, 0.58, 0.48, 0.49, 0.59, 0.48, 0.46, 0.56,
0.46, 0.44, 0.54, 0.52, 0.41, 0.46, 0.49, 0.54, 0.48, 0.46,
0.51, 0.55, 0.46, 0.46, 0.44, 0.46, 0.51, 0.46, 0.54, 0.46,
0.42, 0.39, 0.42, 0.39, 0.52, 0.48, 0.46, 0.46, 0.48, 0.49,
0.44, 0.54, 0.42, 0.49, 0.42, 0.63, 0.49, 0.44, 0.42, 0.37,
0.37, 0.49, 0.48, 0.37, 0.48, 0.51, 0.44, 0.44), sYear = structure(c(1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1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7L, 7L, 8L, 8L, 8L, 8L, 8L,
8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L,
8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 10L, 10L,
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L,
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L,
10L, 10L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L,
11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L,
11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 11L, 12L, 12L, 12L,
12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L,
12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L,
12L, 12L, 12L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L,
13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L,
13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 13L, 14L, 14L,
14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L,
14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L, 14L,
14L, 14L, 14L, 14L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L,
15L, 15L, 15L, 15L, 15L, 15L, 15L), .Label = c("2018-05",
"2018-06", "2018-07", "2018-08", "2018-09", "2018-10", "2018-11",
"2018-12", "2019-01", "2019-02", "2019-03", "2019-04", "2019-05",
"2019-06", "2019-07"), class = "factor"), Season =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L, 6L, 6L, 6L, 6L, 6L,
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L,
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L,
6L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L,
7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L,
7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L,
7L, 7L, 7L, 7L, 7L), .Label = c("2018-0.Winter 1H", "2018-2.Spring",
"2018-3.Summer", "2018-4.Fall", "2019-1.Winter 2H", "2019-2.Spring",
"2019-3.Summer"), class = "factor")), row.names = c(NA, 418L
), class = "data.frame")
So, the solution for the empirical density is going to slightly easier than do the theoretical distributions. First, let's setup some dummy data, since we don't have any of yours to play around with.
set.seed(123)
# Setup some facets
idx <- expand.grid(c("A", "B"), c("C", "D"))
# For each facet, generate some numbers
df <- apply(idx, 1, function(x){
data.frame(row = x[[1]],
col = x[[2]],
# chose 10 as mean, since Weibull can't be negative
x = rnorm(100, 10))
})
df <- do.call(rbind, df)
Now for the empirical case, we can simply take the density in each facet. We can do this, because ggplot has included kernel density estimates as a stat function.
ggplot(df, aes(x)) +
geom_histogram(binwidth = 0.1) +
# To line up the histogram with KDE, we multiply y-values by binwidth
geom_line(aes(y = ..count..*0.1, colour = "empirical"), stat = "density") +
facet_grid(row ~ col)
Which looks like this:
Because we don't have any ggplot stat functions for the theoretical densities -at least not ones that are panel specific- we would have to pre-compute the xy-coordinates for the theoretical distributions in a separate data.frame:
# Loop over facets
dists <- apply(idx, 1, function(i){
# Grab data belonging to facet
dat <- df$x[df$row == i[[1]] & df$col == i[[2]]]
# Setup x-values
xseq <- seq(min(dat), max(dat), length.out = 100)
# Specify distributions of interest
dists <- c("weibull", "lnorm", "gamma")
# Loop over distributions
fits <- lapply(setNames(dists, dists), function(dist) {
# Estimate parameters
ests <- fitdist(dat, dist)$estimate
# Get y-values
y <- do.call(paste0("d", dist), c(list(x = xseq), as.list(ests)))
# Multiplied by length(dat) to match absolute counts
y * length(dat)
})
# Format everything neatly in a data.frame
out <- lapply(dists, function(j) {
data.frame(row = i[[1]],
col = i[[2]],
x = xseq,
y = fits[[j]],
distr = j)
})
# Combine all distributions
do.call(rbind, out)
})
# Combine all facets
dists <- do.call(rbind, dists)
Now that we've done that tedious work, we can finally plot it:
ggplot(df, aes(x)) +
geom_histogram(binwidth = 0.1) +
geom_line(data = dists, aes(y = y * 0.1, colour = distr)) +
facet_grid(row ~ col)
Adapt as necessary for your own data. Good luck!
EDIT: Now with example data
Assume df is the data.frame from which you've posted the dput() output. I've included a condition that checks if the length of the facet data is longer than 2 and wether the variance is non-zero, so as to skip data from which we wouldn't be able to make any estimates anyway. Furthermore, I've converted variable names to be compatible with how you named them in your data.frame.
idx <- expand.grid(levels(df$Season), levels(df$sYear))
# Loop over facets
dists <- apply(idx, 1, function(i){
dat <- df$Capture_Rate[df$Season == i[[1]] & df$sYear == i[[2]]]
print(length(dat))
if (length(dat) < 2 | var(dat) == 0) {
return(NULL)
}
xseq <- seq(min(dat), max(dat), length.out = 100)
dists <- c("weibull", "lnorm", "gamma")
fits <- lapply(setNames(dists, dists), function(dist) {
ests <- fitdist(dat, dist)$estimate
y <- do.call(paste0("d", dist), c(list(x = xseq), as.list(ests)))
y * length(dat)
})
out <- lapply(dists, function(j) {
data.frame(Season = i[[1]],
sYear = i[[2]],
x = xseq,
y = fits[[j]],
distr = j)
})
do.call(rbind, out)
})
dists <- do.call(rbind, dists)
ggplot(df, aes(x=Capture_Rate, fill=sYear))+
geom_histogram(binwidth = .025,
alpha = .5,
position = "identity") +
geom_line(data = dists, aes(x, y * .025, colour = distr), inherit.aes = FALSE) +
facet_grid(Season ~ sYear)

Add a constant line to all plots in facet_wrap()

I have the following code:
p1 <- ggplot(df_test, aes(x=AA_Number,y=Energy_Profile,col='red')) + geom_line() + facet_wrap(~Model, ncol=3) + geom_hline(yintercept=-0.03, colour='blue') + geom_line(data=df_templates, colour="green")
print(p1)
It produces this output:
I am having trouble merging the data in green into one plot and then plotting it over the other three plots in red.
Essentially the plot in green is my constant and I want to see how my data in red varies from the constant, by overlaying the data in green on top of each of the plots in red.
Anybody have any ideas?
Data:
df_test:
structure(list(Model = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,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 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("102",
"103", "104", "105", "107", "108", "109", "118", "141", "143",
"144", "145", "14x", "161", "162", "163", "164", "165", "167",
"168", "169", "2", "21", "22", "25", "26", "27", "3", "31", "310",
"32", "36", "37", "39", "51", "510", "52", "53", "54", "57",
"61", "62", "64", "65", "66", "67", "68", "81", "84", "88", "910",
"93", "95", "97"), class = "factor"), AA_Number = 1:614, AA = structure(c(1L,
15L, 1L, 10L, 11L, 4L, 18L, 18L, 1L, 9L, 12L, 7L, 19L, 11L, 14L,
16L, 4L, 4L, 10L, 11L, 16L, 9L, 11L, 16L, 1L, 18L, 2L, 2L, 10L,
1L, 2L, 11L, 18L, 8L, 14L, 4L, 19L, 15L, 11L, 6L, 14L, 4L, 1L,
6L, 1L, 2L, 13L, 11L, 6L, 19L, 1L, 6L, 1L, 17L, 6L, 19L, 10L,
15L, 4L, 6L, 5L, 2L, 2L, 1L, 6L, 18L, 4L, 5L, 12L, 17L, 5L, 8L,
2L, 3L, 4L, 14L, 5L, 13L, 3L, 2L, 5L, 13L, 8L, 8L, 7L, 4L, 7L,
5L, 15L, 13L, 3L, 1L, 6L, 4L, 13L, 4L, 4L, 9L, 13L, 15L, 15L,
9L, 13L, 7L, 5L, 8L, 1L, 2L, 5L, 15L, 2L, 5L, 2L, 14L, 1L, 16L,
2L, 7L, 8L, 4L, 9L, 6L, 9L, 6L, 19L, 1L, 19L, 13L, 10L, 6L, 6L,
16L, 10L, 16L, 6L, 8L, 11L, 2L, 16L, 9L, 15L, 18L, 3L, 10L, 14L,
19L, 18L, 3L, 1L, 13L, 7L, 12L, 9L, 6L, 5L, 6L, 9L, 14L, 11L,
16L, 10L, 3L, 19L, 11L, 9L, 14L, 1L, 7L, 19L, 7L, 3L, 7L, 5L,
2L, 9L, 2L, 10L, 11L, 7L, 5L, 7L, 16L, 14L, 7L, 6L, 3L, 7L, 7L,
14L, 3L, 7L, 4L, 10L, 17L, 10L, 19L, 9L, 8L, 9L, 1L, 14L, 8L,
14L, 10L, 13L, 4L, 9L, 19L, 7L, 5L, 4L, 10L, 6L, 9L, 19L, 19L,
14L, 19L, 15L, 14L, 17L, 6L, 1L, 1L, 10L, 7L, 1L, 11L, 19L, 16L,
19L, 14L, 16L, 10L, 11L, 6L, 15L, 9L, 10L, 10L, 16L, 9L, 14L,
14L, 7L, 15L, 5L, 1L, 7L, 5L, 2L, 10L, 2L, 19L, 11L, 7L, 11L,
7L, 10L, 19L, 15L, 11L, 11L, 5L, 16L, 7L, 4L, 10L, 18L, 1L, 19L,
10L, 11L, 9L, 19L, 12L, 14L, 14L, 11L, 14L, 4L, 6L, 3L, 16L,
1L, 1L, 10L, 17L, 5L, 5L, 10L, 1L, 4L, 1L, 5L, 15L, 15L, 13L,
4L, 14L, 2L, 11L, 4L, 17L, 7L, 11L, 1L, 1L, 15L, 1L, 10L, 11L,
4L, 18L, 18L, 1L, 9L, 12L, 7L, 19L, 11L, 14L, 16L, 4L, 4L, 10L,
11L, 16L, 9L, 11L, 16L, 1L, 18L, 2L, 2L, 10L, 1L, 2L, 11L, 18L,
8L, 14L, 4L, 19L, 15L, 11L, 6L, 14L, 4L, 1L, 6L, 1L, 2L, 13L,
11L, 6L, 19L, 1L, 6L, 1L, 17L, 6L, 19L, 10L, 15L, 4L, 6L, 5L,
2L, 2L, 1L, 6L, 18L, 4L, 5L, 12L, 17L, 5L, 8L, 2L, 3L, 4L, 14L,
5L, 13L, 3L, 2L, 5L, 13L, 8L, 8L, 7L, 4L, 7L, 5L, 15L, 13L, 3L,
1L, 6L, 4L, 13L, 4L, 4L, 9L, 13L, 15L, 15L, 9L, 13L, 7L, 5L,
8L, 1L, 2L, 5L, 15L, 2L, 5L, 2L, 14L, 1L, 16L, 2L, 7L, 8L, 4L,
9L, 6L, 9L, 6L, 19L, 1L, 19L, 13L, 10L, 6L, 6L, 16L, 10L, 16L,
6L, 8L, 11L, 2L, 16L, 9L, 15L, 18L, 3L, 10L, 14L, 19L, 18L, 3L,
1L, 13L, 7L, 12L, 9L, 6L, 5L, 6L, 9L, 14L, 11L, 16L, 10L, 3L,
19L, 11L, 9L, 14L, 1L, 7L, 19L, 7L, 3L, 7L, 5L, 2L, 9L, 2L, 10L,
11L, 7L, 5L, 7L, 16L, 14L, 7L, 6L, 3L, 7L, 7L, 14L, 3L, 7L, 4L,
10L, 17L, 10L, 19L, 9L, 8L, 9L, 1L, 14L, 8L, 14L, 10L, 13L, 4L,
9L, 19L, 7L, 5L, 4L, 10L, 6L, 9L, 19L, 19L, 14L, 19L, 15L, 14L,
17L, 6L, 1L, 1L, 10L, 7L, 1L, 11L, 19L, 16L, 19L, 14L, 16L, 10L,
11L, 6L, 15L, 9L, 10L, 10L, 16L, 9L, 14L, 14L, 7L, 15L, 5L, 1L,
7L, 5L, 2L, 10L, 2L, 19L, 11L, 7L, 11L, 7L, 10L, 19L, 15L, 11L,
11L, 5L, 16L, 7L, 4L, 10L, 18L, 1L, 19L, 10L, 11L, 9L, 19L, 12L,
14L, 14L, 11L, 14L, 4L, 6L, 3L, 16L, 1L, 1L, 10L, 17L, 5L, 5L,
10L, 1L, 4L, 1L, 5L, 15L, 15L, 13L, 4L, 14L, 2L, 11L, 4L, 17L,
7L, 11L, 1L), .Label = c("ALA", "ARG", "ASN", "ASP", "GLN", "GLU",
"GLY", "HIS", "ILE", "LEU", "LYS", "MET", "PHE", "PRO", "SER",
"THR", "TRP", "TYR", "VAL"), class = "factor"), Energy_Profile = c(-0.017,
-0.018, -0.02, -0.021, -0.022, -0.024, -0.026, -0.027, -0.028,
-0.028, -0.028, -0.026, -0.025, -0.024, -0.022, -0.021, -0.02,
-0.02, -0.021, -0.022, -0.023, -0.024, -0.024, -0.026, -0.026,
-0.025, -0.024, -0.023, -0.023, -0.022, -0.021, -0.02, -0.02,
-0.02, -0.019, -0.018, -0.019, -0.019, -0.02, -0.02, -0.022,
-0.023, -0.024, -0.025, -0.026, -0.027, -0.027, -0.026, -0.026,
-0.027, -0.027, -0.027, -0.027, -0.026, -0.026, -0.025, -0.024,
-0.022, -0.021, -0.021, -0.02, -0.02, -0.021, -0.023, -0.024,
-0.025, -0.026, -0.027, -0.028, -0.028, -0.028, -0.027, -0.027,
-0.027, -0.027, -0.027, -0.026, -0.026, -0.026, -0.025, -0.025,
-0.024, -0.024, -0.024, -0.024, -0.024, -0.025, -0.026, -0.027,
-0.028, -0.028, -0.028, -0.028, -0.028, -0.027, -0.026, -0.025,
-0.026, -0.026, -0.025, -0.026, -0.027, -0.027, -0.027, -0.025,
-0.024, -0.023, -0.022, -0.02, -0.019, -0.018, -0.019, -0.019,
-0.02, -0.021, -0.022, -0.023, -0.024, -0.025, -0.027, -0.029,
-0.031, -0.034, -0.035, -0.035, -0.035, -0.034, -0.032, -0.03,
-0.026, -0.024, -0.023, -0.022, -0.022, -0.023, -0.024, -0.027,
-0.029, -0.032, -0.035, -0.036, -0.037, -0.037, -0.037, -0.036,
-0.035, -0.033, -0.032, -0.032, -0.031, -0.031, -0.032, -0.033,
-0.034, -0.036, -0.038, -0.04, -0.041, -0.042, -0.044, -0.045,
-0.044, -0.043, -0.041, -0.04, -0.037, -0.035, -0.032, -0.031,
-0.029, -0.029, -0.029, -0.029, -0.03, -0.031, -0.031, -0.031,
-0.031, -0.029, -0.027, -0.025, -0.023, -0.021, -0.019, -0.018,
-0.017, -0.018, -0.019, -0.023, -0.026, -0.031, -0.036, -0.04,
-0.043, -0.045, -0.044, -0.043, -0.039, -0.037, -0.033, -0.03,
-0.028, -0.027, -0.027, -0.026, -0.025, -0.025, -0.025, -0.024,
-0.023, -0.023, -0.024, -0.025, -0.026, -0.028, -0.029, -0.029,
-0.029, -0.029, -0.029, -0.029, -0.028, -0.029, -0.031, -0.033,
-0.034, -0.036, -0.037, -0.039, -0.039, -0.039, -0.038, -0.037,
-0.036, -0.035, -0.033, -0.033, -0.032, -0.031, -0.03, -0.029,
-0.028, -0.027, -0.025, -0.023, -0.022, -0.021, -0.02, -0.019,
-0.019, -0.018, -0.019, -0.018, -0.018, -0.017, -0.017, -0.016,
-0.015, -0.014, -0.013, -0.012, -0.011, -0.011, -0.013, -0.014,
-0.017, -0.02, -0.024, -0.027, -0.03, -0.031, -0.032, -0.03,
-0.029, -0.027, -0.025, -0.023, -0.021, -0.021, -0.022, -0.023,
-0.025, -0.026, -0.028, -0.031, -0.033, -0.035, -0.035, -0.035,
-0.036, -0.036, -0.034, -0.033, -0.031, -0.028, -0.025, -0.023,
-0.021, -0.019, -0.017, -0.015, -0.014, -0.013, -0.012, -0.011,
-0.011, -0.011, -0.012, -0.013, -0.016, -0.018, -0.02, -0.022,
-0.024, -0.026, -0.027, -0.027, -0.026, -0.025, -0.024, -0.023,
-0.022, -0.021, -0.02, -0.021, -0.022, -0.023, -0.024, -0.024,
-0.024, -0.025, -0.025, -0.023, -0.022, -0.021, -0.021, -0.02,
-0.018, -0.018, -0.018, -0.017, -0.016, -0.016, -0.016, -0.016,
-0.016, -0.017, -0.019, -0.02, -0.021, -0.023, -0.024, -0.026,
-0.027, -0.027, -0.027, -0.028, -0.028, -0.028, -0.028, -0.027,
-0.026, -0.025, -0.023, -0.022, -0.02, -0.02, -0.02, -0.02, -0.021,
-0.022, -0.023, -0.025, -0.025, -0.026, -0.026, -0.026, -0.026,
-0.025, -0.025, -0.025, -0.025, -0.025, -0.025, -0.025, -0.025,
-0.025, -0.025, -0.024, -0.024, -0.024, -0.024, -0.025, -0.025,
-0.026, -0.027, -0.028, -0.028, -0.028, -0.028, -0.027, -0.027,
-0.025, -0.025, -0.026, -0.026, -0.025, -0.026, -0.027, -0.027,
-0.027, -0.025, -0.024, -0.023, -0.022, -0.02, -0.019, -0.018,
-0.019, -0.019, -0.02, -0.021, -0.022, -0.023, -0.024, -0.025,
-0.027, -0.029, -0.031, -0.034, -0.035, -0.036, -0.035, -0.034,
-0.032, -0.03, -0.027, -0.025, -0.024, -0.023, -0.023, -0.024,
-0.025, -0.027, -0.03, -0.032, -0.035, -0.036, -0.037, -0.037,
-0.037, -0.036, -0.035, -0.033, -0.032, -0.032, -0.031, -0.031,
-0.032, -0.033, -0.034, -0.036, -0.038, -0.04, -0.041, -0.042,
-0.044, -0.044, -0.044, -0.043, -0.041, -0.039, -0.037, -0.034,
-0.031, -0.03, -0.029, -0.028, -0.029, -0.029, -0.03, -0.031,
-0.031, -0.032, -0.031, -0.029, -0.027, -0.025, -0.023, -0.021,
-0.019, -0.018, -0.017, -0.018, -0.019, -0.023, -0.026, -0.031,
-0.036, -0.04, -0.043, -0.045, -0.044, -0.043, -0.039, -0.037,
-0.033, -0.03, -0.028, -0.027, -0.026, -0.026, -0.025, -0.025,
-0.024, -0.023, -0.023, -0.024, -0.026, -0.027, -0.029, -0.03,
-0.031, -0.031, -0.031, -0.03, -0.03, -0.029, -0.028, -0.029,
-0.029, -0.031, -0.033, -0.035, -0.036, -0.039, -0.039, -0.04,
-0.039, -0.039, -0.038, -0.037, -0.037, -0.036, -0.036, -0.035,
-0.034, -0.032, -0.031, -0.028, -0.026, -0.024, -0.023, -0.022,
-0.022, -0.021, -0.022, -0.022, -0.022, -0.022, -0.022, -0.021,
-0.021, -0.02, -0.019, -0.018, -0.017, -0.015, -0.014, -0.014,
-0.015, -0.017, -0.02, -0.023, -0.026, -0.029, -0.032, -0.033,
-0.033, -0.031, -0.03, -0.029, -0.027, -0.025, -0.023, -0.023,
-0.024, -0.025, -0.027, -0.029, -0.032, -0.034, -0.037, -0.039,
-0.04, -0.041, -0.041, -0.04, -0.039, -0.036, -0.033, -0.03,
-0.026, -0.023, -0.021, -0.019, -0.017, -0.016, -0.015, -0.015,
-0.014, -0.014, -0.013, -0.013)), .Names = c("Model", "AA_Number",
"AA", "Energy_Profile"), row.names = c(NA, 614L), class = "data.frame")
df_templates:
structure(list(Model = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,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 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("2kqx_renumberedA",
"2kqx_renumberedB", "3lz8_renumbered"), class = "factor"), AA_Number = c(3L,
4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L,
18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 27L, 28L, 29L, 30L,
31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 41L, 42L, 43L,
44L, 45L, 46L, 47L, 48L, 49L, 50L, 51L, 52L, 53L, 54L, 55L, 56L,
57L, 58L, 59L, 60L, 61L, 62L, 63L, 64L, 65L, 66L, 67L, 68L, 69L,
70L, 71L, 72L, 73L, 310L, 311L, 312L, 313L, 314L, 315L, 316L,
317L, 318L, 319L, 320L, 321L, 322L, 323L, 324L, 325L, 326L, 327L,
328L, 329L, 330L, 331L, 332L, 333L, 334L, 335L, 336L, 337L, 338L,
339L, 340L, 341L, 342L, 343L, 344L, 345L, 346L, 347L, 348L, 349L,
350L, 351L, 352L, 353L, 354L, 355L, 356L, 357L, 358L, 359L, 360L,
361L, 362L, 363L, 364L, 365L, 366L, 367L, 368L, 369L, 370L, 371L,
372L, 373L, 374L, 375L, 376L, 377L, 378L, 379L, 380L, 115L, 116L,
117L, 118L, 119L, 120L, 121L, 122L, 123L, 124L, 125L, 126L, 127L,
128L, 129L, 130L, 131L, 132L, 133L, 134L, 135L, 136L, 137L, 138L,
139L, 140L, 141L, 142L, 143L, 144L, 145L, 146L, 147L, 148L, 149L,
150L, 148L, 150L, 151L, 153L, 154L, 155L, 156L, 157L, 158L, 159L,
160L, 161L, 162L, 163L, 164L, 165L, 166L, 167L, 168L, 169L, 170L,
171L, 172L, 173L, 174L, 175L, 176L, 177L, 178L, 179L, 178L, 180L,
181L, 182L, 183L, 187L, 188L, 189L, 190L, 191L, 192L, 193L, 194L,
195L, 196L, 197L, 198L, 199L, 200L, 201L, 202L, 203L, 204L, 205L,
206L, 207L, 208L, 209L, 210L, 211L, 212L, 213L, 214L, 215L, 216L,
217L, 218L, 219L, 220L, 221L, 219L, 221L, 222L, 223L, 224L, 225L,
226L, 227L, 228L, 229L, 230L, 231L, 232L, 233L, 234L, 235L, 236L,
237L, 238L, 239L, 240L, 241L, 242L, 243L, 244L, 245L, 246L, 247L,
248L, 249L, 250L, 251L, 252L, 253L, 254L, 255L, 256L, 257L, 258L,
259L, 260L, 261L, 262L, 263L, 264L, 265L, 266L, 267L, 268L, 269L,
270L, 271L, 272L, 273L, 274L, 275L, 276L, 277L, 278L, 279L, 278L,
280L, 281L, 282L, 283L, 284L, 285L, 286L, 287L, 288L, 289L, 290L,
291L, 292L, 293L, 294L, 295L, 296L, 297L, 298L, 299L, 300L, 301L,
302L, 303L, 301L, 303L, 304L, 422L, 423L, 424L, 425L, 426L, 427L,
428L, 429L, 430L, 431L, 432L, 433L, 434L, 435L, 436L, 437L, 438L,
439L, 440L, 441L, 442L, 443L, 444L, 445L, 446L, 447L, 448L, 449L,
450L, 451L, 452L, 453L, 454L, 455L, 456L, 457L, 458L, 459L, 460L,
151L, 461L, 462L, 463L, 464L, 465L, 466L, 467L, 158L, 467L, 468L,
469L, 470L, 471L, 472L, 473L, 474L, 475L, 476L, 477L, 478L, 479L,
480L, 481L, 482L, 483L, 484L, 485L, 176L, 485L, 486L, 487L, 488L,
489L, 490L, 491L, 492L, 493L, 495L, 496L, 497L, 498L, 499L, 500L,
501L, 502L, 503L, 504L, 505L, 506L, 507L, 508L, 509L, 510L, 511L,
512L, 513L, 204L, 513L, 514L, 515L, 516L, 517L, 518L, 519L, 520L,
521L, 522L, 523L, 524L, 525L, 526L, 527L, 528L, 529L, 530L, 531L,
532L, 533L, 534L, 535L, 536L, 537L, 538L, 539L, 230L, 539L, 540L,
541L, 542L, 543L, 544L, 545L, 546L, 547L, 548L, 549L, 550L, 551L,
552L, 553L, 554L, 555L, 556L, 557L, 558L, 559L, 560L, 561L, 562L,
563L, 564L, 565L, 566L, 567L, 568L, 571L, 572L, 573L, 574L, 575L,
576L, 577L, 578L, 579L, 580L, 581L, 582L, 583L, 584L, 585L, 586L,
587L, 588L, 589L, 590L, 591L, 592L, 593L, 594L, 595L, 596L, 597L,
598L, 599L, 600L, 601L, 602L, 603L, 604L, 605L, 606L, 607L, 608L,
609L, 610L, 611L), AA = structure(c(6L, 10L, 11L, 4L, 18L, 18L,
1L, 9L, 12L, 7L, 19L, 11L, 14L, 16L, 4L, 4L, 10L, 11L, 16L, 9L,
11L, 16L, 1L, 18L, 2L, 2L, 10L, 1L, 2L, 11L, 18L, 8L, 14L, 4L,
19L, 15L, 11L, 6L, 14L, 4L, 1L, 6L, 1L, 2L, 13L, 11L, 6L, 19L,
1L, 6L, 1L, 17L, 6L, 19L, 10L, 15L, 4L, 6L, 5L, 2L, 2L, 1L, 6L,
18L, 4L, 5L, 12L, 17L, 5L, 8L, 2L, 6L, 10L, 11L, 4L, 18L, 18L,
1L, 9L, 12L, 7L, 19L, 11L, 14L, 16L, 4L, 4L, 10L, 11L, 16L, 9L,
11L, 16L, 1L, 18L, 2L, 2L, 10L, 1L, 2L, 11L, 18L, 8L, 14L, 4L,
19L, 15L, 11L, 6L, 14L, 4L, 1L, 6L, 1L, 2L, 13L, 11L, 6L, 19L,
1L, 6L, 1L, 17L, 6L, 19L, 10L, 15L, 4L, 6L, 5L, 2L, 2L, 1L, 6L,
18L, 4L, 5L, 12L, 17L, 5L, 8L, 2L, 1L, 1L, 2L, 7L, 8L, 4L, 10L,
6L, 9L, 6L, 19L, 1L, 19L, 13L, 10L, 6L, 6L, 16L, 10L, 1L, 6L,
5L, 16L, 2L, 16L, 9L, 15L, 18L, 3L, 10L, 14L, 19L, 18L, 3L, 19L,
13L, 13L, 13L, 7L, 9L, 6L, 15L, 6L, 16L, 14L, 11L, 16L, 10L,
3L, 19L, 11L, 9L, 14L, 1L, 7L, 19L, 19L, 4L, 7L, 5L, 2L, 9L,
2L, 10L, 11L, 7L, 5L, 5L, 7L, 16L, 14L, 7L, 7L, 14L, 3L, 7L,
4L, 10L, 17L, 10L, 19L, 9L, 8L, 9L, 1L, 14L, 8L, 14L, 10L, 13L,
4L, 9L, 19L, 7L, 8L, 3L, 10L, 6L, 9L, 19L, 10L, 14L, 10L, 1L,
14L, 17L, 17L, 17L, 6L, 1L, 1L, 10L, 7L, 1L, 11L, 19L, 16L, 19L,
14L, 16L, 10L, 11L, 6L, 15L, 9L, 10L, 10L, 16L, 19L, 14L, 14L,
7L, 15L, 5L, 1L, 7L, 5L, 2L, 10L, 2L, 9L, 11L, 7L, 11L, 7L, 10L,
19L, 15L, 11L, 16L, 8L, 16L, 7L, 4L, 10L, 13L, 1L, 19L, 9L, 11L,
9L, 19L, 12L, 14L, 16L, 11L, 14L, 14L, 4L, 6L, 11L, 1L, 2L, 6L,
10L, 17L, 5L, 5L, 10L, 1L, 1L, 1L, 6L, 1L, 15L, 13L, 4L, 14L,
2L, 11L, 16L, 16L, 16L, 17L, 1L, 1L, 2L, 7L, 8L, 4L, 10L, 6L,
9L, 6L, 19L, 1L, 19L, 13L, 10L, 6L, 6L, 16L, 10L, 1L, 6L, 5L,
16L, 2L, 16L, 9L, 15L, 18L, 3L, 10L, 14L, 19L, 18L, 3L, 19L,
13L, 7L, 12L, 9L, 9L, 6L, 15L, 6L, 16L, 14L, 11L, 16L, 16L, 16L,
10L, 3L, 19L, 11L, 9L, 14L, 1L, 7L, 19L, 19L, 4L, 7L, 5L, 2L,
9L, 2L, 10L, 11L, 11L, 11L, 7L, 5L, 7L, 16L, 14L, 7L, 6L, 3L,
7L, 14L, 3L, 7L, 4L, 10L, 17L, 10L, 19L, 9L, 8L, 9L, 1L, 14L,
8L, 14L, 10L, 13L, 4L, 4L, 4L, 9L, 19L, 7L, 8L, 3L, 10L, 6L,
9L, 19L, 10L, 14L, 10L, 1L, 14L, 17L, 6L, 1L, 1L, 10L, 7L, 1L,
11L, 19L, 16L, 19L, 14L, 14L, 14L, 16L, 10L, 11L, 6L, 15L, 9L,
10L, 10L, 16L, 19L, 14L, 14L, 7L, 15L, 5L, 1L, 7L, 5L, 2L, 10L,
2L, 9L, 11L, 7L, 11L, 7L, 10L, 19L, 15L, 8L, 16L, 7L, 4L, 10L,
13L, 1L, 19L, 9L, 11L, 9L, 19L, 12L, 14L, 16L, 11L, 14L, 4L,
6L, 11L, 1L, 2L, 6L, 10L, 17L, 5L, 5L, 10L, 1L, 1L, 1L, 6L, 1L,
15L, 13L, 4L, 14L, 2L, 11L, 16L, 17L), .Label = c("ALA", "ARG",
"ASN", "ASP", "GLN", "GLU", "GLY", "HIS", "ILE", "LEU", "LYS",
"MET", "PHE", "PRO", "SER", "THR", "TRP", "TYR", "VAL"), class = "factor"),
Energy_Profile = c(-0.018, -0.019, -0.019, -0.02, -0.022,
-0.023, -0.024, -0.025, -0.025, -0.025, -0.025, -0.025, -0.025,
-0.026, -0.025, -0.026, -0.028, -0.029, -0.029, -0.027, -0.026,
-0.026, -0.026, -0.025, -0.023, -0.023, -0.024, -0.025, -0.025,
-0.024, -0.025, -0.025, -0.026, -0.025, -0.024, -0.024, -0.024,
-0.023, -0.024, -0.025, -0.025, -0.027, -0.028, -0.029, -0.029,
-0.029, -0.028, -0.027, -0.025, -0.023, -0.022, -0.022, -0.022,
-0.023, -0.024, -0.025, -0.027, -0.028, -0.029, -0.03, -0.03,
-0.032, -0.032, -0.033, -0.033, -0.033, -0.033, -0.033, -0.032,
-0.031, -0.029, -0.018, -0.019, -0.019, -0.02, -0.022, -0.023,
-0.024, -0.025, -0.025, -0.025, -0.025, -0.025, -0.025, -0.026,
-0.025, -0.026, -0.028, -0.029, -0.029, -0.027, -0.026, -0.026,
-0.026, -0.025, -0.023, -0.023, -0.024, -0.025, -0.025, -0.024,
-0.025, -0.025, -0.026, -0.025, -0.024, -0.024, -0.024, -0.023,
-0.024, -0.025, -0.025, -0.027, -0.028, -0.029, -0.029, -0.029,
-0.028, -0.027, -0.025, -0.023, -0.022, -0.022, -0.022, -0.023,
-0.024, -0.025, -0.027, -0.028, -0.029, -0.03, -0.03, -0.032,
-0.032, -0.033, -0.033, -0.033, -0.033, -0.033, -0.032, -0.031,
-0.029, -0.015, -0.019, -0.023, -0.026, -0.029, -0.032, -0.037,
-0.04, -0.044, -0.046, -0.047, -0.046, -0.046, -0.044, -0.042,
-0.039, -0.038, -0.037, -0.037, -0.038, -0.038, -0.039, -0.041,
-0.042, -0.043, -0.044, -0.044, -0.045, -0.045, -0.043, -0.035,
-0.024, -0.01, 0.0021, 0.014, 0.027, 0.037, 0.035, 0.026,
0.015, 0.0039, -0.008, -0.021, -0.032, -0.039, -0.042, -0.045,
-0.048, -0.049, -0.05, -0.049, -0.048, -0.046, -0.043, -0.04,
-0.039, -0.037, -0.036, -0.037, -0.037, -0.037, -0.035, -0.032,
-0.028, -0.024, -0.019, -0.012, -0.0097, -0.011, -0.013,
-0.014, -0.017, -0.023, -0.03, -0.035, -0.04, -0.044, -0.049,
-0.053, -0.055, -0.055, -0.053, -0.05, -0.048, -0.045, -0.043,
-0.041, -0.04, -0.041, -0.041, -0.041, -0.041, -0.042, -0.042,
-0.043, -0.044, -0.046, -0.047, -0.048, -0.049, -0.047, -0.042,
-0.038, -0.032, -0.027, -0.021, -0.015, -0.012, -0.011, -0.012,
-0.013, -0.015, -0.018, -0.024, -0.029, -0.034, -0.037, -0.04,
-0.043, -0.044, -0.045, -0.044, -0.045, -0.045, -0.045, -0.045,
-0.045, -0.043, -0.041, -0.039, -0.036, -0.034, -0.033, -0.033,
-0.034, -0.035, -0.036, -0.038, -0.039, -0.039, -0.04, -0.039,
-0.039, -0.039, -0.039, -0.04, -0.04, -0.039, -0.04, -0.041,
-0.042, -0.043, -0.044, -0.046, -0.048, -0.049, -0.05, -0.05,
-0.049, -0.046, -0.043, -0.037, -0.031, -0.025, -0.021, -0.017,
-0.015, -0.016, -0.021, -0.028, -0.034, -0.039, -0.044, -0.049,
-0.051, -0.049, -0.047, -0.045, -0.043, -0.04, -0.038, -0.036,
-0.035, -0.035, -0.033, -0.03, -0.026, -0.022, -0.017, -0.012,
-0.0058, -0.002, -0.0018, -0.0043, -0.0073, -0.012, -0.017,
-0.023, -0.029, -0.034, -0.038, -0.041, -0.044, -0.046, -0.047,
-0.046, -0.045, -0.043, -0.041, -0.038, -0.036, -0.034, -0.034,
-0.035, -0.035, -0.037, -0.039, -0.041, -0.043, -0.045, -0.046,
-0.047, -0.048, -0.05, -0.052, -0.054, -0.054, -0.051, -0.044,
-0.037, -0.027, -0.017, -0.0058, 0.0041, 0.0065, 0.0052,
0.0053, 0.0048, 0.0059, 0.0058, 0.0057, 0.0074, 0.007, 0.0014,
-0.0049, -0.015, -0.023, -0.031, -0.037, -0.04, -0.039, -0.039,
-0.037, -0.036, -0.034, -0.029, -0.023, -0.017, -0.009, -0.0017,
0.007, 0.011, 0.01, 0.0045, -0.0012, -0.0089, -0.017, -0.025,
-0.031, -0.033, -0.034, -0.035, -0.036, -0.038, -0.04, -0.042,
-0.046, -0.049, -0.052, -0.052, -0.051, -0.049, -0.046, -0.042,
-0.035, -0.027, -0.019, -0.013, -0.0065, -6.1e-05, 0.0045,
0.003, -0.0013, -0.0071, -0.014, -0.021, -0.029, -0.036,
-0.041, -0.044, -0.046, -0.046, -0.045, -0.044, -0.043, -0.041,
-0.039, -0.038, -0.038, -0.038, -0.039, -0.039, -0.038, -0.034,
-0.03, -0.025, -0.02, -0.013, -0.0082, -0.008, -0.011, -0.016,
-0.021, -0.028, -0.034, -0.04, -0.042, -0.043, -0.041, -0.04,
-0.038, -0.035, -0.033, -0.032, -0.032, -0.033, -0.034, -0.035,
-0.037, -0.038, -0.038, -0.039, -0.038, -0.038, -0.037, -0.037,
-0.036, -0.037, -0.036, -0.037, -0.039, -0.041, -0.043, -0.045,
-0.046, -0.048, -0.048, -0.047, -0.045, -0.043, -0.04, -0.038,
-0.037, -0.036, -0.037, -0.039, -0.041, -0.043, -0.046, -0.047,
-0.048, -0.048, -0.048, -0.046, -0.042, -0.04, -0.038, -0.036,
-0.033, -0.032, -0.031, -0.032, -0.032, -0.033, -0.034, -0.035,
-0.036, -0.037, -0.038, -0.039)), .Names = c("Model", "AA_Number",
"AA", "Energy_Profile"), class = "data.frame", row.names = c(NA,
-532L))
In my df_test data I provided here, I could only put one plot as I reach the character limit.
Your data frame df_templates is also faceted because it has the same column Model as given in facet_wrap(). If you rename this column, for example, to Model2
colnames(df_templates)<-c("AA_Number","AA","Energy_Profile","Model2")
Then this data frame is not faceted.
ggplot(df_test, aes(x=AA_Number,y=Energy_Profile,col='red')) + geom_line() +
geom_hline(yintercept=-0.03, colour='blue') +
geom_line(data=df_templates,colour="green")+
facet_wrap(~Model,ncol=3)

Changing the order of plotting levels in Latitice

I am trying to get a boxplot with a specific order of the levels that are being plotted.
Using the following data and code I generate the boxplot, but the order in which I need this is 6,12,15,18.
I have tried a number of thing using the with() function but can't make it work.
library(lattice)
rate<-structure(list(Temp = c(6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L,
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L,
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 12L,
12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L,
12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L,
12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L,
15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L,
15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L,
15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L, 15L,
15L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L,
18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L,
18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L, 18L,
18L, 18L), Rep = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2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1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L,
6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L,
6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L,
6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L,
6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L,
6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L,
6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L,
6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L,
6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L, 1L, 2L, 6L, 8L), Weight = c(1.756,
1.756, 1.756, 1.756, 0.92, 0.92, 0.92, 0.92, 1.201, 1.201, 1.201,
1.201, 2.601, 2.601, 2.601, 2.601, 2.057, 2.057, 2.057, 2.057,
0.784, 0.784, 0.784, 0.784, 0.663, 0.663, 0.663, 0.663, 1.272,
1.272, 1.272, 1.272, 3.389, 3.389, 3.389, 3.389, 1.433, 1.433,
1.433, 1.433, 3.822, 3.822, 3.822, 3.822, 1.55, 1.55, 1.55, 1.55,
1.198, 1.198, 1.198, 1.198, 1.029, 1.029, 1.029, 1.029, 1.113,
1.113, 1.113, 1.113, 0.261, 0.261, 0.261, 0.261, 0.639, 0.639,
0.639, 0.639, 0.749, 0.749, 0.749, 0.749, 1.083, 1.083, 1.083,
1.083, 1.429, 1.429, 1.429, 1.429, 3.083, 3.083, 3.083, 3.083,
1.061, 1.061, 1.061, 1.061, 1.154, 1.154, 1.154, 1.154, 1.691,
1.691, 1.691, 1.691, 1.185, 1.185, 1.185, 1.185, 0.552, 0.552,
0.552, 0.552, 1.507, 1.507, 1.507, 1.507, 1.175, 1.175, 1.175,
1.175, 1.773, 1.773, 1.773, 1.773, 1.712, 1.712, 1.712, 1.712,
3.784, 3.784, 3.784, 3.784, 0.715, 0.715, 0.715, 0.715, 1.271,
1.271, 1.271, 1.271, 0.788, 0.788, 0.788, 0.788, 1.72, 1.72,
1.72, 1.72, 0.571, 0.571, 0.571, 0.571, 1, 1, 1, 1, 1.037, 1.037,
1.037, 1.037, 1.656, 1.656, 1.656, 1.656, 2.083, 2.083, 2.083,
2.083), Rate = c(0.387, 0.116, -0.141, 0.184, 0.785, 0.151, -0.69,
0.16, 0.477, 0.368, -0.544, 0.49, 0.152, 0.183, -0.137, 0.259,
0.239, 0.292, 0.018, 0.411, 0.322, 0.073, -0.148, 0.287, 0.214,
0.21, -0.579, 0.419, 0.23, 0.271, 0.685, 0.426, 0.248, 0.125,
0.053, 0.176, 0.465, 0.107, 0.02, 0.339, 0.261, 0.327, 0.279,
0.424, 0.308, 0.223, 0.287, 0.383, 0.306, 0.24, 0.258, 0.253,
0.437, 0.315, 0.275, 0.481, 0.372, 0.306, 0.267, 0.449, 0.727,
0.441, 0.624, 1.262, 0.334, 0.447, 0.548, 0.654, 0.846, 0.661,
0.66, 0.734, 0.191, 0.316, 0.551, 0.581, 0.332, 0.403, 0.509,
0.603, 0.411, 0.683, 0.427, 0.516, 0.498, 0.674, 0.371, 0.326,
0.288, 0.435, 0.297, 0.435, 0.165, 0.387, 0.212, 0.345, 0.334,
0.664, 0.526, 0.338, 0.094, 0.066, 0.39, 0.525, 0.215, 0.431,
0.151, 0.361, 0.153, 0.297, 0.127, 0.339, 0.292, 0.434, 0.411,
0.442, 0.25, 0.607, 0.369, 0.567, 0.189, 0.39, 0.372, 0.333,
0.339, 0.327, 0.449, 0.224, 0.086, 0.242, 0.465, 0.374, -0.063,
-0.006, 0.364, 0.308, 0.069, 0.223, 0.397, 0.264, 0.478, 0.345,
0.582, 0.36, 0.426, 0.403, 0.583, 0.544, 0.57, 0.567, 0.388,
0.531, 0.111, 0.125, 0.366, 0.266, 0.26, 0.315, 0.387, 0.549)), .Names = c("Temp",
"Rep", "Ind", "Week", "Weight", "Rate"), class = "data.frame", row.names = c(NA,
-160L))
rate$Temp <- as.character(rate$Temp)
rate$Week <- as.character(rate$Week)
rate$Rep <- as.character(rate$Rep)
rate$Weight<- as.character(rate$Weight)
bwplot(Rate~Temp, rate,
main="Boxplot for data over all weeks by temperature"
)
This can be tackled in the same manner as your question from a month ago. You need to set the order of levels of a factor. I would generally advise you work with factors, unless you have a really good reason to use characters.
rate$Temp <- as.factor(rate$Temp)
levels(rate$Temp) <- c("6", "12", "15", "18")

Resources