drunkfish69 发表于 2020-4-12 10:59 
两个字段属性不同,一个是字符,另一个是整数。看看把字符的那个字段转换成整形。
我的代码没有变,换到要正式分析的数据机却出现了一个奇怪的问题,就是在console里看结果是没问题的,但在environment里打开x1看结果却只剩下id 和 n两个变量了,这是什么情况呢
as_tibble(weight.messages)
x1 <- weight.messages %>% count(B.ID)
x1 %>%
left_join(weight.messages, by = c('B.ID'='B.ID', 'n'='times'))
# A tibble: 1,963 x 4
B.ID n date messages
<dbl> <dbl> <chr> <chr>
1 731 19 2017-10-15 2200
2 216 24 2017-10-23 2023
3 276 9 2017-10-10 2020
4 727 10 2017-10-12 2240
5
6
7
8
9
10
# ... with 1,953 more rows