Skip to content

how to indice the column in the data.frame

4 messages · haohao Tsing, Joshua Wiley, Sarah Goslee +1 more

#
Hi,

Look at ?"["

anadata <- newdata[, cmn]
## i.e., extract all rows (the first argument is empty of the 2 column
anadata <- newdata[, 2]

Hope this helps,

Josh
On Tue, Nov 15, 2011 at 8:02 AM, haohao Tsing <haohaorain at gmail.com> wrote:

  
    
#
On Tue, Nov 15, 2011 at 11:23 AM, Joshua Wiley <jwiley.psych at gmail.com> wrote:
Or, if this is part of a more general problem and the column names are
not necessarily in sequence:
[1] 4 5 6

Sarah

  
    
#
On Nov 15, 2011, at 11:02 AM, haohao Tsing wrote:

            
Either:
Or:
Your should go back and study your introductory manual now. If this is  
not near the begininning of that manual, you hsoulswitch manuals.

You should also type:

?"$"

And read that page carefully and try all of the examples. It will  
probably take more than one reading to master its contents, but it is  
a core part of learning R.