【解決Error in source(file.path) : invalid multibyte character in parser at line *】
【問題描述】:在使用source函式匯入自建函式時報錯:
Error in source(file.path(code_path, "f_recode_bad_1.R")) :
invalid multibyte character in parser at line 10
【解決辦法】:新增引數 【encoding = "utf-8"】
如下:
source(file.path(code_path,"f_recode_bad_1.R"), encoding = "utf-8")