有人可以帮我解决这个问题吗?
文件链接:
orders <- fread("https://s3.amazonaws.com/hackerday.datascience/87/orders.csv")
orders <- orders %>% mutate(order_hour_of_day=as.numeric(order_hour_of_day),
eval_set=as.factor(eval_set))
订单$ day_week_name&lt; - ifelse(订单$ order_dow == 0, &#39;周日&#39 ;, ifelse(订单$ order_dow == 1, &#39;星期一&#39 ;, ifelse(订单$ order_dow == 2, &#39;星期二&#39 ;, ifelse(订单$ order_dow == 3, &#39;星期三&#39 ;, ifelse(订单$ order_dow == 4, &#39;周四&#39 ;, ifelse(订单$ order_dow == 5, &#39;周五&#39 ;, ifelse(订单$ order_dow == 6, &#39;星期六&#39;&#34;&#34;))))))) 订单$ day_ordered&lt; - factor(订单$ day_week_name,levels = c(&#34; Sunday&#34;, &#34;星期一&#34 ;, &#34;星期二&#34 ;, &#34;星期三&#34 ;, &#34;周四&#34 ;, &#34;周五&#34 ;, &#34;星期六&#34))
问题是,当我运行此代码时,我收到以下错误消息,没有情节:
orders %>% filter(eval_set=='prior') %>% count_(orders,'order_number') %>%
ggplot(aes(order_number,n)) + geom_line(color='red',size=1)
Error Message:
mutate_impl(.data,dots)中的错误:未找到绑定:先前。 mutate_impl(.data,dots)出错:未找到绑定:星期二。