2017-02-28 88 views
2

安裝「以舊換新」包當調用install.packages("tm")我得到以下錯誤:不能R中的MacOS塞拉利昂

> install.packages("tm") 
Installing package into ‘/usr/local/lib/R/3.3/site-library’ 
(as ‘lib’ is unspecified) 
trying URL 'https://ftp.cixug.es/CRAN/src/contrib/tm_0.7.tar.gz' 
Content type 'application/x-gzip' length 526498 bytes (514 KB) 
================================================== 
downloaded 514 KB 

* installing *source* package ‘tm’ ... 
** package ‘tm’ successfully unpacked and MD5 sums checked 
** libs 
clang++ -I/usr/local/Cellar/r/3.3.2/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/usr/local/include -I"/usr/local/lib/R/3.3/site-library/BH/include" -I"/usr/local/lib/R/3.3/site-library/Rcpp/include" -fPIC -g -O2 -c RcppExports.cpp -o RcppExports.o 
clang -I/usr/local/Cellar/r/3.3.2/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/usr/local/include -I"/usr/local/lib/R/3.3/site-library/BH/include" -I"/usr/local/lib/R/3.3/site-library/Rcpp/include" -fPIC -g -O2 -c copy.c -o copy.o 
clang -I/usr/local/Cellar/r/3.3.2/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/usr/local/include -I"/usr/local/lib/R/3.3/site-library/BH/include" -I"/usr/local/lib/R/3.3/site-library/Rcpp/include" -fPIC -g -O2 -c init.c -o init.o 
clang++ -I/usr/local/Cellar/r/3.3.2/R.framework/Resources/include -DNDEBUG -I/usr/local/opt/gettext/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl/include -I/usr/local/include -I"/usr/local/lib/R/3.3/site-library/BH/include" -I"/usr/local/lib/R/3.3/site-library/Rcpp/include" -fPIC -g -O2 -c tdm.cpp -o tdm.o 
In file included from tdm.cpp:4: 
/usr/local/lib/R/3.3/site-library/BH/include/boost/tokenizer.hpp:59:9: error: field of type 'std::__1::__wrap_iter<const char *>' has private constructor 
     : first_(c.begin()), last_(c.end()), f_() { } 
     ^
tdm.cpp:25:28: note: in instantiation of function template specialization 'boost::tokenizer<boost::char_delimiters_separator<char, std::__1::char_traits<char> >, std::__1::__wrap_iter<const char *>, std::__1::basic_string<char> >::tokenizer<Rcpp::internal::const_string_proxy<16> >' requested here 
     boost::tokenizer<> tok(strings(index)); 
         ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:1239:31: note: declared private here 
    _LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {} 
          ^
In file included from tdm.cpp:4: 
/usr/local/lib/R/3.3/site-library/BH/include/boost/tokenizer.hpp:59:28: error: field of type 'std::__1::__wrap_iter<const char *>' has private constructor 
     : first_(c.begin()), last_(c.end()), f_() { } 
         ^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:1239:31: note: declared private here 
    _LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {} 
          ^
2 errors generated. 
make: *** [tdm.o] Error 1 
ERROR: compilation failed for package ‘tm’ 
* removing ‘/usr/local/lib/R/3.3/site-library/tm’ 
Warning in install.packages : 
    installation of package ‘tm’ had non-zero exit status 

The downloaded source packages are in 
    ‘/private/var/folders/02/6mkk426d3jd46mg35j577bwc0000gn/T/RtmpHPgAoU/downloaded_packages’ 

我的電腦運行MacOS的塞拉利昂。的sessionInfo()輸出是:

R version 3.3.2 (2016-10-31) 
Platform: x86_64-apple-darwin16.3.0 (64-bit) 
Running under: macOS Sierra 10.12.3 

locale: 
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 

attached base packages: 
[1] stats  graphics grDevices utils  datasets methods base  

loaded via a namespace (and not attached): 
[1] tools_3.3.2 

我沒有安裝「SLAM」的其他職位提到的問題。我也嘗試安裝「tm」,將依賴關係標誌設置爲TRUE,但產生相同的輸出。我通過自制軟件安裝了R。我想知道是否還有其他步驟可以嘗試。

+0

嘗試install.packages(「以舊換新」,依賴= TRUE) – ZeroStack

+0

我想,太,得到了相同的錯誤。 – Pedro

+0

我有同樣的問題。這是編譯器/庫的東西,但不知道是什麼。 – alistaire

回答

0

我一直有同樣的問題。目前,我已經從cran.r-project網站安裝了tm 0.6。這爲我消除了編譯錯誤。

相關問題