Displaying 20 results from an estimated 4000 matches similar to: "what does .indexDate() do - R::xts"
2012 Aug 01
1
timeBasedSeq stumbles over the year 2038 (xts package)
I have the following problem:
As expected I obtain
timeBasedSeq( 2037/2037)
[1] "2037-01-01"
>
However if I do the same for 2038 I get
timeBasedSeq( 2038/2038)
[1] "2038-01-01" "2039-01-01"
I get the same strange result if I use later years or any interval that contains 2038:
timeBasedSeq( 2037/2039)
[1] "2037-01-01" "2038-01-01"
2011 Mar 04
4
xts POSIXct index format
Hi,
I cannot figure out how to change the index format when displaying POSIXct
objects.
Would like the xts index to display as %H:%M:%OS3 when doing viewing the xts
object.
Think I am missing the obvious.
Cheers,
Chris
--
View this message in context: http://r.789695.n4.nabble.com/xts-POSIXct-index-format-tp3336136p3336136.html
Sent from the R help mailing list archive at Nabble.com.
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
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
2011 Jul 30
1
Plot.xts - how to change the x-axis labels to show weekly labels.
Dear R-users
I am new to R and struggling not to bother the list with silly questions.
I read the documentation on xts and searched for some examples over the
internet on how to use plot.xts.
The xts object is as follows
dataxts : An 'xts' object from 2010-06-27 to 2010-08-05 containing:
Data: num [1:56161, 1:14] 74 74.2 74.2 74.1 73.9 ...
Indexed by objects of
2012 Mar 04
1
Store vectors as values in xts time-series object
Hi R programmers,
I have stumbled across what seems a very simple problem. My goal is to
create a xts time series object which contains vectors as values. In
other words, I try to create something like this:
2009-01-01 => c('aa', 'bb', 'dd')
...
2010-02-01 => c('mm')
I have figured out parts of separately. Here's what works (new xts
time-series with
2012 Dec 18
1
How to draw frequency domain plot with xts time series data
Hello,
I'd like to convert the below time-series data with fft or wavelet related function and plot it.
Could you let me know
1. How to convert xts data frame format to list format ?
2. How to plot fft or wavelet diagram ?
Here is the data :
> class(zc)
[1] "xts" "zoo"
> str(zc)
An ‘xts’ object from (10/15/12 09:00:00) to (10/15/12 15:15:00)
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],
2012 Oct 16
1
XTS Subsetting question (noob)
Hi,
How can an xts object be subset using a date in a variable?
E.g. in below, what is the right syntax for Q to get the same value as P?
Obviously the syntax shown below doesnt work...
V is an xts object.
d = "2007-01-01"
P <- V['2007-01-01/']
Q <- V['d/']
Thanks,
J
--
View this message in context:
2012 May 29
2
Converting to XTS loses data.frame structure
Hello,
I noticed something odd when working with data frames and xts objects.
If I read in a CSV file, R creates a nice data.frame. This works well.
If I then convert to an XTS object, I see that all the values in the data are now quoted. My data is a mix of numeric and character. This is usually seen when converting a data.frame to a matrix, as R will treat all the data as the same class.
2012 May 22
1
Quantmod, Xts, TTR and Postgresql
Hi Everyone,
I'm currently using the latest build of R and R-Studio server (both are
amazing products)
I'm still very new to this but I came across this issue:
I'm trying to do a select from postgres and put the data into and xts
object like so:
# Libs
library('RPostgreSQL') # http://code.google.com/p/rpostgresql/
library('quantmod')
library('TTR')
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
2011 Oct 03
1
xts/time-series and plot questions...
Hello,
I'm a complete newbie to R. Spent this past weekend reading The Art of R Programming, The R Cookbook, the language spec, Wikis and FAQs. I sort-of have my head around R; the dizzying selection of libraries, packages, etc? Not really. I've probably missed or failed to understand something...
I have very a simple data set. Two years (ish) of temperature data, collected and
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]]
2010 Nov 05
1
as.xts
hey
I am trying to turn a dataframe into xts with the function:
as.xts,
but it returns the error:
Error in as.POSIXlt.character(x, tz, ...) :
character string is not in a standard unambiguous format
could someone give me some pointers please
the data is coming from a spreadsheet via the excel, and has 5 columns
of data (date (with the date and time), open, high, low, close) (excel
format)
ela
2011 Jul 17
1
FOMULATING TIME SERIES DATA FROM DATA FRAME
I am estimating Value at Risk using PerfomanceAnalytics package. The?variables are stored in a data frame. I formated the data variables using zoo() and as.xtx() but it is not working. The working example is below.
##########################################################?
reguire(zoo)
require(PerformanceAnalytics)
reguire(xts)
?
year<- c(1991-12-30, 1992-12-30, 1993-12-30, 1994-12-30)
R1
2011 Mar 17
1
possible problem with "endpoints"?
Dear R People:
Hello again!
I found something unusual in the behavior of the "endpoints" function
from the xts package:
> x1 <- ts(1:24,start=2008,freq=12)
> dat <- seq(as.Date("2008/01/01"),length=24,by="months")
> library(zoo);library(xts)
> x2 <- zoo(1:24,order=dat)
> #Here is the surprise:
> endpoints(as.xts(x1),'quarters')
2017 Oct 18
1
Problem with tq_mutate_xy() from the tidyquant package
I was able to reproduce the problem with this self-contained example. Maybe
it could be reproduced with an even smaller one ...
library(tidyquant) # Loads tidyverse, tidyquant, financial pkgs, xts/zoo
library(xts)
dtV <- as.Date("2017-01-01") + 1:100
locL <- list( foo=xts(rnorm(100), order.by=dtV), bar=xts(rnorm(100),
order.by=dtV) )
fullXts <- do.call(merge,locL)
smallXts
2016 Apr 06
2
Is this a bug in quantmod::OpCl?
OpCl works on xts objects but not on quantmod.OHLC objects. Is this a bug?
Example error:
x.Date <- as.Date("2003-02-01") + c(1, 3, 7, 9, 14) - 1
set.seed(1)
x <- zoo(matrix(runif(20, 0, 1), nrow=5, ncol=4), x.Date)
q <- as.quantmod.OHLC(x,c("Open","High","Low","Close"))
# error
OpCl(q)
#> Error in `colnames<-`(`*tmp*`, value =
2011 May 13
2
More effective calculation for loop
I am getting confused in how to use R effectively. Below is the example that I
would like to optimize, which is basically a loop. In its current version it
takes about 20 seconds to run. I have looked at the apply function and but
didn't seem to get it to work. I am sure this is relatively easy to show me a
better version for someone who has done this before. For some reason I seem to