当我尝试安装 Mysql 包(MAC OS)时出现以下错误
install.packages('RMySQL')
package ‘RMySQL’ is available as a source package but not as a binary
Warning in install.packages :
package ‘RMySQL’ is not available (for R version 3.1.0)
我不确定我需要设置什么才能使其正常工作。
The author of RMySQL no longer provide binary packages, so you will have to build from source.
I have posted the complete solution in another thread: Installing RMySQL in mavericks.
Basically, in order for install.packages('RMySQL', type='source')
to work correctly, what you are lacking are:
Configure and build RMySQL from source in RStudio or in Terminal:
Set the 2 environment variables PKG_CPPFLAGS and PKG_LIBS to indicate where the include and lib are.
Run install.packages('RMySQL', type='source')
in RStudio or R CMD INSTALL RMySQL_x.x-x.tar.gz
in Terminal
从源代码安装对我来说效果很好。对于那些不熟悉 R 的人来说,从源代码安装的方法是:
install.packages('RMySQL', type='source')