我想给出一些计算条件,这是我的代码。
在我看来,我的代码没有问题。
为什么这给我的错误是“错误:期待单个值”?
cust_online_trip = data %>% group_by(CUST_NO_ID) %>%
summarise(t_trip_before = ifelse(exp_mob ==1,length(S_TRHEAD_SK[before_1st_mob_shop ==1]),length(S_TRHEAD_SK[before_app_launch ==1])),
online_trip_before = ifelse(exp_mob ==1,length(S_TRHEAD_SK[before_1st_mob_shop ==1 & channel == "online"]),
length(S_TRHEAD_SK[before_app_launch ==1 & channel == "online"])))