1、打开RStudio
2、打开R文件(出现中文注释乱码)
3、点击Tools
4、global options进入设置界面
5、选code—saving
6、default text encoding—change
7、UTF-8
8、OK