为什么ggtern会扭曲数据

时间:2017-08-24 10:01:40

标签: r ggtern

我无法弄清楚为什么我的三元图中的数据点看起来是扭曲的,特别是在Fe02标度中可见,其中接近50%的值似乎没有正确绘制。 ggtern是否需要进行一些数据转换,或者我错过了什么?

数据集:

KiDaSm<-structure(list(Site = structure(c(3L, 3L, 3L, 3L, 3L, 3L, 3L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Dakawa", "Fukuchani", 
"Kilwa", "Mkokotoni", "Tumbe Chwaka", "Unguja Ukuu"), class = "factor"), 
    Sample = structure(c(7L, 8L, 9L, 10L, 11L, 14L, 15L, 16L, 
    17L, 19L, 20L, 21L, 23L, 24L, 25L, 26L), .Label = c("EB005", 
    "EB008", "EB009", "EB017", "EB018", "EB023", "EB028", "EB030", 
    "EB033", "EB034", "EB035", "EB036", "EB037", "EB038", "EB040", 
    "EBDAK002", "EBDAK006", "EBDAK007", "EBDAK009", "EBDAK012", 
    "EBDAK014", "EBDAK015", "EBDAK017", "EBDAK020", "EBDAK021", 
    "EBDAK022", "FKCH002", "FKCH003", "FKCH005", "FKCH006", "FKCH008", 
    "FKCH009", "FKCH010", "FKCH012", "FKCH014", "FKCH015", "FKCH016", 
    "FKCH017", "FKCH018", "FKCH019", "FKCH023", "MKK002", "MKK003", 
    "MKK007", "MKK009", "MKK011", "MKK013", "MKK014", "MKK017", 
    "MKK018", "MKK020", "MKK06", "TBCH001", "TBCH002", "TBCH003", 
    "TBCH005", "TBCH007", "TBCH008", "TBCH009", "TBCH010", "TBCH011", 
    "TBCH014", "TBCH017", "TBCH018", "TBCH021", "TBCH022", "UU001", 
    "UU003", "UU004", "UU005", "UU007", "UU008", "UU010", "UU011", 
    "UU012", "UU014", "UU018", "UU020", "UU022", "UU023", "UU026", 
    "UU031", "UU033"), class = "factor"), ID = structure(c(2L, 
    2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L
    ), .Label = c("ND", "Smelting", "Smithing"), class = "factor"), 
    Iron = c(52.2866002788889, 57.437955161, 55.880450631, 50.213473286, 
    53.068958017, 55.776340727, 56.764639409, 61.37738424, 75.741474131, 
    75.459980082, 69.785922113, 76.298245515, 75.860464737, 77.221978734, 
    76.602317775, 67.582636787), Aluminium = c(8.07348620588889, 
    6.9369729006, 6.4314347298, 7.7061493869, 7.3254949831, 7.2108549156, 
    7.2113019865, 8.2022565362, 4.570137602, 4.3668232665, 5.8538177888, 
    4.5660791632, 4.2671637947, 4.727287541, 4.7084385736, 6.0287010895
    ), Silicon = c(24.6786504477778, 22.516695383, 24.261662172, 
    26.81463386, 25.558654883, 23.062108874, 23.144722305, 26.480492462, 
    17.138349267, 16.917779397, 19.620246624, 16.265818105, 17.628059944, 
    15.696017597, 15.786928218, 22.04500569)), .Names = c("Site", 
"Sample", "ID", "Iron", "Aluminium", "Silicon"), row.names = c(NA, 
-16L), class = "data.frame")

我的代码:

library(ggtern)

ggtern(KiDaSm, aes(Iron,Silicon, Aluminium, color=Site, shape=Site )) + geom_point() + 
labs(x = expression(FeO[2]), y=expression(SiO[2]), z=expression(Al[2]*O[3])) +
scale_color_manual(values = c("#FFC300", "#FF5733")) + 
theme_bw()

三元图:

Ternary diagram

0 个答案:

没有答案