Displaying 20 results from an estimated 300 matches similar to: "Using which function with xts"
2010 Jun 30
3
Embed function strips out date index
Hi,
I'm having especially hard time today and couldn't find any
clue/answer through the internet. ?I hope you can help.
I'm in a process of writing a script to estimate error correction
model, and I was following an example in Bernhard Pfaff's Analysis of
Integrated and Cointegrated Time Series with R. ?I have the following
price data:
> head(series,15)
?? ? ? ? ? PX_SETTLE
2011 Feb 22
1
image.plot results in different colors than legends
To R community:
I've been pulling my hair for the past few days over this issue now, and I
may be at the point where I just can't spot my error. So I thought to reach
out to the community and hope someone could kindly help me.
I'm trying to create a correlation matrix and plot it. However, I'm trying
to create a hybrid of correlation matrix from two different periods, say
2011 Jan 04
1
XTS : merge.xts seems to have problem with character vectors
Hi,
Please can you tell me what I am doing wrong. When trying to merge two xts
objects, one of which has multiple character vectors for columns...I am just
getting NAs.
> str(t)
POSIXct[1:1], format: "2011-01-04 11:45:37"
> y2 = xts(matrix(c(letters[1:10]),5), order.by=as.POSIXct(c(t + 1:5)))
> names(y2) = c(1,2)
> y2
1 2
2011-01-04 11:45:38
2008 Jun 16
2
Problems with dovecot deliver.
Hello all.
I am using dovecot 1.1.rc4.
Some of my mail deliver without errors. Other mail during its deliver
give next errors in logs:
Postfix log
Jun 16 18:34:17 postfix/local[2730]: A394E292002:
to=<dpoke at localhost.mail.com>, orig_to=<dpoke at localhost>, relay=local,
delay=3013, delays=3008/1.3/0/2.9, dsn=4.3.0, status=deferred (temporary
failure)
Jun 16 18:34:17
2011 Aug 23
0
Ideas for tricky subset of XTS object
Hi,
I have a very large XTS object. It is about 600,000 entries over 1 year time.
I would like to subset a specific piece, by "number of days" not a specific date.
The way I do it now is awkward. Would love to find a way to do this easier to generate a new object just containing the days I want.
---------------------------------------
dayEnds <- endpoints(dataset,
2009 Jul 02
0
convert xts vector into matrix
hi folks,
if i have an xts object as follows:
library(xts)
> dd <- as.POSIXct(strptime(c("2009-06-01 08:00:00", "2009-06-01
08:30:00","2009-06-01 09:00:00","2009-06-02 08:00:00", "2009-06-03
08:00:00", "2009-06-03 08:30:00"),"%Y-%m-%d %H:%M:%S"))
> a <- xts(1:6,dd)
> a
[[alternative HTML version
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 May 13
1
Math problem with xts objects
Hello,
I coming across a strange problem doing math on an xts object.
If I have an xts object of stock prices (perhaps 5 minute bars of open, high, low,close) and want to do some math, the results fail.
For example:
d$close[10] - d$open[10] works perfectly
d$close[10] - d$open[9] fails. I just get an answer of "numeric(0) Index: numeric(0)".
My guess is that xts is breaking
2009 Jun 01
0
Converting data.frame to xts
I have a data.frame object and I don't really understand how to made an xts
class out of it.
Consider:
> x <- data.frame(datetime, ltp, ltv)
> head(x, 2)
datetime ltp ltv
1 2009-05-05 07:30:01.604 899 1
2 2009-05-05 07:30:01.963 899 15
> class(x$datetime)
[1] "POSIXt" "POSIXct"
#This works for only one column and why do I lose the name
2011 Jan 11
1
Interpolate xts
Hello,
I have a xts object, I would like to fill the NA with linear
interpolated data. Can anyone please help.
> str(zz)
An ‘xts’ object from 2010-11-24 15:59:29 to 2010-11-24 16:00:00 containing:
Data: num [1:23401, 1] 312 312 312 312 312 ...
Indexed by objects of class: [POSIXct,POSIXt] TZ:
xts Attributes:
List of 2
$ src : chr "datafeed"
$ updated: POSIXct[1:1],
2011 Nov 09
1
Are there equivalents to xblocks or rect that can be used with plot.xts?
I would like to add vertical shaded blocks in plot.xts graphs (like recession
periods in FRED graphs)
The reason I use plot.xts instead of plot.zoo is that I like the fact that
the grid is automatically aligned with major ticks in plot.xts.
xblocks() and rect() do not seem to work with plot.xts (only with plot.zoo).
Are there any alternative methods that work with plot.xts?
Thanks.
--
View
2013 Mar 16
2
Find NA in xts object
Hi to all, i'm new to R
I have an xts object.
Can i find:
a) how many NA are in my object ?
b) eventually where (in which line) they are
Thank you
2009 Jun 21
1
Need help installing xts package
Hi,
I am trying to install package xts. I am using OPENSUSE 11 64 bit. When I
invoke:
install.pacakges("xts",dependencies=T)
I received a lot of "ERROR: compilation failed for package" errors when R
tries to install xts dependencies. I do not understand this behavior.
I notice one thing. It complains.
ERROR: compilation failed for package 'Hmisc'
** Removing
2011 Jan 23
1
Plotting multiple xts/zoo time series on a single plot.
So I've got a 154 column wide xts time series object and I want to plot the
154 series on a single plot and have the added benefit of the time series
dates on the x axis.
Any suggestions for plotting functions, maplot works but does not give dates
on the axis and I can't seem to get plot to give me more than one series.
Nick
[[alternative HTML version deleted]]
2007 Feb 14
0
xts.dvs function in fCalendar
There is a function in the fCalendar package called xts.dvs but I m
unable to see the code inside the function.
Is this common with functions in the fCalendar package or maybe there is
something else that I have to
do first or use the colon colon command in some manner I want to see
the function coee because I want to see the detials
Of the algorithm used in the function. I am on linux and my
2010 Jan 14
0
chron, xts and zoo
dear r folks
i am a bit puzzled about how to use chron as an index xts and why it differs
from zoo.
in this example, why can i index zoo but not xts
x<-1:23
time.of.day <- times(paste(x,":0:0",sep=""),format="h:m:s")
day <- dates("4/8/90")
period <- chron(dates=day,times=time.of.day)
xts(1:23,period)
zoo(1:23,period)
i suspect it might be to
2010 Apr 11
0
converting a ts object to an xts object
Dear R People:
This is probably is very simple question. I have a monthly time
series, ibm$ts , that I would like to convert to a quarterly series.
I know that I could use "aggregate", but I am interested in the
to.quarterly conversion, please.
Here is my example:
> str(ibm$ts)
Time-Series [1:144] from 1998 to 2010: 43.7 46.3 46 51.4 52.2 ...
> tsp(ibm$ts)
[1] 1998.000 2009.917
2016 Apr 18
0
Add a vertical arrow to a time series graph using ggplot and xts
Hi,
I am trying to add a vertical arrow (from top to bottom or from bottom
to up) to a time series plot using ggplot2 and xts. It seems that the
vertical line command "geom_vline" does not work for this purpose (Correct
me if I am wrong). I try the command "geom_segment" as follows, but I got
an error message at the last line "Error: Invalid input: date_trans works
2016 Apr 20
0
Add a vertical arrow to a time series graph using ggplot and xts
Please see updates to df2 assignment as shown below.
library(xts) # primary
#library(tseries) # Unit root tests
library(ggplot2)
library(vars)
library(grid)
dt_xts<-xts(x = 1:10, order.by = seq(as.Date("2016-01-01"),
as.Date("2016-01-10"), by = "1 day"))
colnames(dt_xts)<-"gdp"
xmin<-min(index(dt_xts))
2010 Dec 06
1
as.xts error
Dear all,
I am using the as.xts function to transfer a data frame to the xts
The following is the code and result:
a<-read.csv("price.csv")
a$Date<-as.POSIXct(a$Date)
str(a)
'data.frame': 15637 obs. of 2 variables:
$ Date : POSIXct, format: "2010-01-04 09:45:01" "2010-01-04 09:45:02"
"2010-01-04 09:45:03" ...
$ bid_hsi: int 21850