私はRを学んでおり、単にstataデータファイルを読み込もうとしていますが、以下のエラーが発生しています:
X <- Stata.file(Stata_File)
nchar(varlabs) のエラー: 無効なマルチバイト文字列 253
複数の Mac ユーザーがこのプログラムでこのエラーに遭遇していますが、PC では問題なく動作します。このエラーの Google 検索では、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-apple-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] grid stats graphics grDevices utils datasets [7] methods base
その他の付属パッケージ: [1] memisc_0.95-33 MASS_7.3-13lattice_0.19-30