我正在尝试根据多个日期组合观察(行)。在我的研究中,我在特定日期对每个模块方面的新兵进行了抽样调查。但是,在少数情况下,我不得不回到特定的模块方面来在其他日期完成我的普查。对于这些实例,我想做的是将新兵人数加在一起,并将日期作为最后一次观察的日期。
我尝试使用传播(n2,键=日期,值=新兵),但这无助于将数据从2行转换为1。
数据库:
n3 <- structure(list(`Module #` = c(114L, 114L, 114L, 114L, 114L, 114L,
114L, 114L, 114L, 114L, 114L, 114L, 114L, 114L, 114L, 114L, 114L,
114L), Side = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L,
2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("N", "S", "T"
), class = "factor"), TimeStep = c(1L, 4L, 4L, 5L, 6L, 7L, 1L,
4L, 4L, 5L, 6L, 7L, 1L, 4L, 4L, 5L, 6L, 7L), Date = structure(c(NA,
17389, 17398, 17482, 17601, NA, 17299, 17389, 17404, NA, 17601,
17682, 17299, 17389, 17404, NA, 17601, NA), class = "Date"),
Site = structure(c(NA, 2L, 2L, 2L, 2L, NA, 2L, 2L, 2L, NA,
2L, 2L, 2L, 2L, 2L, NA, 2L, NA), .Label = c("HAN", "WAI"), class = "factor"),
Treatment = c(NA, "CLO", "CLO", "CLO", "CLO", NA, "CLO",
"CLO", "CLO", NA, "CLO", "CLO", "CLO", "CLO", "CLO", NA,
"CLO", NA), recruits = c(0, 5, 1, 2, 1, 0, 1, 4, 1, 0, 2,
4, 2, 1, 1, 0, 1, 0), Site_long = structure(c(2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L
), .Label = c("Hanauma Bay", "Waikiki"), class = "factor"),
Shelter = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("High", "Low"
), class = "factor")), row.names = c(NA, -18L), class = c("tbl_df",
"tbl", "data.frame"))
print(n3)
如上所述,我想通过对两个观察点的征兵人数求和并将合并数据行的日期设为后一个观察点的日期,来对发生在两个不同日期的观察点进行模块侧观察。感谢您的输入!
答案 0 :(得分:0)
像这样吗?
$data = openssl_x509_parse ( $_SERVER["SSL_CLIENT_CERT"]);