我在dplyr中收到错误消息“错误:期望单个值”。为什么?

时间:2016-09-30 21:00:32

标签: r dplyr

我想给出一些计算条件,这是我的代码。 在我看来,我的代码没有问题。
为什么这给我的错误是“错误:期待单个值”?

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"])))

0 个答案:

没有答案