Re: [Rd] format Date

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Mon, 18 Aug 2008 11:24:10 +0100 (BST)

On Sun, 17 Aug 2008, sayeed hussain wrote:

> Hey people..

Wrong 'people': this is a question for R-help, and please study the R posting guide.

> I have been trying this code
>
> write.table(data.frame(date,name,amount,details),file="C:/Documents and
> Settings/Administrator/My Documents/Account/Account
> Info.txt",quote=FALSE,append=TRUE,col.names=FALSE,row.names=FALSE,sep="\t")
>
> check<-read.table("C:/Documents and Settings/Administrator/My
> Documents/Account/Account
> Info.txt",col.names=c("Date","Name","Amount","Details"),header=FALSE,sep="\t",
> na.strings="NA")
>
> #My na.strings="NA" is not showing NA's in blank entries

It is not documented to.

> # check$Date is of the format("%Y-%m-%d")

Really? I think most likely it is a character string.

> # I want to change it to
>
> check$Date<-format(check$Date,"%d-%m-%Y")
>
> # I get this error
>
> Error in switch(mode(x), "NULL" = "NULL", character = .Internal(format(x, :
>
> invalid 'trim' argument

Did you read ?format: trim is the second argument, and this is not a valid value.

>
> HELP
So, please read the posting guide and post a complete reproducible example there. Then people may be prepared to help you, if they believe you have made a reasonable effort to help yourself.

> Sayeed
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Mon 18 Aug 2008 - 10:27:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 19 Aug 2008 - 00:37:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive