<html>
<head>
</head>
<body>
Thx i never used and heard about subset. <br>
Subset isn't mentioned in the see also section of the data.frame function.<br>
And it is missing in the R intro to.<br>
<br>
The rbind description says.<br>
... vectors or matrices. (but nothing about data.frames)<br>
<br>
And subset is not working for strings.<br>
But what if you have in your dataframe char (string data)?<br>
eg.: subset(data1,name=grep("Anders")) wouldn't work.<br>
<br>
<br>
Sincerely<br>
Eryk<br>
<br>
<br>
Anders Nielsen wrote:<br>
<blockquote type="cite" cite="mid:1020177617.2176.13.camel@fisher.dina.kvl.dk">
<pre wrap="">Dear Eryk<br><br>All of these operations are possible in R, as the following <br>example show <br><br>Kind regards, <br><br>Anders. <br><br></pre>
<blockquote type="cite">
<pre wrap="">data1<-data.frame(x=1:5, y=1:5/10)<br>data2<-data.frame(x=6:10, y=6:10/10)<br>data12<-rbind(data1,data2)<br>data12<br></pre>
</blockquote>
<pre wrap=""><!----> x y<br>1 1 0.1<br>2 2 0.2<br>3 3 0.3<br>4 4 0.4<br>5 5 0.5<br>6 6 0.6<br>7 7 0.7<br>8 8 0.8<br>9 9 0.9<br>10 10 1.0<br></pre>
<blockquote type="cite">
<pre wrap="">is.data.frame(data12)<br></pre>
</blockquote>
<pre wrap=""><!---->[1] TRUE<br></pre>
<blockquote type="cite">
<pre wrap="">data12x<-subset(data12, select=-y)<br>data12x<br></pre>
</blockquote>
<pre wrap=""><!----> x<br>1 1<br>2 2<br>3 3<br>4 4<br>5 5<br>6 6<br>7 7<br>8 8<br>9 9<br>10 10<br></pre>
<blockquote type="cite">
<pre wrap="">data12BigX<-subset(data12, x>5)<br>data12BigX<br></pre>
</blockquote>
<pre wrap=""><!----> x y<br>6 6 0.6<br>7 7 0.7<br>8 8 0.8<br>9 9 0.9<br>10 10 1.0<br></pre>
<blockquote type="cite">
<pre wrap="">data12BigX<br>as.matrix(data12)<br></pre>
</blockquote>
<pre wrap=""><!----> x y<br>1 1 0.1<br>2 2 0.2<br>3 3 0.3<br>4 4 0.4<br>5 5 0.5<br>6 6 0.6<br>7 7 0.7<br>8 8 0.8<br>9 9 0.9<br>10 10 1.0<br><br>On Tue, 2002-04-30 at 16:58, Witold Eryk Wolski wrote:<br></pre>
<blockquote type="cite">
<pre wrap="">Is there a library that is able for example to<br>1. merge 2 dataframes by row eg.: rbind(dataframe1, dataframe2):data.frame<br>2. delete a column from a dataframe del(dataframe, colname) or <br>del(dataframe, colindex= 1):data.frame?<br>3. Select lines from a dataframe by a specific function ? <br>select(dataframe, func=small(x){x<1}, colindex=3): data.frame?<br>4. converting all double columns of a data.frame to a matrix. <br>datafram_to_matrix(dataframe1):matrix<br><br>If not would not it be usefull to have such a library on the cran?<br><br>Sincerely<br>Eryk<br><br><br>-- <br> \|/ \|/ \|/<br> 'v' 'v' 'v'<br> //| |\\ //| |\\ //| |\\<br>----m-m-----m-m-----m-m-------w-w-----<br> \\| |//<br> Eryk Witold Wolski .^.<br> /|\<br><a class="moz-txt-link-abbreviated" href="mailto:wolski@molen.mpg.de">wolski@molen.mpg.de</a><br>tel : 0049-(0)30-8413-1543<br>f
ax : 0049-(0)30-8413-1139<br>mobile : 0049-1793210931<br><a class="moz-txt-link-freetext" href="http://www.molgen.mpg.de/~mass-spec">http://www.molgen.mpg.de/~mass-spec</a><br><a class="moz-txt-link-freetext" href="http://www.molgen.mpg.de/~wolski">http://www.molgen.mpg.de/~wolski</a><br><br><br>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-<br>r-help mailing list -- Read <a class="moz-txt-link-freetext" href="http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html">http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html</a><br>Send "info", "help", or "[un]subscribe"<br>(in the "body", not the subject !) To: <a class="moz-txt-link-abbreviated" href="mailto:r-help-request@stat.math.ethz.ch">r-help-request@stat.math.ethz.ch</a><br>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._<br></pre>
</blockquote>
<pre wrap=""><!----><br><br></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="$mailwrapcol">--
\|/ \|/ \|/
'v' 'v' 'v'
//| |\\ //| |\\ //| |\\
----m-m-----m-m-----m-m-------w-w-----
\\| |//
Eryk Witold Wolski .^.
/|\
<a class="moz-txt-link-abbreviated" href="mailto:wolski@molen.mpg.de">wolski@molen.mpg.de</a>
tel : 0049-(0)30-8413-1543
fax : 0049-(0)30-8413-1139
mobile : 0049-1793210931
<a class="moz-txt-link-freetext" href="http://www.molgen.mpg.de/~mass-spec">http://www.molgen.mpg.de/~mass-spec</a>
<a class="moz-txt-link-freetext" href="http://www.molgen.mpg.de/~wolski">http://www.molgen.mpg.de/~wolski</a>
</pre>
<br>
</body>
</html>