similar to: Results of applying na.omit on zoo object

Displaying 20 results from an estimated 20000 matches similar to: "Results of applying na.omit on zoo object"

2011 Sep 13
1
ZOO: Learning to apply it to my data
I have read ?zoo but am not sure how to relate the parameters (x, order.by, frequency, and style) to my data.frame. The structure of the data.frame is 'data.frame': 11169 obs. of 4 variables: $ stream : Factor w/ 37 levels "Burns","CIL",..: 1 1 1 1 1 1 1 1 1 1 ... $ sampdate: Date, format: "1987-07-23" "1987-09-17" ... $ param : Factor w/
2012 Jun 06
2
package zoo, function na.spline with option maxgap -> Error: attempt to apply non-function?
Hello, I'm trying to use na.spline (package zoo) to fill some missing data in a time series. this works fine, however, if I apply the 'maxgap' argument, I always get the error: <------ Error in na.spline.vec(x., coredata(object.), xout = xout., ...) : attempt to apply non-function ------> I couldn't find a similar error for this case in the mailing lists and zoo vignette,
2011 Aug 12
2
rollapply.zoo() with na.rm=TRUE
Hi. I'm comparing output from rollapply.zoo, as produced by two versions of R and package zoo. I'm illustrating with an example from a R-help posting 'Zoo - bug ???' dated 2010-07-13. My question is not about the first version, or the questions raised in that posting, because the behaviour is as documented. I'm puzzled as to why na.rm no longer is passed to mean, i.e. why
2012 Jul 02
2
using "na.locf" from package zoo to fill NA gaps
Hi everybody, I have a small question about the function "na.locf" from the package "zoo". I saw in the help that this function is able to fill NA gaps with the last value before the NA gap (or with the next value). But it is possible to fill my NA gaps according to the last AND the next value at the same time? Actually, I want R to fill my gaps with the method of
2012 May 28
2
zoo: variable gets modified at making zoo object
I'm doing: > alyL32007z <- zoo(alyL32007,alyL32007$time) > range(time(alyL32007z)) [1] "2007-01-01 00:00:00 UTC" "2007-12-31 23:30:00 UTC" But then, while the original variable is: > summary(alyL32007$NEE_st) Min. 1st Qu. Median Mean 3rd Qu. Max. NA's -15.340 -1.615 -0.054 -0.814 0.750 8.965 11124 the variable within the zoo object
2010 Nov 23
2
Plot two zoo object with different indexes
Dear R community, I have the following two zoo objects: MONTHLY CPI > plot(z) > par("usr") [1] 1977.76333 2011.15333 70.39856 227.03744 > z=zooreg(cpius$Value,as.yearmon("1979-11"),frequency=12) > str(z) ?zooreg? series from Nov 1979 to Oct 2010 Data: num [1:372] 76.2 77 77.8 78.5 79.5 80.3 81.1 82 82 82.6 ... Index: Class 'yearmon' num [1:372]
2011 Jan 27
1
Problem converting zoo object (daily data) to a timeSeries object
When I try to convert the zoo object to a timeSeries object, which would allow me to utilize Rmetrics packages, I get an error message. > Data<-read.zoo("c:\\DOWUBSPRICING.txt,na.strings="NA",sep="\t",header=T) > is(Data) "zoo" > as.timeSeries.zoo(Data) Error in .local (.Object, . ) Is this happening because I am using daily data?
2011 Sep 08
1
Seasonal and 11-day subset for zoo object
I have a zooreg object and I want to be able to generate a value for seasons and 11-day composites paste it onto my zoo data frame, along with year, month and days. Right now I have the following to work from: eg. dat.zoo.mdy <- with(month.day.year(time(dat.zoo)), cbind(dat.zoo, year, month, day, quarter = (month - 1) %/% 3 + 1, dow = as.numeric(format(time(dat.zoo), "%w")))) For
2011 Jan 24
2
how to slice a zoo object
Hi Would anyone have any pointers on how to slice up a large zoo table. I have the following structure: - > str(ZOO_OBJ) ?zoo [1:632, 1:83] 30.4 30.4 30.4 30.4 30.3 ... ?- attr(*, "dimnames")=List of 2 ??..$ : NULL ??..$ : chr [1:83] "COL1" "COL2" "COL3" "COL4" ... ?- attr(*, "index")= POSIXct[1:632], format: "2009-05-01
2011 Aug 29
3
replacing elements of a zoo object
Why doesn't this work? x = zoo(1:5, as.Date('2001-01-01')+1:5) x[as.Date('2001-01-05')] x[as.Date('2001-01-05')] = 0 x I think this is especially bad because it doesn't cause an error. It lets you do something to x, but then you can't see x again to see what it did. [[alternative HTML version deleted]]
2017 Sep 18
3
Convert data into zoo object using Performance analytics package
Dear All, While i am trying convert data frame object to zoo object I am getting numeric(0) error in performance analytics package. The source code i am using from this website to learn r in finance: https://faculty.washington.edu/ezivot/econ424/returnCalculations.r # create zoo objects from data.frame objects dates.sbux = as.yearmon(sbux.df$Date, format="%m/%d/%Y") dates.msft =
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
2011 Nov 28
1
Plotting a zoo object: lines and barplot
Dear R users, I have 3 columns in a zoo object. I want to plot all of them in one screen but I want the first two to be in "lines" format and 3rd one to be barplot. Regards Vikram [[alternative HTML version deleted]]
2012 Feb 17
6
convert zoo object to "standard" R object so I can plot and output to csv file
Another newbie question I got the 1 minute spine interpolation and 15 mean aggregation working with many thanks to Gabor Grothendieck using Zoo functions. I got a tip from Hasan Diwan to look at xts but it seemed I would make better progress using code from Gabor. Now I'm having trouble plotting this zoo object. I'm thinking I want a function to "split" the zoo object back to
2011 Sep 12
5
Hourly data with zoo
I have date data as a numeric and hourly data in 0 to 2300 hours in a dataframe. d <- rep(20110101,24) h <- seq(from = 0, to = 2300, by = 100) df <- data.frame(LST_DATE = d, LST_TIME = h, data = rnorm(24, 0, 1)) S <- chron(dates. = as.character(df$LST_DATE), times. = paste(as.character(df$LST_TIME/100), ":0:0", sep = ""), format =
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 =
2011 May 26
2
zoo column names
I have a zoo object that contains 2 time series named "A-B" and "V1". When I create a third series "V2", the name of the "A-B" series is changed to "A.B". Although I could recreate the names for the 3 series I am wondering if there is a way of preventing the name change from happening ( ... maybe an equivalent of the keep.names=TRUE statement
2011 Apr 03
1
R-project: plot 2 zoo objects (price series) that have some date mis-matches
I have 2 zoo objects - 1) Interest rate spread between 10-YR-US-Treasury and 2-YR-US-Treasury (object name = sprd) 2) S&P 500 index (object name = spy) > str(spy) ?zoo? series from 1976-06-01 to 2011-03-31 Data: num [1:8791] 99.8 100.2 100.1 99.2 98.6 ... Index: Class 'Date' num [1:8791] 2343 2344 2345 2346 2349 ... > str(sprd) ?zoo? series from 1976-06-01 to 2011-03-31
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
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