我正在使用以下内容绘制一些数据,但是在完整的示例中,由于我在同一图表上有太多变量,因此很难看到数据。如何将每个方面分为2个?也就是说,变量的前半部分绘制在一行上,变量的后半部分绘制在第二行上,但保留了当前的四个方面吗?
数据:
structure(list(Status = structure(c(2L, 1L, 1L, 2L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 2L,
2L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L,
1L, 1L, 2L, 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, 2L, 1L, 1L, 1L, 1L, 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, 2L, 1L, 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, 2L, 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, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L,
1L, 1L, 2L, 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, 1L,
1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 2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L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L), .Label = c("0",
"1"), class = "factor"), Model = c("2", "3", "2", "2", "2", "4",
"2", "3", "3", "2", "1", "4", "3", "1", "4", "3", "3", "3", "2",
"1", "2", "1", "2", "3", "3", "3", "3", "4", "3", "2", "1", "3",
"1", "2", "1", "1", "4", "2", "2", "4", "4", "2", "2", "1", "4",
"1", "2", "2", "3", "2", "4", "3", "3", "3", "2", "3", "2", "3",
"4", "1", "2", "3", "2", "2", "3", "4", "2", "3", "1", "1", "3",
"4", "4", "4", "2", "1", "2", "3", "4", "3", "2", "4", "1", "1",
"1", "2", "2", "2", "4", "3", "1", "4", "3", "2", "2", "4", "1",
"4", "1", "1", "3", "4", "2", "3", "3", "3", "4", "3", "3", "3",
"2", "4", "1", "2", "4", "1", "4", "3", "2", "2", "4", "2", "4",
"4", "4", "4", "4", "1", "4", "1", "1", "2", "3", "3", "4", "1",
"4", "3", "3", "1", "3", "1", "1", "3", "1", "4", "3", "1", "4",
"4", "2", "2", "4", "1", "1", "2", "2", "4", "1", "1", "2", "2",
"3", "3", "2", "1", "3", "3", "4", "3", "1", "4", "2", "4", "3",
"4", "4", "3", "2", "2", "3", "1", "1", "1", "4", "3", "4", "3",
"2", "1", "3", "1", "4", "3", "4", "3", "2", "3", "3", "3", "3",
"1", "4", "1", "1", "3", "3", "4", "1", "1", "3", "4", "2", "1",
"4", "4", "1", "4", "4", "2", "1", "3", "2", "1", "3", "2", "2",
"1", "1", "4", "1", "4", "2", "2", "4", "1", "3", "3", "2", "4",
"3", "1", "2", "3", "1", "4", "3", "1", "2", "4", "2", "3", "1",
"4", "1", "3", "1", "4", "1", "4", "1", "3", "4", "1", "2", "3",
"4", "3", "2", "4", "3", "2", "2", "1", "2", "2", "1", "4", "2",
"4", "3", "2", "1", "1", "3", "3", "3", "4", "4", "4", "3", "4",
"4", "2", "1", "4", "1", "3", "1", "2", "1", "4", "3", "1", "3",
"4", "1", "1", "4", "4", "1", "3", "4", "1", "1", "1", "1", "4",
"4", "2", "4", "3", "1", "4", "1", "2", "4", "1", "4", "2", "2",
"3", "4", "2", "4", "4", "4", "3", "4", "4", "1", "3", "3", "2",
"4", "4", "1", "1", "2", "2", "2", "3", "3", "4", "3", "2", "4",
"4", "4", "1", "2", "4", "4", "4", "3", "2", "2", "3", "4", "1",
"3", "1", "4", "1", "3", "2", "3", "3", "3", "4", "3", "1", "4",
"4", "4", "1", "3", "3", "1", "1", "1", "3", "2", "4", "4", "3",
"3", "3", "2", "2", "1", "3", "1", "4", "1", "4", "3", "1", "2",
"3", "3", "1", "2", "4", "4", "2", "2", "4", "3", "1", "1", "4",
"2", "4", "2", "2", "1", "3", "4", "3", "4", "3", "2", "3", "2",
"4", "2", "1", "1", "4", "3", "3", "4", "4", "4", "4", "1", "1",
"2", "4", "4", "2", "3", "3", "2", "2", "3", "4", "4", "1", "2",
"1", "1", "2", "2", "1", "2", "3", "3", "4", "1", "3", "4", "1",
"4", "1", "2", "3", "2", "3", "2", "4", "2", "1", "4", "3", "1",
"2", "3", "3", "2", "2", "4", "4", "1", "4", "4", "3", "1", "3"
), Model_Name = c("2 Year", "3 Year", "2 Year", "2 Year", "2 Year",
"4 Year", "2 Year", "3 Year", "3 Year", "2 Year", "1 Year", "4 Year",
"3 Year", "1 Year", "4 Year", "3 Year", "3 Year", "3 Year", "2 Year",
"1 Year", "2 Year", "1 Year", "2 Year", "3 Year", "3 Year", "3 Year",
"3 Year", "4 Year", "3 Year", "2 Year", "1 Year", "3 Year", "1 Year",
"2 Year", "1 Year", "1 Year", "4 Year", "2 Year", "2 Year", "4 Year",
"4 Year", "2 Year", "2 Year", "1 Year", "4 Year", "1 Year", "2 Year",
"2 Year", "3 Year", "2 Year", "4 Year", "3 Year", "3 Year", "3 Year",
"2 Year", "3 Year", "2 Year", "3 Year", "4 Year", "1 Year", "2 Year",
"3 Year", "2 Year", "2 Year", "3 Year", "4 Year", "2 Year", "3 Year",
"1 Year", "1 Year", "3 Year", "4 Year", "4 Year", "4 Year", "2 Year",
"1 Year", "2 Year", "3 Year", "4 Year", "3 Year", "2 Year", "4 Year",
"1 Year", "1 Year", "1 Year", "2 Year", "2 Year", "2 Year", "4 Year",
"3 Year", "1 Year", "4 Year", "3 Year", "2 Year", "2 Year", "4 Year",
"1 Year", "4 Year", "1 Year", "1 Year", "3 Year", "4 Year", "2 Year",
"3 Year", "3 Year", "3 Year", "4 Year", "3 Year", "3 Year", "3 Year",
"2 Year", "4 Year", "1 Year", "2 Year", "4 Year", "1 Year", "4 Year",
"3 Year", "2 Year", "2 Year", "4 Year", "2 Year", "4 Year", "4 Year",
"4 Year", "4 Year", "4 Year", "1 Year", "4 Year", "1 Year", "1 Year",
"2 Year", "3 Year", "3 Year", "4 Year", "1 Year", "4 Year", "3 Year",
"3 Year", "1 Year", "3 Year", "1 Year", "1 Year", "3 Year", "1 Year",
"4 Year", "3 Year", "1 Year", "4 Year", "4 Year", "2 Year", "2 Year",
"4 Year", "1 Year", "1 Year", "2 Year", "2 Year", "4 Year", "1 Year",
"1 Year", "2 Year", "2 Year", "3 Year", "3 Year", "2 Year", "1 Year",
"3 Year", "3 Year", "4 Year", "3 Year", "1 Year", "4 Year", "2 Year",
"4 Year", "3 Year", "4 Year", "4 Year", "3 Year", "2 Year", "2 Year",
"3 Year", "1 Year", "1 Year", "1 Year", "4 Year", "3 Year", "4 Year",
"3 Year", "2 Year", "1 Year", "3 Year", "1 Year", "4 Year", "3 Year",
"4 Year", "3 Year", "2 Year", "3 Year", "3 Year", "3 Year", "3 Year",
"1 Year", "4 Year", "1 Year", "1 Year", "3 Year", "3 Year", "4 Year",
"1 Year", "1 Year", "3 Year", "4 Year", "2 Year", "1 Year", "4 Year",
"4 Year", "1 Year", "4 Year", "4 Year", "2 Year", "1 Year", "3 Year",
"2 Year", "1 Year", "3 Year", "2 Year", "2 Year", "1 Year", "1 Year",
"4 Year", "1 Year", "4 Year", "2 Year", "2 Year", "4 Year", "1 Year",
"3 Year", "3 Year", "2 Year", "4 Year", "3 Year", "1 Year", "2 Year",
"3 Year", "1 Year", "4 Year", "3 Year", "1 Year", "2 Year", "4 Year",
"2 Year", "3 Year", "1 Year", "4 Year", "1 Year", "3 Year", "1 Year",
"4 Year", "1 Year", "4 Year", "1 Year", "3 Year", "4 Year", "1 Year",
"2 Year", "3 Year", "4 Year", "3 Year", "2 Year", "4 Year", "3 Year",
"2 Year", "2 Year", "1 Year", "2 Year", "2 Year", "1 Year", "4 Year",
"2 Year", "4 Year", "3 Year", "2 Year", "1 Year", "1 Year", "3 Year",
"3 Year", "3 Year", "4 Year", "4 Year", "4 Year", "3 Year", "4 Year",
"4 Year", "2 Year", "1 Year", "4 Year", "1 Year", "3 Year", "1 Year",
"2 Year", "1 Year", "4 Year", "3 Year", "1 Year", "3 Year", "4 Year",
"1 Year", "1 Year", "4 Year", "4 Year", "1 Year", "3 Year", "4 Year",
"1 Year", "1 Year", "1 Year", "1 Year", "4 Year", "4 Year", "2 Year",
"4 Year", "3 Year", "1 Year", "4 Year", "1 Year", "2 Year", "4 Year",
"1 Year", "4 Year", "2 Year", "2 Year", "3 Year", "4 Year", "2 Year",
"4 Year", "4 Year", "4 Year", "3 Year", "4 Year", "4 Year", "1 Year",
"3 Year", "3 Year", "2 Year", "4 Year", "4 Year", "1 Year", "1 Year",
"2 Year", "2 Year", "2 Year", "3 Year", "3 Year", "4 Year", "3 Year",
"2 Year", "4 Year", "4 Year", "4 Year", "1 Year", "2 Year", "4 Year",
"4 Year", "4 Year", "3 Year", "2 Year", "2 Year", "3 Year", "4 Year",
"1 Year", "3 Year", "1 Year", "4 Year", "1 Year", "3 Year", "2 Year",
"3 Year", "3 Year", "3 Year", "4 Year", "3 Year", "1 Year", "4 Year",
"4 Year", "4 Year", "1 Year", "3 Year", "3 Year", "1 Year", "1 Year",
"1 Year", "3 Year", "2 Year", "4 Year", "4 Year", "3 Year", "3 Year",
"3 Year", "2 Year", "2 Year", "1 Year", "3 Year", "1 Year", "4 Year",
"1 Year", "4 Year", "3 Year", "1 Year", "2 Year", "3 Year", "3 Year",
"1 Year", "2 Year", "4 Year", "4 Year", "2 Year", "2 Year", "4 Year",
"3 Year", "1 Year", "1 Year", "4 Year", "2 Year", "4 Year", "2 Year",
"2 Year", "1 Year", "3 Year", "4 Year", "3 Year", "4 Year", "3 Year",
"2 Year", "3 Year", "2 Year", "4 Year", "2 Year", "1 Year", "1 Year",
"4 Year", "3 Year", "3 Year", "4 Year", "4 Year", "4 Year", "4 Year",
"1 Year", "1 Year", "2 Year", "4 Year", "4 Year", "2 Year", "3 Year",
"3 Year", "2 Year", "2 Year", "3 Year", "4 Year", "4 Year", "1 Year",
"2 Year", "1 Year", "1 Year", "2 Year", "2 Year", "1 Year", "2 Year",
"3 Year", "3 Year", "4 Year", "1 Year", "3 Year", "4 Year", "1 Year",
"4 Year", "1 Year", "2 Year", "3 Year", "2 Year", "3 Year", "2 Year",
"4 Year", "2 Year", "1 Year", "4 Year", "3 Year", "1 Year", "2 Year",
"3 Year", "3 Year", "2 Year", "2 Year", "4 Year", "4 Year", "1 Year",
"4 Year", "4 Year", "3 Year", "1 Year", "3 Year"), status = c(1L,
0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 1L, 0L, 1L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L,
0L,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 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 0L,
0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 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, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 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, 1L, 0L), Feature = c("CF.CL", "CF.SALES", "TL.TA", "logSALES",
"TL.EQ", "TL.EQ", "CF.SALES", "CF.SALES", "CL.FinExp", "CF.CL",
"TL.EQ", "EBIT.Capital", "DEBTORS.SALES", "CF.SALES", "EBIT.FinExp",
"EQ.Turnover", "WC.EBIT", "logTA", "CA.CL", "CF.SALES", "CF.NCL",
"EBIT.FinExp", "EQ.Turnover", "SALES.FA", "SALES.FA", "EBITDA.SALES",
"EBITDA.SALES", "CL.FinExp", "logTA", "CF.CL", "SALES.EBIT",
"DEBTORS.SALES", "WC.EBIT", "CF.NCL", "SALES.FA", "CF.NCL", "CA.CL",
"logSALES", "EBITDA.SALES", "TL.TA", "EBIT.FinExp", "EQ.Turnover",
"CF.SALES", "TL.EQ", "EQ.Turnover", "SALES.EBIT", "logTA", "EBIT.FinExp",
"logSALES", "EBIT.Capital", "EBIT.FinExp", "CF.CL", "SALES.EBIT",
"CF.NCL", "EBIT.FinExp", "SALES.FA", "TL.EQ", "EBITDA.SALES",
"logSALES", "WC.EBIT", "TL.TA", "TL.EQ", "EBIT.Capital", "logTA",
"logTA", "EBIT.Capital", "logSALES", "WC.EBIT", "logSALES", "TL.TA",
"EQ.Turnover", "CF.SALES", "logSALES", "EBIT.FinExp", "EBITDA.SALES",
"TL.EQ", "EBIT.Capital", "DEBTORS.SALES", "TL.TA", "EBIT.FinExp",
"SALES.FA", "DEBTORS.SALES", "CL.FinExp", "logTA", "EBIT.Capital",
"CF.NCL", "DEBTORS.SALES", "CF.SALES", "EBIT.Capital", "CA.CL",
"CF.NCL", "CF.SALES", "EBITDA.SALES", "EBIT.FinExp", "EBIT.Capital",
"DEBTORS.SALES", "EQ.Turnover", "TL.EQ", "TL.EQ", "CL.FinExp",
"EQ.Turnover", "logTA", "CF.SALES", "DEBTORS.SALES", "CF.CL",
"TL.TA", "CL.FinExp", "logTA", "CL.FinExp", "SALES.FA", "SALES.EBIT",
"SALES.EBIT", "EBITDA.SALES", "EBITDA.SALES", "WC.EBIT", "DEBTORS.SALES",
"DEBTORS.SALES", "DEBTORS.SALES", "EQ.Turnover", "WC.EBIT", "CL.FinExp",
"EQ.Turnover", "TL.TA", "CA.CL", "logSALES", "SALES.FA", "logTA",
"CL.FinExp", "CF.SALES", "logSALES", "EBITDA.SALES", "TL.TA",
"SALES.EBIT", "EBIT.FinExp", "EBIT.Capital", "CL.FinExp", "EQ.Turnover",
"SALES.FA", "logSALES", "CF.CL", "logTA", "CF.CL", "SALES.FA",
"logTA", "SALES.EBIT", "CL.FinExp", "WC.EBIT", "TL.EQ", "CL.FinExp",
"CL.FinExp", "EBITDA.SALES", "SALES.EBIT", "CF.CL", "DEBTORS.SALES",
"logTA", "logSALES", "TL.TA", "EQ.Turnover", "EQ.Turnover", "CL.FinExp",
"TL.TA", "EBIT.FinExp", "EBIT.Capital", "CF.SALES", "EBIT.FinExp",
"DEBTORS.SALES", "CL.FinExp", "CL.FinExp", "logSALES", "CA.CL",
"CF.CL", "SALES.FA", "DEBTORS.SALES", "CF.SALES", "CA.CL", "CL.FinExp",
"logTA", "SALES.FA", "DEBTORS.SALES", "SALES.FA", "EBITDA.SALES",
"EQ.Turnover", "EQ.Turnover", "logSALES", "EBIT.Capital", "CF.NCL",
"CA.CL", "logTA", "CF.SALES", "CF.CL", "DEBTORS.SALES", "SALES.EBIT",
"SALES.EBIT", "TL.EQ", "TL.EQ", "SALES.EBIT", "EBIT.FinExp",
"CF.SALES", "SALES.FA", "CL.FinExp", "WC.EBIT", "CF.NCL", "CL.FinExp",
"CF.CL", "logTA", "CF.SALES", "CA.CL", "logTA", "CF.CL", "EBIT.FinExp",
"CA.CL", "TL.EQ", "CF.CL", "logSALES", "TL.EQ", "EQ.Turnover",
"CL.FinExp", "SALES.FA", "EBIT.FinExp", "EBIT.Capital", "EQ.Turnover",
"CF.NCL", "CF.CL", "DEBTORS.SALES", "CL.FinExp", "TL.EQ", "CF.SALES",
"DEBTORS.SALES", "CL.FinExp", "CL.FinExp", "WC.EBIT", "EBIT.Capital",
"EBIT.Capital", "CA.CL", "EBITDA.SALES", "WC.EBIT", "EQ.Turnover",
"DEBTORS.SALES", "CL.FinExp", "CA.CL", "CF.NCL", "logSALES",
"DEBTORS.SALES", "WC.EBIT", "logSALES", "DEBTORS.SALES", "EBIT.Capital",
"DEBTORS.SALES", "CL.FinExp", "logSALES", "CA.CL", "WC.EBIT",
"CF.SALES", "TL.TA", "SALES.EBIT", "EBIT.FinExp", "SALES.FA",
"EBIT.FinExp", "WC.EBIT", "logTA", "DEBTORS.SALES", "TL.TA",
"CF.SALES", "EBIT.FinExp", "logSALES", "CF.SALES", "EBITDA.SALES",
"SALES.FA", "logSALES", "logSALES", "CF.CL", "CF.SALES", "CF.SALES",
"EBIT.Capital", "TL.TA", "EBIT.Capital", "CF.SALES", "SALES.FA",
"CF.CL", "TL.TA", "CL.FinExp", "TL.EQ", "CF.SALES", "CL.FinExp",
"logSALES", "DEBTORS.SALES", "CF.CL", "TL.EQ", "CA.CL", "DEBTORS.SALES",
"CA.CL", "SALES.FA", "SALES.EBIT", "SALES.FA", "logSALES", "TL.TA",
"logTA", "CA.CL", "CL.FinExp", "TL.TA", "CF.CL", "TL.EQ", "CF.NCL",
"WC.EBIT", "SALES.FA", "SALES.FA", "DEBTORS.SALES", "EBIT.Capital",
"EBITDA.SALES", "SALES.EBIT", "logSALES", "CF.NCL", "WC.EBIT",
"CL.FinExp", "EBIT.Capital", "CF.CL", "WC.EBIT", "SALES.FA",
"EBIT.FinExp", "CF.NCL", "WC.EBIT", "EBIT.FinExp", "SALES.FA",
"CF.SALES", "CF.NCL", "SALES.FA", "CL.FinExp", "CF.NCL", "TL.EQ",
"CA.CL", "logTA", "CL.FinExp", "DEBTORS.SALES", "CF.SALES", "CF.CL",
"TL.TA", "SALES.EBIT", "EQ.Turnover", "CA.CL", "SALES.FA", "CF.CL",
"EQ.Turnover", "CF.CL", "EBIT.Capital", "CL.FinExp", "CA.CL",
"DEBTORS.SALES", "EQ.Turnover", "CF.SALES", "CF.SALES", "TL.EQ",
"EBIT.Capital", "CF.SALES", "TL.TA", "WC.EBIT", "EQ.Turnover",
"WC.EBIT", "EBIT.Capital", "WC.EBIT", "logTA", "CF.SALES", "logTA",
"WC.EBIT", "CF.NCL", "SALES.FA", "WC.EBIT", "WC.EBIT", "EBIT.Capital",
"EQ.Turnover", "logTA", "SALES.EBIT", "TL.TA", "CF.NCL", "EBITDA.SALES",
"logSALES", "CL.FinExp", "SALES.EBIT", "TL.EQ", "DEBTORS.SALES",
"TL.EQ", "EQ.Turnover", "EBIT.Capital", "TL.EQ", "EBIT.FinExp",
"EBIT.FinExp", "CA.CL", "CL.FinExp", "TL.TA", "EBIT.Capital",
"logTA", "CL.FinExp", "CF.NCL", "CA.CL", "CL.FinExp", "EBITDA.SALES",
"CA.CL", "EQ.Turnover", "CL.FinExp", "SALES.EBIT", "CA.CL", "SALES.FA",
"TL.EQ", "EQ.Turnover", "EQ.Turnover", "EBITDA.SALES", "SALES.FA",
"logSALES", "SALES.EBIT", "EQ.Turnover", "WC.EBIT", "SALES.FA",
"EBIT.FinExp", "TL.TA", "DEBTORS.SALES", "SALES.EBIT", "WC.EBIT",
"logSALES", "EBIT.Capital", "WC.EBIT", "EQ.Turnover", "EBITDA.SALES",
"TL.EQ", "CF.CL", "EBIT.Capital", "CF.CL", "TL.EQ", "CF.NCL",
"WC.EBIT", "WC.EBIT", "EBITDA.SALES", "SALES.EBIT", "CF.NCL",
"CF.NCL", "CA.CL", "logSALES", "EBITDA.SALES", "EBIT.FinExp",
"SALES.EBIT", "TL.EQ", "CF.CL", "EBIT.Capital", "logTA", "EBITDA.SALES",
"EBIT.Capital", "TL.TA", "DEBTORS.SALES", "WC.EBIT", "DEBTORS.SALES",
"CF.SALES", "logTA", "SALES.EBIT", "EQ.Turnover", "CA.CL", "WC.EBIT",
"EBITDA.SALES", "EBITDA.SALES", "DEBTORS.SALES", "CA.CL", "EBIT.FinExp",
"EQ.Turnover", "DEBTORS.SALES", "CA.CL", "CF.NCL", "DEBTORS.SALES",
"logSALES", "CA.CL", "SALES.EBIT", "EBIT.Capital", "CA.CL", "DEBTORS.SALES",
"EBIT.FinExp", "logTA", "EBITDA.SALES", "DEBTORS.SALES", "EBITDA.SALES",
"CF.CL", "CA.CL", "CF.NCL", "CA.CL", "CA.CL", "SALES.EBIT", "CA.CL",
"DEBTORS.SALES", "TL.TA", "CF.SALES", "CA.CL", "SALES.FA", "EBIT.FinExp",
"SALES.EBIT", "CF.SALES", "CA.CL", "CF.NCL", "EBIT.Capital",
"DEBTORS.SALES", "EQ.Turnover", "TL.EQ", "EBITDA.SALES", "WC.EBIT",
"SALES.FA", "DEBTORS.SALES"), Ratio = c(-0.707919201865374, 0.534298237128927,
0.763308535784903, -1.24540281291686, 0.332626927584044, -0.485527331169614,
-0.626125641168283, 1.75345016963661, 4.51002074747425, NA, NA,
NA, NA, NA, 0.812093120581957, 0.261889212102065, 0.330583042088873,
1.86055950229721, -0.559740348093955, -0.751550592131927, -0.583664251852244,
-0.522445867895311, -0.686761191590487, -0.582852934868012, -0.388631437021738,
-0.376042040118803, 1.42792549342901, -0.498990070660728, 0.208683983665681,
2.14576274581865, -0.768210439875085, 0.53597295004055, -0.653782593991037,
-0.401467349422482, 0.955113642471936, 1.53488585290567, -0.3952130632778,
NA, 0.144744549336861, -1.11766418734528, NA, -0.486293007398917,
-0.337866870638434, -0.665794733109122, 0.526585766173069, -0.330968739102218,
-1.71872921769721, NA, -0.603494884009451, -0.669873024581416,
NA, -0.649826514192686, 3.07036655149694, NA, 2.13760005383415,
0.48611918602065, -0.46490903620693, 1.76231954464496, -0.904090534873578,
-0.597689611958551, 0.570443208862788, -0.295696356825069, NA,
NA, -1.12026151337091, 0.353252456885539, -0.410737653008626,
-0.492832999764316, -0.964106737223811, 0.771902521119517, -0.690879784763869,
NA, 0.20812644470003, NA, -0.702318717339072, -0.725246730786497,
-0.611066135478997, -0.752358284437105, NA, -0.336177411573904,
NA, -0.972007939780494, NA, 0.588136079183467, -0.189762086807928,
NA, -0.090507528727365, NA, -0.0414476119071152, -0.591736889328259,
-0.5129649441072, 3.38321349285669, -0.83540453095325, NA, -0.464060181907834,
0.170933923104933, -0.48321974573862, -0.724726093759333, 2.13475323186374,
-0.551720107396813, -0.626677016637103, NA, NA, NA, 0.652318574413187,
-1.02928500954333, -0.554231821404908, NA, 0.367065924508534,
4.01819284884926, 0.845766884268474, -0.70159006627801, -0.280390290506344,
-0.626223193308945, -0.4690747657034, NA, NA, -0.890480886392398,
-0.478386122102566, -0.0161475286907884, 0.253289117743233, -0.547105578584289,
0.380874662395742, -0.818329487977687, NA, NA, 0.955752645159877,
NA, NA, -0.994832250856227, -0.449101510108994, 0.0694474558888659,
-0.598563168472843, -0.486097896726921, NA, -0.371989877402075,
NA, -0.318581703636123, NA, -0.100445919052522, 0.799824845462438,
0.378210972442923, 1.27868945760894, 0.24318089910497, 0.181578779346068,
NA, -0.685683467561987, -0.459631884960373, 1.63095980160168,
NA, 0.0946018130113362, 1.02705324936134, 0.671527084464841,
NA, -0.7233085189248, -0.12675734621849, -1.38656705544647, -0.560915914512089,
-0.651921766209563, -0.27953897460903, 0.291991314562734, -0.528392572004289,
NA, NA, 1.50012078788565, NA, NA, NA, 1.31640767511872, -0.445442274834121,
-0.414856728587356, -0.314051160102572, 0.375744307410188, NA,
1.81781116610221, -0.559946887602694, -0.395457514182639, NA,
-0.00526745113271141, -0.332325214798845, -0.018280127030989,
1.62199240527132, -0.594479361680451, -0.564198930580082, NA,
-0.62167492692037, -0.416303523892455, -0.449607506297853, 0.903845712282351,
0.779684646559823, 0.143738281941008, -0.499873895126271, -0.641177881704429,
NA, NA, -0.273314809518737, -0.529847731746218, NA, -0.173764991270002,
-0.354344496593425, NA, 0.478253576057706, NA, -0.187311787706413,
0.123066579596889, -0.513750460779892, NA, -0.790302221045379,
0.804382183064051, NA, -0.297655481061757, -0.629830122961466,
NA, -0.519316349381646, NA, -0.704915022051129, -0.577424583637617,
NA, -0.482010018569492, 0.238837508589818, -0.532068808898047,
0.297453160922741, -0.755306596376328, 0.578212039243233, -0.450857004957819,
-0.748403848598439, -0.37679058952789, 0.0241775484739816, 0.192730082758945,
-0.515145439910768, -0.2268625780629, 3.01576448103222, -0.583866152304867,
-0.709552047052377, 0.425623875604783, -0.176544051505707, -0.620792120166673,
-0.955353796034912, NA, -0.809318960526967, 0.420023768667055,
-0.10523384165629, 0.406993073561131, -0.651798854673955, 0.716344972440134,
-0.303352449044368, -0.668984877006987, NA, -0.564780013255765,
-1.05118700631593, -0.539116726883504, -0.450800652766572, -0.749871688838548,
-0.0841302606072373, -0.709221367461288, -0.490910197160739,
1.11027172778273, NA, -0.601870914727605, -0.552107614649751,
1.62516615465747, 2.44418728489504, -0.409209593330642, NA, -0.960828529382557,
0.084165536089424, -0.705514388724782, -0.610463822925471, 0.497068681435134,
-0.901651796426343, -0.435677866991515, 0.233314727709829, NA,
0.00852960753143773, NA, -0.115106662664484, -0.770897489615408,
-0.0354281980844262, -0.407056468073408, NA, -0.485108803557962,
1.08794794256967, -0.190125931876589, -0.402265379206689, 1.1424132722547,
0.135126477946112, -0.603939243675491, -0.717615437622428, -1.00910526031101,
2.22705685835911, NA, NA, NA, 2.64407175315141, -0.0446459000716095,
0.415476261684389, 0.796821253852406, 0.201011466923258, -0.544530194375183,
-1.22140141358447, -0.360101158862896, 3.45535955026293, NA,
-0.448286766138525, 0.811084846975265, -0.527021372402286, 1.3424732936182,
3.61314912518142, -0.463269606554065, 0.0405953936802976, -0.146586169376855,
NA, 2.12231677541413, NA, -0.636743440094211, -0.615559966343366,
-0.571577080857255, 2.50953454213711, -0.300544588599613, -0.0362964175170153,
-0.619520327701307, -0.502959017927762, -0.372855255378387, 1.31539147808008,
-0.394080181754502, NA, -0.00352084504014205, -0.55495656291638,
0.480334834629862, 1.63500140088775, -1.15012988133644, -0.569867634951047,
0.360801001739192, -0.679469512958559, NA, 0.580475615397198,
NA, 2.25455662583243, -0.759165766527588, -0.451095627447786,
-0.15783276233868, -0.172816536529721, -0.217054425468797, -0.184291097560009,
NA, 0.546420739451911, NA, -0.490529780725351, -0.333472258672436,
-0.438198173702863, -0.646280348380046, -0.630225889980435, -0.705124582982999,
-1.77969797337541, -0.402601268399203, -0.222140988823231, 0.576239927127392,
NA, -0.321675775893816, -0.251829942792891, 1.02695194871569,
0.61619363855965, -0.423739089065777, 0.764954823524791, -0.576377283963124,
0.0839707252843906, -0.466579922080166, -0.484544994892477, -0.397657628622839,
-1.05472151674597, 3.2212462997121, -0.0231910345270541, -0.167537885665263,
-0.492795538660388, 1.97581659699565, -0.499098597312652, 0.56861641397915,
-0.676879586334823, -0.125334637509097, 1.29393839101515, -0.636084619567668,
0.282217561163258, -0.406032294129199, 1.11832771373931, -0.357200115739465,
3.47191854245104, NA, NA, -0.323001011945709, 0.829062755141093,
NA, -0.471688857638298, -0.944225375006027, -0.341659690874536,
-0.420054310804183, -0.455765315492974, NA, NA, -0.362113287165822,
0.77088554356236, 0.315220067697118, -0.0794308626912546, 1.46915410747046,
-0.522548665811739, 0.230255494859231, -0.560629395458324, 0.470723132557846,
-0.761260095149801, -0.476098269898868, NA, -0.669458501886402,
-0.532247910499081, 1.06219015600794, NA, -0.714135539638932,
-0.658027312807696, -0.433435994975457, -0.511392591593316, -0.230059145876329,
NA, 0.0111443539074219, -0.684454010718469, -0.625946669480515,
NA, -0.46617948856222, -0.744977753108209, -0.445294244818825,
-0.702413841896356, -0.714672830111507, NA, NA, NA, 0.85804073380322,
NA, -1.25848825367149, NA, NA, 0.446328793506625, -0.752068298980925,
0.122145113318285, 0.849904783555482, NA, -0.78129893263372,
-0.537436099444471, 0.198639023895424, -0.990836594347679, -0.654663516018546,
1.08110583478396, 1.0640799538555, 0.537681922023906, -0.309706876113679,
-0.439635273472738, NA, -0.368011612232917, NA, 3.50174925043846,
-0.39927048724593, -0.926281959133432, -0.376881673897987, -0.162880850919552,
-0.142649303086233, 1.09678336275476, NA, -0.879837401893792,
-0.414955051475592, -0.920399731144902, -0.699788115735192, 2.57172151516347,
0.267771491217914, 0.171724262110164, NA, 3.06797562926558, -0.241808057899617,
-0.685811369433853, NA, 1.85597513761496, NA, -0.521621841883141,
-0.305316470900169, NA, -0.539698980199801, -0.0720400072423283,
NA, 0.437389975954819, 4.10831662855063, 4.42138430051713, NA,
-0.494316690230473, -0.792706118884541, 2.73285642246282, -0.192689903505749,
-0.492415961149561, NA, -0.974988170595545, -0.21084424861102,
-0.751334790010609, -0.00141664743077581, -0.674592842718741,
0.138632188019161, NA)), class = c("tbl_df", "tbl", "data.frame"
), row.names = c(NA, -500L))
编辑:ggplot主题:
library(tidyquant) # for theme_tq()
theme(strip.text=element_blank(),
#aspect.ratio = 1,
axis.line.y = element_blank(),
axis.ticks.y = element_blank(),
legend.position = "bottom",
legend.title = element_text(size = 20),
legend.text = element_text(size = 10),
axis.title = element_text(size = 20),
axis.text = element_text(size = "15"),
strip.text.x = element_text(size = 15),
plot.title = element_text(size = 30),
strip.background = element_rect(fill = 'darkred'),
panel.background = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
axis.text.x = element_text(angle = 90),
axis.title.x=element_blank()) +
labs(title=.x[["Model_Name"]][1]) +
theme_tq(base_family = "serif")
最佳答案
我们可以创建一个新的分组变量,将Feature
值放入两个组之一,然后使用该分组变量进行构面。
然后,我们将Model_Name
的数据划分为包含四个元素的列表,每个Model_Name
级别一个数据帧。
使用map
,我们将这四个数据帧列表馈送到ggplot
中,以为Model_Name
的每个级别创建一个单独的图。该代码使用新element_textbox_simple
包中的ggtext
在每个图的标题上添加了彩色背景带,以模拟构面标签(我们删除了“真实的”构面标签,因为它们是非信息性的,也因为我们希望标签能够每对地块仅出现一次)。
然后,我们使用patchwork
包对这四个图进行布局。
library(tidyverse)
library(patchwork)
# remotes::install_github("wilkelab/ggtext")
library(ggtext)
# Set general plot theme
theme_set(theme_classic() +
theme(panel.background=element_rect(colour="grey40", fill=NA)))
pd = position_dodge(width=0.9)
# Create a list of four ggplots, one for each level of Model_Name
pl = d %>%
# Create grouping variable to split Feature into two groups
mutate(group = ifelse(as.numeric(factor(Feature)) <= 0.5*length(unique(Feature)),
"g1","g2")) %>%
# Split data into a list of four data frames, one for each level of Model_Name
group_split(Model_Name) %>%
# Create a list of four plots
map(
~ ggplot(.x, aes(x = Feature, y = Ratio, fill = Status)) +
geom_violin(alpha = 0.5, scale = "width", position = pd) +
geom_boxplot(alpha = 1, width = 0.2, position = pd) +
scale_y_continuous(limits = c(-3, 4)) +
facet_wrap(~ group, ncol=1, scales="free_x") +
theme(strip.background=element_blank(),
strip.text=element_blank(),
axis.title.x=element_blank(),
plot.title=element_textbox_simple(fill="grey80",
halign=0.5, size=11,
padding=margin(t=4, b=2))) +
labs(title=.x[["Model_Name"]][1])
)
# Add single x-axis title to bottom plot
pl[[4]] = pl[[4]] +
theme(axis.title.x=element_text(margin=margin(t=5))) +
labs(x="Feature")
wrap_plots(pl, ncol=1) + plot_layout(guides="collect")
关于r - 将构面包装分成两个附加构面,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/60104140/