尝试实现从其他程序包中调用Java类以提高测试脚本的效率。 现在我在每个类上重写login.java之前,都尝试调用它来提高效率,现在发生的是,它可以正确登录但没有跟进。
尝试分离login.java
library(lubridate)
df %>%
mutate(START = dmy(START),
START = if_else(month(START) >= 10, START + years(1), START),
year = year(START)) %>%
dplyr::count(Customer, year) %>%
group_by(Customer) %>%
mutate(ret = n()/n_distinct(.$year)) %>%
tidyr::spread(year, n, fill = 0)
Test2.java
df <- structure(list(ID = 1:5, Customer = structure(c(3L, 1L, 2L, 3L,
1L), .Label = c("Apple", "H&M", "Tesco"), class = "factor"),
START = structure(c(1L, 5L, 4L, 2L, 3L), .Label = c("01-01-2000",
"01-01-2001", "01-01-2003", "01-02-2002", "05-11-2001"), class = "factor"),
END = structure(c(3L, 1L, 2L, 4L, 5L), .Label = c("06-02-2002",
"08-05-2002", "31-12-2000", "31-12-2001", "31-12-2004"), class = "factor")),
class = "data.frame", row.names = c(NA, -5L))
应该正常工作,没有错误