Skip to content
Back to formatted view

Raw Message

Message-ID: <644e1f320904250452x79ecaf51g4cb9f0a43becb3@mail.gmail.com>
Date: 2009-04-25T11:52:01Z
From: jim holtman
Subject: Reading files
In-Reply-To: <816b5ce40904242346k19641a9dvcf0f4112b25312ca@mail.gmail.com>

On Sat, Apr 25, 2009 at 2:46 AM, Santosh <santosh2005 at gmail.com> wrote:
> Dear R-sians
> Quick question...
>
> 1) From a flat (data) file with 100+ columns, how do I read specific columns
> instead of reading the entire dataset? I am trying to avoid reading the
> entire file followed by "subsetting".

In read.table you can use 'col.classes' to define columns to skp.

>
> 2) is the a way to a call a column of dataframe through a variable.. e.g.
>
> e,g
> var="date"
>
> something like...
> data${var} <- "02 Oct 2009?

data[[var]] <- "02Oct 2009"

>
> Regards,
> santosh
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?