year month area employment 2020 09 000001 105 2020 10 000001 105 2020 09 123444 108 2020 09 123444 109
year month area employment 2020 09 000003 105 2020 10 000003 105 2020 09 123400 108 2020 09 123400 109
原因是每个区域有两行数据,但有些区域有两个名称。000001和000003相同。在SQL中,您会使用update,然后设置area='000003',其中。。。。。
以下代码应该有效:
df$area[df$area==000001]<-000003 df$area[df$area== 123444]<-123400
其中df是您的数据帧。