protect(): protection stack overflow

https://www.researchgate.net/post/error_protect_protection_stack_overflow_in_R‘ > dd %>% dim [1] 12 39319 to change the data from data.frame to matrix form. ========================================================== You probably have to set –max-ppsize See http://stat.ethz.ch/R-manual/R-devel/library/base/html/Memory.html You’ll also find some discussions about this on StackOverflow. See http://stackoverflow.com/questions/28728774/how-to-set-max-ppsize-in-r for instance   ================================ ‘memory.limit’ function recommended by Maurizio may work for some users, but it is Read more…

identical vs all.equal

https://stackoverflow.com/questions/9508518/why-are-these-numbers-not-equal 숫자 비교시, 아주아주 정확할 필요가 없다면 identical() 보다는 all.equal()을 사용하는 편이 정신건강에 좋다. > i <- 0.1 > i <- i + 0.05 > identical(i, 0.15) [1] FALSE > identical(round(i,1), 0.15) [1] FALSE > identical(round(i,2), 0.15) [1] TRUE > all.equal(i, 0.15) [1] TRUE > i <- 0.1 > i Read more…

webAPI plumber

http://blog.expresspixel.com/creating-a-web-api-for-r/   https://www.rplumber.io/ https://github.com/trestletech/plumber https://www.rplumber.io/docs There’s 3 options for you to use to build a web based API. 1. Shiny, 2. Deployrand 3. Plumber. prediction.R #* @get /prediction function(){ return(“Hello World”) } main.R #!/usr/bin/env Rscript library(plumber) r <- plumb(“prediction.R”) r$run(host=”0.0.0.0″, port=8000)   ~/sixx/webAPI$ Rscript main.R Starting server to listen on port 8000   Read more…

rspm (rstudio package manager)

https://www.rstudio.com/products/package-manager/ repository management server to organize and centralize R packages across your team Get offline access to CRAN, automate CRAN syncs, share local packages, restrict package access, find packages across repositories http://docs.rstudio.com/rspm/admin/quickstarts.html http://docs.rstudio.com/rspm/admin/ We currently only provide a pre-built binary for the 64-bit architecture. Execute the following commands in a Read more…

Error onLoad failed in loadNamespace() for ‘rJava’

https://stackoverflow.com/questions/28462302/libjvm-so-cannot-open-shared-object-file-no-such-file-or-directory   Error : .onLoad failed in loadNamespace() for ‘rJava’, details: call: dyn.load(file, DLLpath = DLLpath, …) error: unable to load shared object ‘/usr/local/lib/R/site-library/rJava/libs/rJava.so’: libjvm.so: cannot open shared object file: No such file or directory   sudo R CMD javareconf   I was getting the same error when I was Read more…

Firefox can’t establish a connection to the server

https://groups.google.com/forum/#!topic/shiny-discuss/Iz3kzHPLs_k https://github.com/neo4j/neo4j-browser/issues/671 Error Message WebSocket connection failure Firefox can’t establish a connection to the server at ws://localhost:8787/p/6735/websocket/. shiny.min.js:3:23832 firefox about:config 에서 network.websocket.max-connections;200 Brew brew cask uninstall java brew tap caskroom/versions brew cask install java8 또는 brew install caskroom/versions/java8    

Detect the Number of CPU Cores

  library(parallel) round(detectCores()*0.75)   CPU 사양 확인 cat /proc/cpuinfo | more 모델명 확인만 확인  cat /proc/cpuinfo | grep name CPU 코어의 수 출력 nproc RAM 용량 # 메모리 용량 확인 free # 메모리 용량 확인, (메가(M), 기가(G) 단위를 사용) free -h   리눅스에서 CPU/RAM 사양 확인하기  

R :: Error in fBody[[i]]

    Error in fBody[[i]] : no such index at level 6 Error in fBody[[i]] : subscript out of bounds breakpoint를 잘못 걸었을때 나는 에러 메세지. 코드 문제가 아니니 걱정할 필요없다.  가끔 breakpoint를 걸어놓은 상태에서, code를 수정때문에 breakpoint라인이 변경되었을때 나는 경우가 많다.  즉 지금 debugging하는 버전과 editor의 내용이 서로 맞지않아 Read more…

python 2 R

https://stackoverflow.com/questions/9281323/zip-or-enumerate-in-r There have been some discussions around “list comprehension for R”,  e.g. here or  there. The hash package even offers dictionary-like structure. However, as others said, it is difficult to try to map one language facilities onto another (even if this is what Comparison of programming languages actually offers) without a clear understanding of Read more…

