[R] Reading files

jim holtman jholtman at gmail.com
Sat Apr 25 13:52:01 CEST 2009


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?



More information about the R-help mailing list