Dear R People: I am reading in a file via read.table. Is there a way to bring in the time that the file was created, please? Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com
Erin Hodgess wrote:> Dear R People: > > I am reading in a file via read.table. Is there a way to bring in > the time that the file was created, please?Use file.info on the same file ? HTH, Tobias
Tena koe Erin You could write a wee wrapper and give the file an attribute. For example, copy <- function (file = "clipboard", sep = "\t", na.strings = c("NA", "*"), as.is = T, ...) { myX <- read.table(file, sep = sep, na.strings = na.strings, as.is = as.is, ...) attr(myX, "copy time") <- Sys.time() myX } I did this some time ago, but I must admit that I find it of limited value. HTH .... Peter Alspach> -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of Erin Hodgess > Sent: Wednesday, 22 July 2009 8:55 a.m. > To: R help > Subject: [R] time attribute from a file > > Dear R People: > > I am reading in a file via read.table. Is there a way to bring in > the time that the file was created, please? > > Thanks, > Erin > > > -- > Erin Hodgess > Associate Professor > Department of Computer and Mathematical Sciences University > of Houston - Downtown > mailto: erinm.hodgess at gmail.com > > ______________________________________________ > 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. >The contents of this e-mail are confidential and may be subject to legal privilege. If you are not the intended recipient you must not use, disseminate, distribute or reproduce all or any part of this e-mail or attachments. If you have received this e-mail in error, please notify the sender and delete all material pertaining to this e-mail. Any opinion or views expressed in this e-mail are those of the individual sender and may not represent those of The New Zealand Institute for Plant and Food Research Limited.
Hi, On Jul 21, 2009, at 4:54 PM, Erin Hodgess wrote:> Dear R People: > > I am reading in a file via read.table. Is there a way to bring in > the time that the file was created, please?See: ?file.info and the mtime, ctime, atime attributes it returns. -steve -- Steve Lianoglou Graduate Student: Physiology, Biophysics and Systems Biology Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact
Peter, that is assigning the time of creation of the object name. I think Erin might be looking for the file.info function, see ?file.info . Erik -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Peter Alspach Sent: Tuesday, July 21, 2009 4:03 PM To: Erin Hodgess; R help Subject: Re: [R] time attribute from a file Tena koe Erin You could write a wee wrapper and give the file an attribute. For example, copy <- function (file = "clipboard", sep = "\t", na.strings = c("NA", "*"), as.is = T, ...) { myX <- read.table(file, sep = sep, na.strings = na.strings, as.is = as.is, ...) attr(myX, "copy time") <- Sys.time() myX } I did this some time ago, but I must admit that I find it of limited value. HTH .... Peter Alspach> -----Original Message----- > From: r-help-bounces at r-project.org > [mailto:r-help-bounces at r-project.org] On Behalf Of Erin Hodgess > Sent: Wednesday, 22 July 2009 8:55 a.m. > To: R help > Subject: [R] time attribute from a file > > Dear R People: > > I am reading in a file via read.table. Is there a way to bring in > the time that the file was created, please? > > Thanks, > Erin > > > -- > Erin Hodgess > Associate Professor > Department of Computer and Mathematical Sciences University > of Houston - Downtown > mailto: erinm.hodgess at gmail.com > > ______________________________________________ > 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. >The contents of this e-mail are confidential and may be ...{{dropped:21}}
Thanks to all! file.info is it. On Tue, Jul 21, 2009 at 4:06 PM, Erik Iverson<eiverson at nmdp.org> wrote:> Peter, that is assigning the time of creation of the object name. > > I think Erin might be looking for the file.info function, see ?file.info . > > Erik > > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Peter Alspach > Sent: Tuesday, July 21, 2009 4:03 PM > To: Erin Hodgess; R help > Subject: Re: [R] time attribute from a file > > Tena koe Erin > > You could write a wee wrapper and give the file an attribute. ?For > example, > > copy <- function (file = "clipboard", sep = "\t", na.strings = c("NA", > ? ?"*"), as.is = T, ...) > { > ? ?myX <- read.table(file, sep = sep, na.strings = na.strings, > ? ? ? ?as.is = as.is, ...) > ? ?attr(myX, "copy time") <- Sys.time() > ? ?myX > } > > I did this some time ago, but I must admit that I find it of limited > value. > > HTH .... > > Peter Alspach > >> -----Original Message----- >> From: r-help-bounces at r-project.org >> [mailto:r-help-bounces at r-project.org] On Behalf Of Erin Hodgess >> Sent: Wednesday, 22 July 2009 8:55 a.m. >> To: R help >> Subject: [R] time attribute from a file >> >> Dear R People: >> >> I am reading in a file via read.table. ? Is there a way to bring in >> the time that the file was created, please? >> >> Thanks, >> Erin >> >> >> -- >> Erin Hodgess >> Associate Professor >> Department of Computer and Mathematical Sciences University >> of Houston - Downtown >> mailto: erinm.hodgess at gmail.com >> >> ______________________________________________ >> 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. >> > > The contents of this e-mail are confidential and may be subject to legal privilege. > ?If you are not the intended recipient you must not use, disseminate, distribute or > ?reproduce all or any part of this e-mail or attachments. ?If you have received this > ?e-mail in error, please notify the sender and delete all material pertaining to this > ?e-mail. ?Any opinion or views expressed in this e-mail are those of the individual > ?sender and may not represent those of The New Zealand Institute for Plant and > ?Food Research Limited. > > ______________________________________________ > 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. >-- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodgess at gmail.com