similar to: How to get the date of specific value within a zoo object?

Displaying 20 results from an estimated 3000 matches similar to: "How to get the date of specific value within a zoo object?"

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:
2010 May 17
1
Isn't aggreate.zoo supposed to work with POSIXct (zoo/TTR/xts issue)?
library(xts) library(TTR) ndx = getYahooData("^NDX") aa = ndx$Close bb = aggregate(aa, as.yearweek, tail, 1) The last operation takes forever, and then the bb dates are messed up. The following produces the desired result: time(aa) = as.Date(time(aa)) bb = aggregate(aa, as.yearweek, tail, 1) The index of ndx and aa is of POSIXct (as reported by is(time(ndx))) , which apparently
2011 May 28
1
How to do operations on zoo/xts objects with Monthly and Daily periodicities
Is there an elegant way to do operations (+/-/*/ / ) on zoo/xts objects when one serie is monthly (end of month) and the other daily (weekdays only) - typically a monthly economic indicator and a stock index price? Thanks, TDB -- View this message in context: http://r.789695.n4.nabble.com/How-to-do-operations-on-zoo-xts-objects-with-Monthly-and-Daily-periodicities-tp3558081p3558081.html
2010 Apr 28
1
Strange zoo behaviour, possible bug?
Hi all, I bumped into this awkward zoo behaviour. I'd be half tempted to call it a bug, what do you think? It's annoying to work around it :( I wonder if this was the behaviour of older zoo versions, I can't remember coming across this sort of thing... > version _ platform i386-pc-solaris2.10 arch i386 os solaris2.10 system i386,
2017 Oct 06
2
Time series: xts/zoo object at annual (yearly) frequency
Hi, I'd like to make a time series at an annual frequency. > a<-xts(x=c(2,4,5), order.by=c("1991","1992","1993")) Error in xts(x = c(2, 4, 5), order.by = c("1991", "1992", "1993")) : order.by requires an appropriate time-based object > a<-xts(x=c(2,4,5), order.by=1991:1993) Error in xts(x = c(2, 4, 5), order.by =
2012 Nov 27
2
Books for fully understanding internal logics on some packages(quantmod, xts, zoo and chron)
Hello, I'm very interested in using financial time series data, but I'm a beginner of R programming. I'd like to fully understand internal logics on several time-series related packages such as quantmod, xts, zoo, chron, etc. So, I read some books, 'R Cookbook' and 'Art of R Programming' and another simple tutorials. But I still can't understand grammars of the
2009 Aug 12
3
Zoo and numeric data
Hi, I have a csv file with different datatypes: 2009-01-01, character1, 10, 20.1 2009-01-02, character2, 11, 21.1 (I have attached the file to this post) I read this file with read.zoo as I want a zoo/xts timeseries: > t = read.zoo("./data.txt", sep=",", dec = ".", header=FALSE) If I look at the zoo data all integer/numeric columns are read as character: >
2010 Apr 18
4
confused with yearmon, xts and maybe zoo
R-listers, I am using xts with a yearmon index, but am getting some inconsistent results with the date index when i drop observations (for example by using na.omit). The issue is illustrated in the example below. If I start with a monthly zooreg series starting in 2009, yearmon converts this to "Dec-2008". Not such a worry for my example, but strange. Having converted to xts, i drop
2012 Jan 24
1
problems with rollapply {zoo}
Here is a relatively simple script (with comments as to the logic interspersed): # Some of these libraries are probably not needed here, but leaving them in place harms nothing: library(tseries) library(xts) library(quantmod) library(fGarch) library(fTrading) library(ggplot2) # Set the working directory, where the data file is located, and read the raw data
2011 Jul 22
2
Picking returns from particular days of the month from a zoo object
Hello, I would like to implement a "turn-of-the-month' trading strategy in R. Given a daily series of stock market return data as a zoo object, the strategy would go long (buy) four trading days before the end of the month, and sell the third trading day of the following month. How can I select these days, particularly the fourth day before and the third day after the turn of the
2004 Jan 06
4
Asterisk feature list: spreadsheet
http://www.loligo.com/asterisk/misc/Presentations/Asterisk-features-20040106.xls I had been asked a while ago to put together a short Excel spreadsheet listing many of the "common" features of Asterisk as compared to a typical PBX. Many PBX vendors supply an exhaustive list of their features, and I figured I'd take as many of the unique features as others had offered, and put
2012 Dec 02
2
How to calculate mean of every nth time series data with zoo or xts ?
Hello, I have 1-minute time series stock data and I'd like to calculate mean of every n-th candle data of m-days. result = c(mean of 1th data, mean of 2nd data, ...) mean of 1th data = (1th data of 2012-1-1 + 1th data of 2012-1-2 + 1th data of 2012-1-3) / 3 mean of 2nd data = (2nd data of 2012-1-1 + 2nd data of 2012-1-2 + 2nd data of 2012-1-3) / 3 ... Could you let me know the fastest
2011 Jan 29
1
Basic Help with Zoo objects and trading days
All, I have been just recently working with zoo objects for trading systems. Can someone please help with these basic questions? Given a daily time series downloaded using get.hist.quote() from the tseries package, ie...... startDate= as.Date("2000-01-01") endDate= as.Date("2011-01-29") frequency= 'd' s= get.hist.quote('IWF', start= startDate, end=
2016 Jul 27
3
[RFC] One or many git repositories?
Thanks for elaborating, Chris. > Case Study 1 - Simple development on a sub-project I explicitly addressed this workflow in my original e-mail. I know it was a while ago, but it sounds like it may be worth a read if you haven't checked it out. In the mail I described how to use sparse checkouts to create a repository structure that functions virtually identically to what you have today.
2010 Oct 25
4
zoo.read intraday data
Hello all, I'm trying to use zoo.read but can't figure out how to deal with the time format. (example below) would be nice if someone could help. best regards, Immanuel --------------------------- L <- "Date,Time,Open,High,Low,Close,Up,Down 05.02.2001,00:30,421.20,421.20,421.20,421.20,11,0 05.02.2001,01:30,421.20,421.40,421.20,421.40,7,0
2006 Oct 28
2
subsetting, aggregating and zoo
Hi, Having an zoo object I can subset it to obtain the days where I have the values within some range: is.zoo(z) TRUE subset(z[,1], z[,1]>=5 & z[,1]<= 10) #Yields: Year(day) 1988(13) 1988(14) 1988(16) 1988(20) 1988(21) 1988(22) 1988(25) 1988(26) 7.973946 9.933518 7.978227 7.512960 6.641862 5.667780 5.721358 6.863729 1988(27) 1988(28) 1988(29) 1988(30) 1988(32)
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]]
2008 Oct 22
1
R 2.8.0 qqnorm produces error with object of class zoo?
Dear list-reader, by running the following script: library(zoo) sessionInfo() search() packageDescription("zoo") data(EuStockMarkets) dax <- as.zoo(EuStockMarkets[1:10, "DAX"]) daxr <- diff(log(dax)) identical(as.vector(qnorm(daxr)), qnorm(coredata(daxr))) qqnorm(coredata(daxr)) qqnorm(daxr) qqnorm() produces an error: > qqnorm(daxr) Fehler in if (xi == xj) 0L
2012 Oct 01
3
merge.zoo returns unmatched dates
Sorry for the lack of reproducible data, but this seems to be a problem inherent to my dataset and I can't figure out where the issue is. I have several data frames set up as a time series with identical POSIXct date formats. If I keep the original data in data frame format and merge them using base merge- everything is perfect and everyone is happy. If I transform the data frames to zoo
2009 Dec 22
1
Using zoo() to aggregate daily data to monthly means
I am trying to get monthly means for a daily data series using zoo(). I have found an odd problem, that seems to be caused by zoo()'s handling of leap years. Here's my R script with 2 methods (freq=365, 366) for aggregating the daily data to monthly series: library(zoo) J_link <- "http://www.ijis.iarc.uaf.edu/seaice/extent/plot.csv" JAXA_data <- read.table(J_link,