Displaying 20 results from an estimated 10000 matches similar to: "How to format data for time-series analysis"
2007 Nov 05
2
its does not recognize POSIXct w/ both time and Date?
Hello all,
I'm getting much further with my time-series work, but still getting
into some problems.
I'm using POSIXct time format with both date and time.
I'd like to use that in an its object but It seems its only processes
the date part of the POSIX time stamps:
BMU_its_data <- its(data[BMUindex,2-4],dates=data[BMUindex,1])
Error in `row.names<-.data.frame`(`*tmp*`,
2008 Feb 05
2
using image to show RGB image data ?
Hello all,
I'm now using image() to show image data (in my case dumps of SOM
weights) but would like to show RGB colour data, not just single "z"
colour values.
I've currently been using seq() to skip 4 values, so I can show the R, G
or B channels separately as "z". But is there a way I can show all three
channels simultaneously as a proper colour image?
Thanks,
B.
2008 Jan 11
2
How to calculate the mean of all values in a list or dataframe
Hello all,
I've scoured the archives and google and I can't figure out how to
amalgamate a set of vectors of differing lengths in such a way as I can
calculate the mean easily.
The following dummy example contains vectors of length 1, but my data
has vectors of various lengths.
R> test = list(); for(i in 1:5) {test = append(test, i)}
R> test
[[1]]
[1] 1
[[2]]
[1] 2
[[3]]
[1] 3
2008 Feb 21
2
jpeg() creating empty files with qplot() in a loop
Hello all,
I'm stuck with a strange issue with writing jpegs of plots to a folder
in a loop.
This works:
for (step in 1:length(steps)) {
jpeg(filename=paste("frame_",sprintf("%05d",step),".jpg",sep=""))
plot(steps[[step]])
dev.off()
}
But if I use qplot to generate the plot (which is my aim):
for (step in 1:length(steps)) {
2005 Dec 05
1
unified meta-data handling ogg/theora/vorbis
Hey all,
I'm working on a media-database art project that basically stores a bunch of sound and video files, which are then navigated based on meta-data. I'm not sure where to start asking these, questions, here seemed like a good start.
So I was thinking I should use an open format, like ogg/vorbis/theora. I also thought, will all that coll meta-data stuff in ogg I should be able to
2008 Apr 17
1
Moving from Splus to R: irregular and regular time series
Dear R developpers,
I am a user of Splus since many years and I have developped lots of
functions to plot graph of data and model results of irregular or
regular times series.
In Splus regular times series are created using the rts function and
irregular time series using the its functions. In both cases, times is
given as a numeric vector.
There is no problem in plotting a regular and an
2008 May 10
1
irregular time series and multiple, overlaid plots
I am new to R and am trying to solve the following problem:
I have a data file containing tick-by-tick, millisecond level prices for
some stocks. I have another file or two containing orders and trades,
again, with millisecond time-stamps. Both of these files are irregularly
spaced and the time stamps are in an iso format (<date>
<time>.<millisecond>)
I would like to create a
2008 Jun 19
1
How can I shade the background area of a zoo time series object between specific dates?
Dear list members,
How can I shade the background area of a zoo time series object between
specific dates?
eg.
library(tseries)
library(zoo)
SP500<-get.hist.quote("^GSPC", start = "1990-01-01", quote =
"Close")
plot(SP500)
How can I produce the same plot but with a (say) red background between
2007-04-12
and
2008-05-14
?
2011 Mar 24
2
Help with creating a ts (time series) object with daily sampling values
Hi All,
I have a data set of daily measurements of river flow. I would like to
create a "ts" object from this data.
Here's a sample data set:
date <- as.Date(c(1:300), format="%Y")
year=as.numeric(format(date, format = "%Y"))
month=as.numeric(format(date, format = "%m"))
julianday=as.numeric(format(date, format = "%j"))
2011 Oct 27
2
Simple time series question with zoo
New user here. My goal is pull daily averages from a long dataset.
I've been working with some code I got from this list from
https://stat.ethz.ch/pipermail/r-help/2009-March/191302.html
The code how I have been using it is as follows:
library(zoo)
library(chron)
DB<-read.table("/Users/me/Desktop/R/data.csv", sep=",", header=TRUE, as.is
=TRUE)
z<-zoo(LTER6$temp,
2006 Feb 15
2
Plotting two 3-dimensional time series in a 3 x 2 plot - alternatives to par(mfrow())
I am trying to plot two 3-dimensional time series in one window (such that there will be 3 rows and 2 columns). For zoo and ts objects the par(mfrow...) option does not work. I can get xyplot to make the plots, but data are on widely different scales in the three dimensions, and xyplot uses the same scale on all y-axis which means that in some dimensions the curves will be almost horizontal lines.
2011 Mar 02
1
Create a zoo/xts Time Series with Millisecond jumps
Is there a easy way to create the time index for a zoo/xts object for every
100 milliseconds.
eg. time Index would be:
10:00:00:100
10:00:00:200
10:00:00:300
10:00:00:400
I am looking to build an empty zoo/xts object with time index from 10am to
3pm, index jumps by 100ms each row.
Thanks,
Chris
--
View this message in context:
2013 Apr 07
1
importing and merging many time series
Hello.
I've got many (5-20k) files with time series in a text format like this:
1359635460 2.006747
1359635520 1.886745
1359635580 3.066988
1359635640 3.633578
1359635700 2.140082
1359635760 2.033564
1359635820 1.980123
1359635880 2.060131
1359635940 2.113416
1359636000 2.440172
First field is a unix timestamp, second is a float number. Its
2011 Nov 01
1
Multiple time series with zoo
Thanks for everyone's input so far, it is greatly appreciated. But I've got
one last task I could use some advice on
Here are the first few lines of my data set:
site,time_local,time_utc,reef_type_code,sensor_type,sensor_depth_m,temperature_c
06,2006-04-09 10:20:00,2006-04-09 20:20:00,BAK,sb39, 2, 29.63
06,2006-04-09 10:40:00,2006-04-09 20:40:00,BAK,sb39, 2, 29.56
06,2006-04-09
2004 Oct 04
2
Identifying time series
Hello,
I am currently attempting to introduce R at my company and am trying to
import time series data from a text file into R to graph. The format of the
text file is in date, data (e.g., 20040929 3.361). My problem is that I do
not know how to get R to recognize the first column as a business date
series. Or at the very least, I am unable to find a function that will grap
the second column
2004 Nov 06
1
calendar-based time-series in R
Hello,
I am trying to switch to R from S-PLUS 6.1, and one problem I am having is
using R for manipulation of calendar-based time-series. In S-PLUS, I
commonly use the functions timeSequence(), timeDate(), and timeSeries() to
align/average/aggregate data; and I also do a lot of plotting of
time-series data (with calendar-based labels on the x-axis).
I was wondering if anyone is familiar with
2005 Apr 12
1
Time series misalignment
This maybe a basic question, but I have spent several hours
researching and I could not get an answer, so please bear with me. The
problem is with time series in the package tseries. As the example
below shows, the time series can get misaligned, so that bad results
are obtained when doing regressions. I found a way to do this
correctly, but I find it rather cumbersome. My question is: is there a
2000 Feb 01
1
plotting spectrum of time series etc
Hi, everyone, I tried to use "spectrum()" or "spec.pgram()" to get a
periodogram of a time series but they didn't work.
Even the examples given in the help file didn't work (all with the same
error message, below). And the 'ts'ibrary was
loaded with "library(ts)" or "library("ts"). I also tried
library(tseries) but got the same problem.
2008 Aug 02
2
Gaps in time series.
I like the fact that in subtracting two time series objects that there is some effort to align the series. So if I have a time series of that begins at 1 and one that begins at 2 a subtraction operation makes sure that the proper values are subtracted. But I am unclear as to the best way to build a time series with "holes". say that I have data for "day" 1,2,6,7 in one time
2007 Nov 02
1
R timeDate does not allow seconds?
Hello, Sorry if anyone gets this message twice, as my mailserver may not
be working.
Thanks for your response. Your idea makes a lot of sense to me, but I've
been unable to get seconds to work.
I ended up with this format finally:
"2007-10-31_16:20:22"
Problem is I am unable to get it recognized as a date using timeDate():
R>