<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>wsyang.com &#187; R-Tips</title>
	<atom:link href="http://wsyang.com/wp/category/%ea%b9%8c%eb%a8%b9%ec%a7%80-%eb%a7%90%ec%9e%90/r-tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://wsyang.com/wp</link>
	<description>Mac, Statistics, Photograph, and Common Life in Japan</description>
	<lastBuildDate>Fri, 25 Dec 2009 05:50:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>[R] Boxplot에 관측치의 수를 표시하는 방법</title>
		<link>http://wsyang.com/wp/2008/08/06/r-boxplot%ec%97%90-%ea%b4%80%ec%b8%a1%ec%b9%98%ec%9d%98-%ec%88%98%eb%a5%bc-%ed%91%9c%ec%8b%9c%ed%95%98%eb%8a%94-%eb%b0%a9%eb%b2%95/</link>
		<comments>http://wsyang.com/wp/2008/08/06/r-boxplot%ec%97%90-%ea%b4%80%ec%b8%a1%ec%b9%98%ec%9d%98-%ec%88%98%eb%a5%bc-%ed%91%9c%ec%8b%9c%ed%95%98%eb%8a%94-%eb%b0%a9%eb%b2%95/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 07:52:57 +0000</pubDate>
		<dc:creator>민석아빠</dc:creator>
				<category><![CDATA[R-Tips]]></category>
		<category><![CDATA[Boxplot]]></category>
		<category><![CDATA[그래프]]></category>

		<guid isPermaLink="false">http://www.wsyang.com/blog/?p=519</guid>
		<description><![CDATA[Boxplot에서 관측치의 수를 나타내고 싶은 경우, 여러 가지 방법이 있겠지만, 함수 text() 혹은 mtext()를 사용하는 것이 가장 간단하지 않을까 싶습니다. 함수 text()가 그래프 안에 관측치의 수를 표시하는 반면 mtext()는 그래프의 축(axis)에 표시하는 차이가 있습니다.
&#62; y &#60; - rnorm(50)
&#62; x &#60; - factor(sample(letters[1:5],50,replace=T))
&#62; boxplot(y~x, col=&#34;lightgray&#34;)
&#62; text(1:5,rep(min(y),5),paste(&#34;n=&#34;,tapply(y,x,length)) )


위 예의 경우 boxplot과 관측치의 수가 겹쳐버리게 되어 보기가 좀 [...]]]></description>
			<content:encoded><![CDATA[<p>Boxplot에서 관측치의 수를 나타내고 싶은 경우, 여러 가지 방법이 있겠지만, 함수 text() 혹은 mtext()를 사용하는 것이 가장 간단하지 않을까 싶습니다. 함수 text()가 그래프 안에 관측치의 수를 표시하는 반면 mtext()는 그래프의 축(axis)에 표시하는 차이가 있습니다.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:99%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; y &lt; - rnorm(50)<br />
&gt; x &lt; - factor(sample(letters[1:5],50,replace=T))<br />
&gt; boxplot(y~x, col=&quot;lightgray&quot;)<br />
&gt; text(1:5,rep(min(y),5),paste(&quot;n=&quot;,tapply(y,x,length)) )</div></div>
<p><img src="http://wsyang.com/wp/wp-content/uploads/2008/08/rplot.jpg" alt="Rplot.jpg" width="450" height="450" /><br />
<span id="more-519"></span><br />
위 예의 경우 boxplot과 관측치의 수가 겹쳐버리게 되어 보기가 좀 불편해집니다. 이런 경우 mtext() 함수를 이용하면</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:99%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; X &lt; - boxplot(y ~ x, col = &quot;lightgray&quot;)<br />
&gt; mtext(side=1, line = 2, at = 1:5, paste(&quot;n=&quot;, X$n, sep=&quot;&quot;))</div></div>
<p><img src="http://wsyang.com/wp/wp-content/uploads/2008/08/rplot2.jpg" alt="Rplot2.jpg" width="450" height="450" /></p>
<p>X축의 범주(a,..,e) 밑에 관측치의 수를 나타냄으로써 좀 더 깔끔하게 만들 수 있습니다.</p>
]]></content:encoded>
			<wfw:commentRss>http://wsyang.com/wp/2008/08/06/r-boxplot%ec%97%90-%ea%b4%80%ec%b8%a1%ec%b9%98%ec%9d%98-%ec%88%98%eb%a5%bc-%ed%91%9c%ec%8b%9c%ed%95%98%eb%8a%94-%eb%b0%a9%eb%b2%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[R] 하나의 윈도에 2개의 그래프를 그리는 방법</title>
		<link>http://wsyang.com/wp/2008/07/29/r-%ed%95%98%eb%82%98%ec%9d%98-%ec%9c%88%eb%8f%84%ec%97%90-2%ea%b0%9c%ec%9d%98-%ea%b7%b8%eb%9e%98%ed%94%84%eb%a5%bc-%ea%b7%b8%eb%a6%ac%eb%8a%94-%eb%b0%a9%eb%b2%95/</link>
		<comments>http://wsyang.com/wp/2008/07/29/r-%ed%95%98%eb%82%98%ec%9d%98-%ec%9c%88%eb%8f%84%ec%97%90-2%ea%b0%9c%ec%9d%98-%ea%b7%b8%eb%9e%98%ed%94%84%eb%a5%bc-%ea%b7%b8%eb%a6%ac%eb%8a%94-%eb%b0%a9%eb%b2%95/#comments</comments>
		<pubDate>Mon, 28 Jul 2008 15:31:03 +0000</pubDate>
		<dc:creator>민석아빠</dc:creator>
				<category><![CDATA[R-Tips]]></category>
		<category><![CDATA[Grarh]]></category>
		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://www.wsyang.com/blog/archives/453</guid>
		<description><![CDATA[R에서 하나의 윈도에 2개 이상의 그래프를 겹쳐 그리려면 일반적으로 함수 curve()나 points()를 이용합니다. 하지만, 패키지에 따라서는 이 함수들을 제대로 사용할 수 없는 경우가 있습니다. 제가 경험한 바로는 ROC (receive operating characteristic) curve를 간단하게 그릴 수 있게 해주는 ROCR package에서는 points() 함수를 쓸 수가 없었습니다. 이 같은 경우 2개의 그래프를 겹쳐 그릴 수 있게 하기 위해서는 [...]]]></description>
			<content:encoded><![CDATA[<p>R에서 하나의 윈도에 2개 이상의 그래프를 겹쳐 그리려면 일반적으로 함수 curve()나 points()를 이용합니다. 하지만, 패키지에 따라서는 이 함수들을 제대로 사용할 수 없는 경우가 있습니다. 제가 경험한 바로는 <a href="http://en.wikipedia.org/wiki/Receiver_operating_characteristic" target="_blank">ROC (receive operating characteristic)</a> curve를 간단하게 그릴 수 있게 해주는 <a href="http://cran.r-project.org/web/packages/ROCR/index.html" target="_blank">ROCR package</a>에서는 points() 함수를 쓸 수가 없었습니다. 이 같은 경우 2개의 그래프를 겹쳐 그릴 수 있게 하기 위해서는 함수 par(new=TRUE)를 이용하면 됩니다.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:99%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; x1 &lt; - rnorm(25, mean=0, sd=1)<br />
&gt; y1 &lt; - dnorm(x1, mean=0, sd=1)<br />
<br />
&gt; y2 &lt; - rnorm(25, mean=0, sd=1)<br />
&gt; y2 &lt; - dnorm(x2, mean=0, sd=1)<br />
<br />
&gt; plot(x1, y1, type='p', xlim=range(x1,x2), ylim=range(y1,y2))<br />
&gt; points(x2, y2, type='p', col=&quot;red&quot;,xlim=range(x1,x2), ylim=range(y1,y2))</div></div>
<p><img src="http://wsyang.com/wp/wp-content/uploads/2008/07/rplot1.jpg" alt="Rplot.jpg" width="480" height="480" /></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:99%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; plot(x1, y1, type='p', xlim=range(x1,x2), ylim=range(y1,y2))<br />
&gt; par(new=TRUE)<br />
&gt; plot(x2, y2, type='p', col=&quot;red&quot;, axes=F, xlim=range(x1,x2), ylim=range(y1,y2))</div></div>
<p>2개 이상의 그래프를 겹쳐 그릴 때는 항상 x, y축의 범위에 주의해야 합니다.</p>
]]></content:encoded>
			<wfw:commentRss>http://wsyang.com/wp/2008/07/29/r-%ed%95%98%eb%82%98%ec%9d%98-%ec%9c%88%eb%8f%84%ec%97%90-2%ea%b0%9c%ec%9d%98-%ea%b7%b8%eb%9e%98%ed%94%84%eb%a5%bc-%ea%b7%b8%eb%a6%ac%eb%8a%94-%eb%b0%a9%eb%b2%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>R의 프락시 설정</title>
		<link>http://wsyang.com/wp/2008/07/24/r%ec%9d%98-%ed%94%84%eb%9d%bd%ec%8b%9c-%ec%84%a4%ec%a0%95/</link>
		<comments>http://wsyang.com/wp/2008/07/24/r%ec%9d%98-%ed%94%84%eb%9d%bd%ec%8b%9c-%ec%84%a4%ec%a0%95/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 14:08:50 +0000</pubDate>
		<dc:creator>민석아빠</dc:creator>
				<category><![CDATA[R-Tips]]></category>

		<guid isPermaLink="false">http://www.wsyang.com/blog/archives/396</guid>
		<description><![CDATA[패키지를 네트웍에서 내려받아 바로 인스톨 할 때 일반 가정에서는 문제가 없지만, 규모가 큰 기업에서는 프락시 서버를 이용하는 경우가 있기 때문에 문제가 발생합니다. R에서는 OS에 따라서 프락시 설정에 차이가 있습니다.
MS Windows 통합환경

R을 실행할 때 &#8211;internet2 옵션을 이용하면 IE에서 설정한 프락시 설정을 그대로 이용할 수 있습니다.
Mac OS X
Mac OS X에서도 바이너리 형태의 통합 환경을 제공하지만 앞서 설명한 [...]]]></description>
			<content:encoded><![CDATA[<p>패키지를 네트웍에서 내려받아 바로 인스톨 할 때 일반 가정에서는 문제가 없지만, 규모가 큰 기업에서는 프락시 서버를 이용하는 경우가 있기 때문에 문제가 발생합니다. R에서는 OS에 따라서 프락시 설정에 차이가 있습니다.</p>
<p><strong>MS Windows 통합환경</strong></p>
<p><strong><img src="http://wsyang.com/wp/wp-content/uploads/2008/07/proxy.jpg" alt="proxy.JPG" width="348" height="478" /></strong></p>
<p>R을 실행할 때 &#8211;internet2 옵션을 이용하면 IE에서 설정한 프락시 설정을 그대로 이용할 수 있습니다.</p>
<p><strong>Mac OS X</strong></p>
<p>Mac OS X에서도 바이너리 형태의 통합 환경을 제공하지만 앞서 설명한 방법은 사용할 수 없습니다. 직접 R의 콘솔에서 다음과 같이 입력합니다.</p>
<p>[code] > Sys.putenv("http_proxy"="http://<em>proxy_server</em>/") [/code]</p>
<p>위 명령어를 콘솔에서 직접 입력하는 것보다 .Rprofile에 추가해 놓으면 매번 명령어를 입력해야 하는 불편함을 줄일 수 있습니다.</p>
<p><strong>Unix</strong></p>
<p>터미널에서 사용하는 쉘의 종류에 맞게 입력합니다.</p>
<ul>
<li>tcsh의 경우 : [code] setenv http_proxy http://<em>proxy_server</em>/ [/code]</li>
<li>bash의 경우 : [code] export http_proxy http://<em>proxy_server</em>/ [/code]</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wsyang.com/wp/2008/07/24/r%ec%9d%98-%ed%94%84%eb%9d%bd%ec%8b%9c-%ec%84%a4%ec%a0%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>R의 설정파일과 실행할 때 사용가능한 옵션</title>
		<link>http://wsyang.com/wp/2008/07/22/r%ec%9d%98-%ec%84%a4%ec%a0%95%ed%8c%8c%ec%9d%bc%ea%b3%bc-%ec%8b%a4%ed%96%89%ed%95%a0-%eb%95%8c-%ec%82%ac%ec%9a%a9%ea%b0%80%eb%8a%a5%ed%95%9c-%ec%98%b5%ec%85%98/</link>
		<comments>http://wsyang.com/wp/2008/07/22/r%ec%9d%98-%ec%84%a4%ec%a0%95%ed%8c%8c%ec%9d%bc%ea%b3%bc-%ec%8b%a4%ed%96%89%ed%95%a0-%eb%95%8c-%ec%82%ac%ec%9a%a9%ea%b0%80%eb%8a%a5%ed%95%9c-%ec%98%b5%ec%85%98/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 04:42:29 +0000</pubDate>
		<dc:creator>민석아빠</dc:creator>
				<category><![CDATA[R-Tips]]></category>
		<category><![CDATA[R-package]]></category>

		<guid isPermaLink="false">http://www.wsyang.com/blog/archives/372</guid>
		<description><![CDATA[R에서는 초기설정이나 작업 상태를 저장하기 위한 설정 파일을 제공하고 있습니다.

.Rprofile : R의 실행 시 읽어들이는 파일로, 이곳에 패키지를 정의해 두면, R을 실행할 때 지정한 패키지를 읽어들임.
.Rdata : R을 종료할 때 &#8220;Save workspace image? [y/n/c]&#8220;라는 메시지가 출력되는데 이때 &#8220;y&#8221;를 선택하면 .Rdata 파일에 작업 상태를 저장한다. 이후 R을 실행할 때 아무런 옵션도 지정하지 않는다면 자동으로 이 파일을 [...]]]></description>
			<content:encoded><![CDATA[<p>R에서는 초기설정이나 작업 상태를 저장하기 위한 설정 파일을 제공하고 있습니다.</p>
<ul>
<li>.Rprofile : R의 실행 시 읽어들이는 파일로, 이곳에 패키지를 정의해 두면, R을 실행할 때 지정한 패키지를 읽어들임.</li>
<li>.Rdata : R을 종료할 때 &#8220;Save workspace image? [y/n/c]&#8220;라는 메시지가 출력되는데 이때 &#8220;y&#8221;를 선택하면 .Rdata 파일에 작업 상태를 저장한다. 이후 R을 실행할 때 아무런 옵션도 지정하지 않는다면 자동으로 이 파일을 읽어들이며, 전회에 실행한 작업내용에 따라 파일을 크기가 커질 수 있으므로 R의 실행 시 시간이 오래 걸릴 수도 있음</li>
<li>.Rhistory : R의 콘솔에서 실행한 커맨드의 사용 이력이 저장되는 파일</li>
</ul>
<p>이 설정파일들은 R을 실행할 때 여러 가지 옵션을 이용해 사용 여부를 지정할 수 있습니다. 이 옵션들은 Unix계열의 OS를 이용할 때 보다 유용하게 쓸 수 있습니다.</p>
<ul>
<li>&#8211;no-init-file : 설정파일(.Rprofile)을 읽어들이지 않음</li>
<li>&#8211;no-save : 종료 시 데이터를 .Rdata 파일에 저장하지 않음</li>
<li>&#8211;save : 종료 시 자동으로 .Rdata 파일에 데이터를 저장함</li>
<li>&#8211;restore : R을 실행할 때 바로 이전에 저장한 데이터(.Rdata)를 읽어들임</li>
<li>&#8211;no-restore-data : R의 실행 시 이전에 저장한 데이터를 읽어들이지 않음</li>
<li>&#8211;no-restore-history : R의 실행 시 커맨드의 사용 이력을 읽어들이지 않음</li>
<li>&#8211;no-restore : 실행 시 어떤 데이터도 읽어들이지 않음</li>
<li>&#8211;quiet or -q : 실행 시 표시되는 초기 메시지를 출력하지 않음</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wsyang.com/wp/2008/07/22/r%ec%9d%98-%ec%84%a4%ec%a0%95%ed%8c%8c%ec%9d%bc%ea%b3%bc-%ec%8b%a4%ed%96%89%ed%95%a0-%eb%95%8c-%ec%82%ac%ec%9a%a9%ea%b0%80%eb%8a%a5%ed%95%9c-%ec%98%b5%ec%85%98/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>R 은?</title>
		<link>http://wsyang.com/wp/2008/07/18/r-%ec%9d%80/</link>
		<comments>http://wsyang.com/wp/2008/07/18/r-%ec%9d%80/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 08:00:38 +0000</pubDate>
		<dc:creator>민석아빠</dc:creator>
				<category><![CDATA[R-Tips]]></category>
		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://www.wsyang.com/blog/archives/352</guid>
		<description><![CDATA[R은 AT&#38;T 벨연구소의 Becker와 Chembers에 의해 발표된 S라 하는 통계분석, 확률 시뮬레이션, 그래픽을 위한 프로그래밍 언어를 그 기초로, Ross Ihaka와 Robert Gentleman에 의해 1992년부터 개발이 시작되었습니다. 현재는 세계 다수의 멤버로 구성된 개발팀에 의해 발전하고 있으며, S의 개발자이기도 한 Chembers도 R의 개발팀에 합류하였습니다.
R은 오픈소스 소프트웨어이며, GPL 라이센스를 따르고 있습니다. R 프로젝트의 홈페이지는 http://www.r-project.org이며, CRAN (Comprehensive R [...]]]></description>
			<content:encoded><![CDATA[<p>R은 AT&amp;T 벨연구소의 Becker와 Chembers에 의해 발표된 S라 하는 통계분석, 확률 시뮬레이션, 그래픽을 위한 프로그래밍 언어를 그 기초로, Ross Ihaka와 Robert Gentleman에 의해 1992년부터 개발이 시작되었습니다. 현재는 세계 다수의 멤버로 구성된 개발팀에 의해 발전하고 있으며, S의 개발자이기도 한 Chembers도 R의 개발팀에 합류하였습니다.</p>
<p>R은 오픈소스 소프트웨어이며, GPL 라이센스를 따르고 있습니다. R 프로젝트의 홈페이지는 <a title="R project" href="http://www.r-project.org" target="_blank">http://www.r-project.org</a>이며, CRAN (Comprehensive R Archive Network; <a title="CRAN" href="http://cran.r-project.org" target="_blank">http://cran.r-project.org</a>) 에서 R의 소스코드 및 MS Windows, Linux, Mac OS X 용으로 컴파일된 바이너리 파일을 얻을 수 있습니다. 또한, 여러 통계분석에 특화된 패키지도 이곳에서 제공됩니다.</p>
<p>R을 처음으로 공부하는 분들은 다음 자료를 참고하는 것도 좋습니다.</p>
<ul>
<li><a href="http://cran.r-project.org/doc/manuals/R-intro.pdf" target="_blank">An Introduction to R</a></li>
<li><a href="http://cran.r-project.org/doc/contrib/Faraway-PRA.pdf" target="_blank">Practical Regression and ANOVA in R</a></li>
<li><a href="http://www.mayin.org/ajayshah/KB/R/index.html" target="_blank">R by Example</a></li>
<li><a href="http://www.ats.ucla.edu/stat/R/" target="_blank">UCLA&#8217;s R resources</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://wsyang.com/wp/2008/07/18/r-%ec%9d%80/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[R] 결손치를 히스토그램에 나타내는 방법</title>
		<link>http://wsyang.com/wp/2008/07/07/r-%ea%b2%b0%ec%86%90%ec%b9%98%eb%a5%bc-%ed%9e%88%ec%8a%a4%ed%86%a0%ea%b7%b8%eb%9e%a8%ec%97%90-%eb%82%98%ed%83%80%eb%82%b4%eb%8a%94-%eb%b0%a9%eb%b2%95/</link>
		<comments>http://wsyang.com/wp/2008/07/07/r-%ea%b2%b0%ec%86%90%ec%b9%98%eb%a5%bc-%ed%9e%88%ec%8a%a4%ed%86%a0%ea%b7%b8%eb%9e%a8%ec%97%90-%eb%82%98%ed%83%80%eb%82%b4%eb%8a%94-%eb%b0%a9%eb%b2%95/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 03:04:39 +0000</pubDate>
		<dc:creator>민석아빠</dc:creator>
				<category><![CDATA[R-Tips]]></category>
		<category><![CDATA[histogram]]></category>
		<category><![CDATA[missing value]]></category>
		<category><![CDATA[결손치]]></category>
		<category><![CDATA[히스토그램]]></category>

		<guid isPermaLink="false">http://woosung.digimoon.net/blog/?p=41</guid>
		<description><![CDATA[기본적인 R의 histgram에서는 결손치를 그래프에 표시하지 않습니다. 결손치의 수를 그래프에 나타내기 위해서는 약간의 과정이 필요합니다.
&#62; sample.data &#60; - as.factor(sample(c(1,0,NA),100,replace=T))
&#62; sample.data &#60; - as.character(sample.data)
&#62; sample.data[is.na(sample.data)] &#60; - &#34; NA&#34;
&#62; sample.data &#60; - factor(sample.data)
&#62; plot(sample.data)

&#8220;ggplot2&#8243; 패키지를 이용하면 좀더 멋진 그래프를 얻을 수 있습니다.
&#62; ibrary(ggplot2)
&#62; qplot(sample.data, geom=&#34;histogram&#34;)

 
]]></description>
			<content:encoded><![CDATA[<p>기본적인 R의 histgram에서는 결손치를 그래프에 표시하지 않습니다. 결손치의 수를 그래프에 나타내기 위해서는 약간의 과정이 필요합니다.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:99%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; sample.data &lt; - as.factor(sample(c(1,0,NA),100,replace=T))<br />
&gt; sample.data &lt; - as.character(sample.data)<br />
&gt; sample.data[is.na(sample.data)] &lt; - &quot; NA&quot;<br />
&gt; sample.data &lt; - factor(sample.data)<br />
&gt; plot(sample.data)</div></div>
<p><img class="aligncenter size-full wp-image-729" title="rplot3" src="http://wsyang.com/wp/wp-content/uploads/2008/07/rplot3.jpg" alt="rplot3" width="480" height="480" /></p>
<p>&#8220;ggplot2&#8243; 패키지를 이용하면 좀더 멋진 그래프를 얻을 수 있습니다.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:99%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; ibrary(ggplot2)<br />
&gt; qplot(sample.data, geom=&quot;histogram&quot;)</div></div>
<p><img class="aligncenter size-full wp-image-730" title="rplot21" src="http://wsyang.com/wp/wp-content/uploads/2008/07/rplot21.jpg" alt="rplot21" width="480" height="480" /></p>
<p style="text-align: center;"> </p>
]]></content:encoded>
			<wfw:commentRss>http://wsyang.com/wp/2008/07/07/r-%ea%b2%b0%ec%86%90%ec%b9%98%eb%a5%bc-%ed%9e%88%ec%8a%a4%ed%86%a0%ea%b7%b8%eb%9e%a8%ec%97%90-%eb%82%98%ed%83%80%eb%82%b4%eb%8a%94-%eb%b0%a9%eb%b2%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[R Tips] 중복된 Package를 삭제하는 방법</title>
		<link>http://wsyang.com/wp/2008/06/27/r-tips-%ec%a4%91%eb%b3%b5%eb%90%9c-package%eb%a5%bc-%ec%82%ad%ec%a0%9c%ed%95%98%eb%8a%94-%eb%b0%a9%eb%b2%95/</link>
		<comments>http://wsyang.com/wp/2008/06/27/r-tips-%ec%a4%91%eb%b3%b5%eb%90%9c-package%eb%a5%bc-%ec%82%ad%ec%a0%9c%ed%95%98%eb%8a%94-%eb%b0%a9%eb%b2%95/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 15:50:38 +0000</pubDate>
		<dc:creator>민석아빠</dc:creator>
				<category><![CDATA[R-Tips]]></category>
		<category><![CDATA[R-package]]></category>

		<guid isPermaLink="false">http://woosung.exofire.net/blog/2008/06/27/r-tips-%ec%a4%91%eb%b3%b5%eb%90%9c-package%eb%a5%bc-%ec%82%ad%ec%a0%9c%ed%95%98%eb%8a%94-%eb%b0%a9%eb%b2%95/</guid>
		<description><![CDATA[R을 사용하다 보면 package가 중복되어 설치되는 경우가 있습니다. 이러한 경우 중복된 package를 삭제하려면, 함수 remove.packages()를 이용해 R의 콘솔상에서 다음과 같이 입력하면 됩니다.
&#62; remove.packages(installed.packages() [duplicated(rownames(installed.packages())),1], lib=.libPaths()[.libPaths() != .Library])
]]></description>
			<content:encoded><![CDATA[<p>R을 사용하다 보면 package가 중복되어 설치되는 경우가 있습니다. 이러한 경우 중복된 package를 삭제하려면, 함수 remove.packages()를 이용해 R의 콘솔상에서 다음과 같이 입력하면 됩니다.</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:99%;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&gt; remove.packages(installed.packages() [duplicated(rownames(installed.packages())),1], lib=.libPaths()[.libPaths() != .Library])</div></div>
]]></content:encoded>
			<wfw:commentRss>http://wsyang.com/wp/2008/06/27/r-tips-%ec%a4%91%eb%b3%b5%eb%90%9c-package%eb%a5%bc-%ec%82%ad%ec%a0%9c%ed%95%98%eb%8a%94-%eb%b0%a9%eb%b2%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
