Displaying 20 results from an estimated 4000 matches similar to: "excel dates and times in R"
2005 Nov 10
4
write.table read.table with Dates
I've found several similar issues with write.table/read.table
with Dates on this list, but trying to follow this advice I still
get an error.
First, I read in data from several files, constructing several date/time
columns using ISOdatetime
> str(Tall$Begin)
'POSIXct', format: chr [1:40114] "2005-10-02 00:00:00" "2005-10-02
00:00:00" ...
> length(Tall$Begin)
2002 Apr 08
1
Problem(?) in strptime()
I think the following examples illustrate the crux of the matter
(version and OS info are below).
The problem has to do with the transition from standard time to
daylight savings time. My timezone, US/Pacific, has two parts:
standard time (PST) 8 hours behind GMT and daylight savings time
(PDT) 7 hours behind GMT. The transition takes place this year on 7
April at 02:00, when 02:00 is
2005 Oct 25
2
strptime problem for 2004-10-03 02:00:00
Hello, I at first thought this was a system or locale issue, but since
it occurs on
both Windows and Linux and only for 2004 (AFAIK) I report it.
I have a problem with as.POSIXct for the hour between
"2004-10-03 02:00:00 GMT" and "2004-10-03 02:59:59 GMT".
In short, the 2 AM (GMT) hour in 2004 (but not in other years) is
interpreted as 1 AM by strptime:
(I use ISOdatetime
2002 May 31
2
error in seq.POSIXt?
I am trying to extract only the winters (defined to be 01-Dec through
28-Feb) of daily data from 1948-2002. There are 90 days in each winter
season. I wrote the following code to gather the winter dates into a
single vector:
DJF <- NULL
for(year in 1949:1999) {
temp.begin <- strptime(paste("01/12", year-1, sep="/"), "%d/%m/%Y")
temp.end <-
2010 Dec 03
1
Date-time Conversion from Numeric Representations
Hi all,
I have a dataset called ,dataSet1'. The time column is given in a numeric
code beginning with the year and ending with the minutes. Frist I tried the
strptime() function to solve the problem. It gave me just the date back (and
not the date and time). There is also the ISOdatetime function which didn't
work either. I created a dump file which I detached to this mail with the
2006 Jan 06
1
Daylight Savings Time unknown in R-2.2.1
Under R-2.2.1, a POSIXlt date created with "strptime" has an unknown
Daylight Savings Time flag:
> strptime(20051208, "%Y%m%d")$isdst
[1] -1
This is true on both Linux (details below) and Windows. It did not
occur under R-2.1.0. Any ideas? TIA!
> Sys.getenv("TZ")
TZ
""
Version:
platform = i686-pc-linux-gnu
arch = i686
os = linux-gnu
2006 Mar 07
3
Applying strptime() to a data set or array
I'm sure this is just the result of a basic misunderstanding of the
syntax of R, but I am stumped.
A <-
read.table(file="sumByThirtyMinute.csv",sep=",",col.names=c("date","pandl"))
A now consists of thousands of rows, but A$date is a string...
...
3183 2006-02-28 12:00:00 548.470
3184 2006-02-28 12:30:00 515.240
3185 2006-02-28 13:00:00
2007 Aug 22
1
Time conversion problems
Hi there
I have precipitation data from 2004 to 2006 in varying resolutions (10 to 20min intervals) with time in seconds from beginnig of the year (summation) and a second variable as year.
I applied follwing code to convert the time into a date:
times<-strptime("2004-01-01", "%Y-%m-%d", tz="GMT") + precipitation$time1
everytihng went well, except that every
2008 Apr 10
1
ISOdate/ISOdatetime performance suggestions, other date/time questions
Dear list:
working with date/times I have come across a problem that ISOdate and
ISOdatetime are too slow on large vectors of data. I was surprised just
until I looked at the implementation and the man page: "ISOdatetime and
ISOdate are convenience wrappers for strptime". In other terms, they
convert data to character representation first in order to create a
POSIXlt object that is then
2004 Apr 29
1
Entering times around the start of daylight savings time
I'm having problems entering dates and times around when daylight savings time
starts. If I type (on R 1.8.1 on Gentoo Linux)
> ISOdatetime(2004,4,4,0:4,0,0,"GMT")
[1] "2004-04-03 19:00:00 EST" "2004-04-03 20:00:00 EST"
[3] "2004-04-03 22:00:00 EST" "2004-04-03 22:00:00 EST"
[5] "2004-04-03 23:00:00 EST"
Giving the times
2010 Oct 27
1
Regular time series with irregular start and end dates
Dear R users,
I have a quick question regarding creating an index for a zoo object. I am using R 2.12 on winxp.
I have read through the R archives searching for information on dates and time series analysis and nothing seems to cover my question.
I am extracting data from a time series of remote sensing data. The frequency of the data is 16 days which means I cant use ts (ts likes months single
2016 Apr 18
4
as.Date
Dear All,
I have a data set containing year, month, day and counts as shown below:
data <- read.table("data.txt", col.names = c("year", "month", "day", "counts"))
Using the formula below, I converted the data to as date and plotted.
new.century <- data$year < 70
data$year <- ifelse(new.century, data$year + 2000, data$year + 1900)
2008 Jan 10
2
how to calculate time offset between timezones?
#QUESTION#
Is there a way to calculate the offset between timezones, e.g. from "AST" to
"GMT"?
#DETAILS#
I am working with data files that use local time, and that indicate the
timezone by e.g. "AST" (Atlantic Standard Time, my local time) in a header.
I was guessing that
> ISOdatetime(2008,1,1,1,0,0,tz="GMT") -
>
2016 Mar 12
2
Regression in strptime
On 3/12/16 12:33 AM, peter dalgaard wrote:
>> On 12 Mar 2016, at 00:05 , Mick Jordan <mick.jordan at oracle.com> wrote:
>>
>> This is definitely obscure but we had a unit test that called .Internal(strptime, "1942/01/01", %Y/%m/%d") with timezone (TZ) set to CET.
> Umm, that doesn't even parse. And fixing the typo, it doesn't run:
>
>>
2009 Feb 10
3
ISOdatetime gives NA for a specific date
Hi all,
I am using ISOdatetime, and I just found out that when I do
ISOdatetime(1995,03,26,2,10,0) (or any other value under minutes or seconds)
I get NA
This does not happen with the same time in other dates, nor with different
hours in the same date.
Any hint why this happens?
Using R 2.8.1 under ESS/GnuEmacs under Windows XP
Pedro
--
View this message in context:
2012 Feb 03
3
strftime - Dates from Excel files
Hi
I have many excel files were the Date field was not declared as date,
so the dates look like this: 1/2/1978
I know that the format is day/month/year
How can I make R change this to Date format?
If I use strftime, I get wrong dates:
dataset=c("1/2/1978")
strftime(dataset,"%d/%m/%Y")
"19/02/0001"
Thanks in advance.
2009 Feb 10
2
Strange behaviour of ISOdatetime
Hi All,
I am watching a strange behaviour of ISOdatetime. In my work
computer, I get NA when I try to do
> ISOdatetime(1995,03,26,2,0,0)
[1] NA
But on other dates and/or times (hour) works OK
> ISOdatetime(1995,03,25,2,0,0)
[1] "1995-03-25 02:00:00 GMT"
In my home computer, I do not have this problem.
I am running the same version of R (2.8.1 patched) on both machines,
the
2009 Jan 19
1
maptools, sunriset, POSIX timezones
Hi ...
I wonder if anyone can provide some insight into why the first three
examples using the sunriset function (appended below, with results) give
the correct answer, but the fourth generates and error.
The first two use ISOdatetime with and without a time zone attribute,
and the sunriset function returns the correct sunset time.
The third and fourth adds 10 seconds to the ISOdatetime
2009 Jul 02
1
help exporting to excel via xlsReadWritePro
I’m trying to export a file from R to excel using the xlsReadWritePro function and I keep getting the error below. I get the same error when I use the oledatetime function. My current date format is mm/dd/yyyy, which is how I want it in excel. Also is there anyway to export different datasets to multiple sheets similar to the ods function in SAS?
<?xml:namespace prefix = o ns =
2012 Jan 20
2
Incorrect DateTime using ISOdatetime in R
Dear list,
I need to transform the DateTime of my GPS data from:
"666.1751" into "yyyy/mm/dd hh:mm:ss"
I have the following code:
d$Date <- ISOdatetime(2009, 1, 1, 0, 0, 0, tz = "GMT")+d$Date*(24*3600)
This gives me: 2010-10-29 04:12:09, which is wrong. It should be 2010-10-29
06:12:09
Another example:
418.3219 corresponds to: 2010-02-23 07:43:30, but it