Philip James Smith
2008-Sep-26 16:53 UTC
[R] howto convert matrix of numeric values to Date class?
Hi: I have a matrix, named "mat," of numeric values that are in days since Jan 1, 1960. I want to convert them Date class values so that I can do things like seq( value , len=10, by="1 week") where "value" is any of the matrix elements. How do I do this? Please reply to: philipsmith at alumni.albany.edu Thanks! Phil Smith Duluth, GA
jim holtman
2008-Sep-26 23:49 UTC
[R] howto convert matrix of numeric values to Date class?
You should be able to convert with: myDate <- as.Date(dates, origin='1960-1-1') On Fri, Sep 26, 2008 at 12:53 PM, Philip James Smith <philipsmith at alumni.albany.edu> wrote:> Hi: > > I have a matrix, named "mat," of numeric values that are in days since Jan > 1, 1960. > > I want to convert them Date class values so that I can do things like > > seq( value , len=10, by="1 week") > > where "value" is any of the matrix elements. > > How do I do this? > > Please reply to: philipsmith at alumni.albany.edu > > Thanks! > Phil Smith > Duluth, GA > > ______________________________________________ > 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?
Apparently Analagous Threads
- how can I write code to detect whether the machine is Windows or Linux?
- computing distance in miles or km between 2 street addresses
- computing distance in miles or km between 2 street
- question about difference in date objects
- using pam_winbind to authenticate against AD/krb