我學習R和我只是想一個Stata數據文件中讀取,但我得到下面的錯誤中的R在Stata文件中讀取時:錯誤的nchar()在Mac
X < - Stata.file (Stata_File)
錯誤的nchar(varlabs):無效的多字節字符串這裏253
多個Mac用戶遇到此錯誤與程序,但它工作正常的PC上。谷歌搜索這個錯誤似乎說它與R包有關,但我找不到解決方案。有任何想法嗎?謝謝你的幫助!!
將R代碼到錯誤點低於:
Root <- "/Users/Desktop/R_Training"
PathIn <- paste(Root,"Data/Example_0",sep="/")
# The 2007 Dominican Republic household member file (96 MB)
Stata_File <- "drpr51fl.dta"
# Load the memisc package:
library(memisc)
# Set the working directory:
setwd(PathIn)
# (1) Determine which variables we want:
# The Stata.file function (from memisc) reads the "header"
# of our Stata file so you can see what it contains
# and choose the variables you want.
X <- Stata.file(Stata_File)
**Error in nchar(varlabs) : invalid multibyte string 253**
下面是我的會話信息:
[R版本2.13.1(2011-07-08) 平臺:x86_64的 - 蘋果darwin9 .8.0/x86_64的(64位)
區域設置: [1]的en_US.UTF-8 /的en_US.UTF-8/C/C /的en_US.UTF-8 /的en_US.UTF-8
附加的基本包: [1]網格統計圖形小號grDevices utils的數據集 [7]的方法基礎
其他附軟件包: [1] memisc_0.95-33 MASS_7.3-13 lattice_0.19-30
你有沒有試過聯繫'memisc'軟件包的維護者? – hadley
您是否嘗試過'foreign'包中的'read.dta'? – hadley
對你的評論哈德利是肯定的。外國軟件包的工作原理和我通過電子郵件發送memisc作者,看他是否有任何建議或修復BC我們真的想要使用他的包。 – Michelle