我想分组以下内容:
示例数据:
ProductId Category Price
-------------------------------------
628D5D44D6C7B525 accessories 0
6B079EE7E6794C05 accessories 0
2D5F744CBC63BF37 accessories 0
1A410674D1FD44D5 accessories 0
25807921234D4A73 jewellery 18923
27458D0C361B0B7 jewellery 18995
7F1152404511B7F5 jewellery 19021
acse<-
select(prcbrkt, ProductId:Price) %>%
group_by(Category) %>%
mutate(price_Level <-
cut(Price, breaks = quantile(Price, c(0, .25, .50, .75)),
labels = c('Low', 'Medium', 'High'),
include.lowest = TRUE))
这会导致以下错误消息:
mutate_impl(.data,dots)出错:评估错误:&#39; probs&#39; 在外面[0,1]。
我正在尝试写一个算法,它必须显示该productID属于哪个价格范围(高,中或低)
例如: 当我输入productID时,它应显示如下:
78BF0560126D416F jewellery 18472 HIGH