我仍然是 R 的新手,所以这是我的问题。
我有一个名为 dataset3 的数据框。
structure(list(Varietes = c("Georgia", "Georgia", "Georgia", "Georgia", "Georgia", "Georgia", "Georgia", "Ruby", "Ruby", "Ruby", "Ruby", "Ruby", "Ruby", "Ruby", "Abelastone", "Abelastone", "Abelastone", "Abelastone", "Abelastone"), ligne.rep = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), Pied = c(1, 2, 3, 4, 5, 7, 8, 1, 3, 4, 5, 6, 7, 8, 1, 2, 3, 6, 7), Date.floraison.mâle = structure(c(1627689600, 1627430400, 1627689600, 1627344000,1627516800,1627603200, 1627689600, 1627516800, 1627776000, 1627603200, 1627344000,1627516800, 1627689600, 1627776000, 1627516800, 1627862400, 1627776000, 1627948800, 1628035200), tzone = "UTC", class = c("POSIXct", "POSIXt")), Date.floraison.femelle = structure(c(1627776000, 1627948800, 1627862400, 1627948800, 1628121600, 1628035200, 1627862400, 1627862400, 1628035200,1628121600, 1627862400, 1627948800, 1628380800, 1628121600, 1628553600, 1629158400, 1628640000, 1629849600, 1629158400), tzone = "UTC", class = c("POSIXct", "POSIXt")), ASIi = c(1, 6, 2, 7, 7, 5, 2, 4, 3, 6, 6, 5, 8, 4, 12, 15, 10, 22, 13), Hauteur.des.pieds = c(200, 210, 205, 215, 217, 207, 205, 208, 206, 215, 216, 212, 220, 215, 230, 228, 226, 240, 233), Hauteur.des.soies = c(100, 104, 102, 110, 108, 103, 102, 105, 105, 110, 112, 108, 113, 110, 123, 118, 116, 124, 122)), row.names = c(NA, -19L), class = c("tbl_df", "tbl", "data.frame"), na.action = structure(c(`6` = 6L, `10` = 10L, `20` = 20L, `21` = 21L, `24` = 24L), class = "omit"))
这是虚假数据。我现在正在尝试编写一个对未来非常有用的脚本。
我想以最简单的方式询问我的数据以获得相关性,例如“ASIi”和“Hauteur des pieds”,但对于我的专栏“Varietes”的每个品种。在我的数据集 3 中,我得到了 3 个品种:Georgia、Abelastone、Ruby。
因为在我的真实数据集中,我将有 50 个品种,如果我必须隔离每个品种,这并不容易。
有没有更简单的方法来做到这一点?非常感谢