Error : pip install: Please check the permissions and owner of that directory

https://stackoverflow.com/questions/27870003/pip-install-please-check-the-permissions-and-owner-of-that-directory ~|⇒ sudo pip install [sudo] password for onesixx: The directory ‘/Users/onesixx/.cache/pip/http’ or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag. The Read more…

install LEMP on Ubuntu

https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04 https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lemp-on-ubuntu-16-04 https://blog.lael.be/post/73 How To Install LEMP stack(Linux, Nginx, MySQL, PHP ()      ubuntu 현재 버전 확인  리눅스 버전 확인  ⇒ uname -a Linux sixxEOS 4.4.0-75-generic #96-Ubuntu SMP Thu Apr 20 09:56:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Ubuntu 버전확인  ⇒ cat /etc/issue elementary OS Loki \n \l ⇒ Read more…

sudo su – -c

http://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/ Note 6.1: Important note re: installing R packages devtools package ‘curl’ successfully unpacked and MD5 sums checked Package libcurl was not found in the pkg-config search path. Perhaps you should add the directory containing `libcurl.pc’ to the PKG_CONFIG_PATH environment variable No package ‘libcurl’ found Package libcurl was not found Read more…

Error :: requires numeric/complex matrix/vector arguments

http://stackoverflow.com/questions/22906804/matrix-expression-causes-error-requires-numeric-complex-matrix-vector-arguments An Introduction to R : about the difference between a matrix and data.frame. matrix 곱을 할때, data.frame이라면 matrix로 변환이 필요하다.  class(A_deviation) A_covariance <- 1/(n-1) * t(A_deviation) %*% A_deviation [1] “data.frame” Error in t(A_deviation) %*% A_deviation : requires numeric/complex matrix/vector arguments   A_covariance <- 1/(n-1) * t(A_deviation) %*% as.matrix(A_deviation)    

[mac] install Shiny Server

https://github.com/talonsensei/codex-python/wiki/Howto-Install-Shiny-Server-on-OSX https://github.com/rstudio/shiny-server/wiki/Building-Shiny-Server-from-Source http://www.ducheneaut.info/installing-shiny-server-on-mac-os-x/   R for Mac OS X Developer’s Page   github.com/nsh87/shiny Shiny,  Shiny Server  Prerequisites 다음 software는 시스템에서 사용가능해야한다. (/usr/local/Cellar 에서 확인) The required software (python, cmake, gcc, g++, git) can all be installed using homebrew  cmake http://brewformulas.org/Cmake |➜ brew install cmake (>= 2.8.10) |➜ cmake –version cmake version Read more…

[Mac] install RStudio-Server :: Homebrew

iangow.wordpress.com/2013/05/01/rstudio-server-on-mac-os-x/ Matt Furia support.rstudio.com/hc/en-us/articles/200552316-Configuring-the-Server www.rstudio.com/products/rstudio/download-server http://deanattali.com/2015/05/09/setup-rstudio-shiny-server-digital-ocean/ https://www.rstudio.com/products/rstudio/ Prerequisites Installing R http://onesixx.com/install-r-mac/ RStudio Server를 설치하기 위해서는 R을 먼저 설치해야한다. 추가 package 설치  C/C++ Compilers and Libraries ~|⇒ brew install gcc ccache cmake pkg-config autoconf automake gcc(GNU compiler collection), ccache(Object-file caching compiler wrapper), cmake(Cross-platform make), pkg-config(Manage compile and link flags for libraries), autoconf(Automatic Read more…

[Mac] install R :: Homebrew

http://luisspuerto.net/2018/01/install-r-100-homebrew-edition-with-openblas-openmp-my-version/ http://iangow.wordpress.com/2013/05/01/rstudio-server-on-mac-os-x/ installing RStudio Server on Mac OS X suggested by Matt Furia https://support.rstudio.com/hc/en-us/articles/200552316-Configuring-the-Server https://www.rstudio.com/products/rstudio/download-server/ http://www.benjack.io/2016/01/02/el-capitan-biocomputing.html Ready Environment setting |➜ vi .zshrc export LANG=en_US.UTF-8 export LC_ALL=$LANG Openblas |➜ blew install openblas gmp, mpfr, libmpc, isl, gcc 먼저 설치 된 후, openblas설치  R 설치 우선 brew update로 최신업데이트 후에,  |➜ brew Read more…