Displaying 20 results from an estimated 2000 matches similar to: "simple read in with zoo using POSIXlt"
2012 Mar 22
4
read.zoo - combining two columns with date and time respectively into one index column?
I have three columns in my raw data: date, time, and dry bulb temperature:
http://r.789695.n4.nabble.com/file/n4495326/weathDataSDCoron.txt
weathDataSDCoron.txt
The date format is %Y%m%d and the time format is %H:%M. Any ideas on how to
read it in such that it looks at the first two columns and then merges it
into one column combining both the date and time?
--
View this message in context:
2012 Mar 05
2
Filter/Ceiling for unwanted data - zoo
Here's my script:
http://pastebin.com/zx3TCtXg
I want to draw attention to the code block where the read in of the raw data
is located. Is there a function that filters out unwanted data with respect
to a ceiling limit. For example, I want to remove any value over 500 kW in
the rawCool variable. Any ideas where to go with that? I figure it would be
an argument within read.zoo or an external
2012 Feb 28
1
aggregating specific parts in zoo index column to perform sliding average
Here's my code:
http://pastebin.com/0yRxEVtm
The important parts are uncommented and should be easy to find using the
link above. For the following line of code, I plan on looking for a way to
offset it up 7 rows so that the 15 minute timestamp would be considered the
"median" of the subset being averaged to find the mean:
avgCool = aggregate(intCool, trunc(time(intCool),
2012 Mar 20
3
Wrong output due to what I think might be a data type issue (zoo read in problem)
Here's the small scale version of the R script:
http://pastebin.com/sEYKv2Vv
Here's the file that I'm reading in:
http://r.789695.n4.nabble.com/file/n4487682/weatherData.txt weatherData.txt
I apologize for the length of the data. I tried to cut it down to 12 lines,
however, it wasn't reproducing the bad output that I wanted to show.
The problem is that my whole data set
2012 Apr 04
2
Trying to merge new data set to bottom of old data set. Both are zoo objects.
Here is the data I'm working with:
http://r.789695.n4.nabble.com/file/n4530888/new.txt new.txt
http://r.789695.n4.nabble.com/file/n4530888/old.txt old.txt
My code is here:
http://pastebin.com/9jjs6Ahr
I'm looking for away to simply attach the new.txt to the bottom of old.txt
through R, else I'll just throw it in Excel to do some preprocessing. I've
looked into using merge,
2012 May 02
5
uneven vector length issue with read.zoo?
I truncated and simplified my code and the read in data that I'm working with
to isolate the issue. Here is the read in data and R script respectively:
http://r.789695.n4.nabble.com/file/n4604287/test.csv test.csv
http://pastebin.com/rCdaDqPm
Here is the terminal/R shell output that I hope the above replicates on your
screen:
> source("elecLoad.r", echo = TRUE)
> #Load
2012 Mar 14
1
logical test not functioning correctly on zoo series...what the hell?
Here's the raw data I'm working with (will be available temporarily):
http://dl.dropbox.com/u/41922443/dataout_2471_843.csv
Next, here's the code I want to impose (error that I'm seeing SHOULD
reproduce on your shell when script is executed...btw using Ubuntu Linux
11.10 if that makes a difference):
http://pastebin.com/LDNw8UT0
The issue specifically is the last line of code in
2012 Feb 26
2
question about user written function (newb question)
Quick newb question about R relating to the line of code below:
rawCool = read.zoo("cooling.txt", FUN = as.chron, format = "%m/%d/%Y %H:%M",
sep = "\t", aggregate = function(x) tail(x, 1))
I'm wondering what the specifics are for the argument where it has
"aggregate = function(x) tail(x, 1)". I understand that it removes the last
row of
2011 Feb 04
2
terribly annoying bug with POSIXlt : one o'clock is midnight?
Apparently, as.POSIXlt takes one o'clock as the start of the day :
> as.POSIXlt(0,origin="1970-01-01")
[1] "1970-01-01 01:00:00 CET"
> as.POSIXlt(0,origin="1970-01-01 00:00:00")
[1] "1970-01-01 01:00:00 CET"
> as.POSIXlt(0,origin="1970-01-01 23:59:59")
[1] "1970-01-02 00:59:59 CET"
Cheers
--
Joris Meys
Statistical
2016 Dec 06
1
segfault with POSIXlt zone=NULL zone=""
Hi Joshua,
Thank you for minimizing my test case.
> > Hope I'm not doing something illegal...
> >
> You are. You're changing the internal structure of a POSIXlt object
> by re-ordering the list elements. You should not expect a malformed
> POSIXlt object to behave as if it's correctly formed. You can see
> it's malformed by comparing it's
2012 Sep 05
2
POSIXlt and daylight savings time
I have a data frame that contains dates, but when I use as.POSIXlt() I lose
the hours on all records. I traced this down to a particuar hour which
causes the issue...
> as.POSIXlt('2004-10-31 02:00:00')
[1] "2004-10-31"
> as.POSIXlt('2004-10-31 03:00:00')
[1] "2004-10-31 03:00:00"
How do I tell as.POSIXlt() to ignore daylight savings and just convert to
2018 Aug 31
2
Segfault when performing match on POSIXlt object
Hi All,
I found a possible unexpected behavior when performing match/%in% on
POSIXlt objects, e.g. :
d <- as.POSIXlt('2018-01-01')
# match(<anything>,<POSIXlt>) --> segfault
match(0,d)
# consequently also this fails :
0 %in% d
REPORTED ERROR ON LINUX:
*** caught segfault ***
address 0x16dc2, cause 'memory not mapped'
Verified on 3.5.0 on linux,
2010 Jul 14
1
POSIXlt error for 1982-01-01
Hi, I am encountering a strange error in POSIXlt... anyone got a clue?
> as.POSIXlt("1982-01-01")
Error in as.POSIXlt.character("1982-01-01") :
character string is not in a standard unambiguous format
> as.POSIXlt("1992-01-01")
[1] "1992-01-01"
> as.POSIXlt("1972-01-01")
[1] "1972-01-01"
> as.POSIXlt("1962-01-01")
2009 Jan 28
2
length of POSIXlt object (PR#13482)
The length() of a POSIXlt object is given as 9 regardless of the actual
length. For example:
> make.date.time
function (year=c(2006,2006),month=c(8,8),day=2:5,hour=13,minute=45)
{# convert year, etc., into POSIXlt object
#
d=as.character(make.date(year,month,day))
t=paste(hour,minute,sep=":")
as.POSIXlt(paste(d,t))
}
> t=make.date.time()
> t
[1] "2006-08-02 13:45:00"
2010 Oct 05
2
Subset POSIXlt Field
Hello All
I, for the life of me, can't figure out to subset my dataframe by my Date
field. The field has been formatted as POSIXlt.
str(wild)
......
$ Date : POSIXlt, format: "2010-05-28" "2010-05-28" "2010-05-28" ...
This doesn't work:
test <-subset(wild,ID=="2830" & Date=="2010-08-17")
which returns:
<0 rows> (or
2010 Jul 14
1
POSIXlt error
Hi, I'm encountering a strange error in POSIXlt... anyone got a clue on
this?
> as.POSIXlt("1982-01-01")
Error in as.POSIXlt.character("1982-01-01") :
character string is not in a standard unambiguous format
> as.POSIXlt("1992-01-01")
[1] "1992-01-01"
> as.POSIXlt("1972-01-01")
[1] "1972-01-01"
>
2011 Jan 30
4
Extract time only from POSIXlt object
How can I extract only the time component from an POSIXlt object?
For example if I try the following it still returns both the date and
time...
>as.POSIXlt(tr.date[1])
[1] "2010-10-18 21:46:53"
>as.POSIXlt(tr.date[1],"%H:%M:%S")
[1] "2010-10-18 21:46:53"
round and trunc don't help... is there an "as.Time" equivalent to as.Date
?
Thanks,
2008 Feb 17
1
How to make a vector/list/array of POSIXlt object?
Hi Guys,
I'm cooking up my time series code. I want a data frame with first column as timestamp in POSIXlt format.
I hit on this the problem of how to create an array/list/vector of POSIXlt objects. Code is as follows
> dtt=array(dim = 2)
> t=as.POSIXlt( strptime("07/12/07 13:20:01", "%m/%d/%Y %H:%M:%S",tz="GMT"))
> dtt
[1] NA NA
> t
[1]
2016 Dec 06
1
segfault with POSIXlt zone=NULL zone=""
>>>>> Joshua Ulrich <josh.m.ulrich at gmail.com>
>>>>> on Tue, 6 Dec 2016 09:51:16 -0600 writes:
> On Tue, Dec 6, 2016 at 6:37 AM, <frederik at ofb.net> wrote:
>> Hi all,
>>
>> I ran into a segfault while playing with dates.
>>
>> $ R --no-init-file
>> ...
>> >
2011 Aug 07
1
all.equal doesn't work for POSIXlt objects
Hi all,
following sample code illustrates the problem :
Date1 <- Date2 <-
as.POSIXlt(seq.Date(as.Date("2010-04-01"),as.Date("2011-04-01"),by='day'))
identical(Date1,Date2)
all.equal(Date1,Date2)
identical() gives the correct answer. As there is no all.equal method
for POSIXlt objects, all.equal.list is used instead. Subsetting using
[[]] doesn't work