[R] reading Excel file

Gabor Grothendieck ggrothendieck at gmail.com
Tue Mar 25 18:28:10 CET 2008


You can convert the days to Date class after reading it in.
See R News 4/1.

On Tue, Mar 25, 2008 at 10:00 AM, Utkarsh Singhal
<utkarshs at ambaresearch.com> wrote:
> Hi R,
>
>
>
> I have an excel file in which the third column is "date" and others are
> "character" and "numeric".
>
> Number of columns are 12
>
>
>
> If I use this to read the file in R:   x = read.xls("D:\\file.xls")
>
>
>
> The problem is that my date column is read in julian dates.
>
>
>
> So I am using:                           x = read.xls("D:\\file.xls",
> colClasses= c(rep("character",2),"isodate",rep("character",9)))
>
>
>
> But what can I do in case I don't know the number of columns in my
> file??
>
>
>
> I mean is there any way I can specify the colClass of only third column
> and for other columns it can take the default classes??
>
>
>
>
>
> Regards
>
> Utkarsh
>
>
>
>
>
> This e-mail may contain confidential and/or privileged i...{{dropped:13}}
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list