Re: [R] Reading a datetime vector

2016-02-24 Thread D Wolf via R-help
In addition to my previous message, DF_extract_clean.R is the program in the dropbox folder that I am currently working on. Doug On Tuesday, February 23, 2016 4:02 AM, Jim Lemon wrote: Hi Doug,It is difficult for us to work out what is happening as we don't have access to a toy data s

Re: [R] Reading a datetime vector

2016-02-23 Thread Jeff Newmiller
You are overthinking this. The answer is in the help file for read.xls2. -- Sent from my phone. Please excuse my brevity. On February 23, 2016 7:19:38 PM PST, Jim Lemon wrote: >Hi Doug, >I see what the problem is now. When your Excel file is read in with >read.xlsx2, the DateTimeStamp is read a

Re: [R] Reading a datetime vector

2016-02-23 Thread Jim Lemon
Hi Doug, I see what the problem is now. When your Excel file is read in with read.xlsx2, the DateTimeStamp is read as days since Microsoft's time epoch (see earlier posts on this). As these values are numeric, they cannot be converted in the same way as a human readable date/time string. The easies

Re: [R] Reading a datetime vector

2016-02-23 Thread Jim Lemon
Hi again, My apologies - I didn't see the other email. JIm On Wed, Feb 24, 2016 at 10:29 AM, Jim Lemon wrote: > Doug, > We're getting warm. If we ask really nicely, will you tell us the URL of > the "dropbox folder you are working on"? > > Jim > > > On Wed, Feb 24, 2016 at 9:29 AM, D Wolf wrot

Re: [R] Reading a datetime vector

2016-02-23 Thread Jim Lemon
Doug, We're getting warm. If we ask really nicely, will you tell us the URL of the "dropbox folder you are working on"? Jim On Wed, Feb 24, 2016 at 9:29 AM, D Wolf wrote: > In addition to my previous message, DF_extract_clean.R is the program in > the dropbox folder that I am currently working

Re: [R] Reading a datetime vector

2016-02-23 Thread peter dalgaard
On 22 Feb 2016, at 18:30 , Jeff Newmiller wrote: > .. read the Excel documentation for representing dates... it is days since > December 30, 1899 on Windows. I seem to recall that that is actually only true for dates after March 1, 1900. (The reason that it is not counting December 31st being

Re: [R] Reading a datetime vector

2016-02-23 Thread Jim Lemon
Hi Doug, It is difficult for us to work out what is happening as we don't have access to a toy data set that we can play with. Excel spreadsheets are one of those things that you can't just attach to your email to the help list. If there is somewhere you can leave a _small_ Excel sample file (take

Re: [R] Reading a datetime vector

2016-02-22 Thread D Wolf via R-help
Hello Everyone,  The column begins populated with integers as so:1/1/2013 0:00 in the spreadsheet equals 41257 in R's dataframe1/1/2013 0:15 in the spreadsheet equals 41257.01041664 in R's dataframe...41257 must be in minutes since 1440min/day * .01041664 day = 15 minutes. 41257 minutes

Re: [R] Reading a datetime vector

2016-02-22 Thread Jeff Newmiller
It is not minutes... read the Excel documentation for representing dates... it is days since December 30, 1899 on Windows. Read the links I provided in my last email. Also read ?str ... that function does not return anything... it only prints out information so don't expect to get anything us

Re: [R] Reading a datetime vector

2016-02-19 Thread D Wolf via R-help
Hello Jim, I ran str() on the vector and it returned character:str("DF_exp.xlsx") chr "DF_exp.xlsx" I tried df2_TZ$DateTimeStamp <- strptime(as.Date(as.character(df2_TZ$DateTimeStamp, format = "%m/%d/%Y %H:%M", tz = "GMT"))), which produced an error: Error in charToDate(x) :   character string

Re: [R] Reading a datetime vector

2016-02-19 Thread Jeff Newmiller
This is a mailing list. I don't know how you are interacting with it... using a website rather than an email program can lead to some confusion since there can be many ways to accomplish the task of interacting with the mailing list. My email program has a "reply-all" button when I am looking at

Re: [R] Reading a datetime vector

2016-02-18 Thread Jim Lemon
Hi Doug, For one thing, you may be using the wrong format. Your example format has no seconds field. The other thing to watch is whether the data are in %m/%d/%Y or %d/%m/%Y date format. If the latter, you would probably get that error on dates like 19/02/2016. Jim On Fri, Feb 19, 2016 at 8:12 A

Re: [R] Reading a datetime vector

2016-02-18 Thread Jeff Newmiller
You are being rather scattershot in your explanation, so I suspect you are not being systematic in your troubleshooting. Use the str function to examine the data column after you pull it in from excel. It may be numeric, factor, or character, and the approach depends on which that function retur

[R] Reading a datetime vector

2016-02-18 Thread D Wolf via R-help
Hello,I am trying to read a data frame column named DateTimeStamp. The time is in GMT in this format: 1/4/2013 23:30 require(xlsx) df2_TZ = read.xlsx2("DF_exp.xlsx", sheetName = "Sheet1") It's good to that line. But these three lines, which makes the dataframe, converts the column's values to NA