{"id":414,"date":"2014-01-02T15:51:46","date_gmt":"2014-01-02T20:51:46","guid":{"rendered":"http:\/\/homepages.uc.edu\/~yaozo\/wordpress\/?p=414"},"modified":"2014-01-02T15:51:46","modified_gmt":"2014-01-02T20:51:46","slug":"installing-deducer-in-win7","status":"publish","type":"post","link":"https:\/\/zhuoyao.net\/index.php\/2014\/01\/02\/installing-deducer-in-win7\/","title":{"rendered":"Installing Deducer in Win7"},"content":{"rendered":"<p>1. make sure you have java installed.<br \/>\n2. open R in c:\\Program Files\\R\\R-3.0.1\\bin\\i386\\Rgui.<wbr><\/wbr>exe and run:<br \/>\ninstall.packages(c(&#8220;rJava&#8221;,&#8221;<wbr><\/wbr>iplots&#8221;,&#8221;JGR&#8221;,&#8221;Deducer&#8221;,&#8221;<wbr><\/wbr>JavaGD&#8221;))<br \/>\n.libPaths()<br \/>\nlibrary(JGR)<br \/>\nlaunchJGR &lt;- function(){<br \/>\nwindows &lt;- .Platform$OS.type == &#8220;windows&#8221;<br \/>\nws &lt;- function(s){<br \/>\nif(windows) gsub(&#8220;\/&#8221;,&#8221;\\\\\\\\&#8221;,s) else s<br \/>\n}<br \/>\nps &lt;- if(windows) &#8220;;&#8221; else &#8220;:&#8221;<br \/>\nqs &lt;- function(s){<br \/>\npaste0(&#8220;\\&#8221;&#8221; , s , &#8220;\\&#8221;&#8221;)<br \/>\n}<br \/>\nrhome &lt;- ws(R.home())<br \/>\nlibs &lt;- ws(paste(.libPaths(),collapse=<wbr><\/wbr>ps))<br \/>\nlibUser &lt;- ws(Sys.getenv(&#8220;R_LIBS_USER&#8221;))<br \/>\narch &lt;- sessionInfo()$R.version$arch<br \/>\nrJavaPath &lt;- ws(path.package(&#8220;rJava&#8221;))<br \/>\njriJarPath &lt;- ws(paste0(path.package(&#8220;rJava&#8221;<wbr><\/wbr>) , &#8220;\/jri\/JRI.jar&#8221;))<br \/>\njgrJarPath &lt;- ws(paste0(path.package(&#8220;JGR&#8221;) , &#8220;\/java\/JGR.jar&#8221;))<br \/>\niplotsJarPath &lt;- ws(paste0(path.package(&#8220;<wbr><\/wbr>iplots&#8221;) , &#8220;\/java\/iplots.jar&#8221;))<br \/>\nboot &lt;- ws(paste0(rJavaPath,&#8221;\/java\/<wbr><\/wbr>boot&#8221;))<br \/>\njavaHome &lt;- J(&#8220;java.lang.System&#8221;)$<wbr><\/wbr>getProperty(&#8220;java.home&#8221;)<br \/>\njava &lt;- ws(paste0(javaHome,&#8221;\/bin\/java.<wbr><\/wbr>exe&#8221;))<br \/>\npath &lt;- J(&#8220;java.lang.System&#8221;)$<wbr><\/wbr>getProperty(&#8220;java.library.<wbr><\/wbr>path&#8221;)<\/p>\n<p>cp &lt;- paste(qs(jriJarPath), qs(iplotsJarPath), qs(jgrJarPath),<br \/>\nqs(paste0(<wbr><\/wbr>rhome , ws(&#8220;\/etc\/classes&#8221;))),<br \/>\nqs(paste0(<wbr><\/wbr>rhome , ws(&#8220;\/etc\/classes\/classes.jar&#8221;)<wbr><\/wbr>)),sep=ps)<\/p>\n<p>Sys.setenv(PATH=path)<br \/>\nSys.setenv(R_HOME=<wbr><\/wbr>rhome)<br \/>\nSys.setenv(R_ARCH=<wbr><\/wbr>arch)<br \/>\nSys.setenv(R_LIBS=<wbr><\/wbr>libs)<br \/>\nSys.setenv(R_LIBS_<wbr><\/wbr>USER=libUser)<br \/>\ncmd &lt;- paste0(qs(java), &#8221; -Xmx512m &#8220;, &#8221; -cp &#8220;, qs(boot),<br \/>\n&#8221; -Drjava.class.path=&#8221;, cp,<br \/>\n&#8221; -Drjava.path=&#8221;,qs(rJavaPath),<br \/>\n&#8221; -Dmain.class=org.rosuda.JGR.<wbr><\/wbr>JGR &#8220;,&#8221; -Djgr.load.pkgs=yes &#8220;,<br \/>\n&#8221; -Djgr.loader.ver=1.7&#8243;, &#8221; -Dr.arch=&#8221;,arch,<br \/>\n&#8221; RJavaClassLoader&#8221;)<br \/>\nsystem(cmd,wait=FALSE)<br \/>\ncmd<br \/>\n}<br \/>\nlaunchJGR()<\/p>\n<p>3. If that doesn&#8217;t work, open R in c:\\Program Files\\R\\R-3.0.1\\bin\\x64\\Rgui.<wbr><\/wbr>exe and run the same code.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. make sure you have java installed. 2. open R in c:\\Program Files\\R\\R-3.0.1\\bin\\i386\\Rgui.exe and run: install.packages(c(&#8220;rJava&#8221;,&#8221;iplots&#8221;,&#8221;JGR&#8221;,&#8221;Deducer&#8221;,&#8221;JavaGD&#8221;)) .libPaths() library(JGR) launchJGR &lt;- function(){ windows &lt;- .Platform$OS.type ==&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[],"class_list":["post-414","post","type-post","status-publish","format-standard","hentry","category-r"],"_links":{"self":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/comments?post=414"}],"version-history":[{"count":0,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/414\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/media?parent=414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/categories?post=414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/tags?post=414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}