similar to: How to use write.csv(x=zoo.object), and how to let the first column corret?

Displaying 20 results from an estimated 8000 matches similar to: "How to use write.csv(x=zoo.object), and how to let the first column corret?"

2009 May 04
1
how to remove ( ) ? when using write.csv(chron.object)
Hello all, I don' like to have ( ) around my datetime, when send the csv file to somebody. How to remove it? >library(chron) >mydate <- c("2009-05-03","2009-06-07") >mytime <- c("10:30:00","10:20:00") >mydatetime <- chron(dates=mydate,times=mytime,format=c("y-m-d","h:m:s")) >write.csv(mydatetime)  
2009 Mar 11
2
How to monthly,daily,yearly average
Sorry, this is my first time to post. I have a big data set: first colume is date (ex: 2008-2-150, the second is time (10:30:00), and the following columes are variaty measurement data. Every 30 min, I have one data. I want to find an effecient way to calculate the hourly, daily, monthly and yearly average, and plot them, and eventually use these average data to do further analysis. Thanks!
2011 Apr 19
1
Axes Alignment Problem for Multiple Plots
Dear all, I'm trying to plot, in the same window, two different series, using barplot() for the first one and plot() for the second. What happens is that the second chart has a different axes origin, therefore the final plot is wrong. This piece of code shows the differences between the values of par()$usr: barplot(coredata(Z0), beside=TRUE, ylim=c(0,100)); par()$usr;
2009 Mar 30
1
how to input multiple .txt files
how to input multiple .txt files? A data folder has lots of .txt files from different customers. Want to read all these .txt files to different master files: such as: cust1.xx.txt, cust1.xxx.txt, cust1.xxxx.txt,.............. to master file: X.txt cust2.xx.txt, cust2.xxx.txt, cust2.xxxx.txt,.............. to master file: Y.txt Thanks! [[alternative HTML version deleted]]
2010 Aug 25
2
Repeat the first day data through all the day. Zoo
down vote favorite Hello I have a zoo series. It lasts 10 years and its frequency is 15min. I'd like to get a new zoo series (or vector) with the same number of elements, whith each element equal to the first element of the day. That's, The first element everyday is repeated throughout the wole day. This is not same as aggregate(originalseries,as.Date,head,1) because this gives a
2011 Sep 27
2
Coercing a character zoo to a numeric
Dear R-helpers, It seems to me that a character zoo cannot be coerced to a numeric zoo. Below is a minimal example. Can someone tell me what I have done wrong? > z<-zoo(1:4,order.by=1:4) > coredata(z)<-as.character(coredata(z)) > str(z) ‘zoo’ series from 1 to 4 Data: chr [1:4] "1" "2" "3" "4" Index: int [1:4] 1 2 3 4 >
2009 Jun 19
1
(FULL) Need help to optimize a piece of code involving zoo objects
(Sorry, sent the message before I finished it) Hello, everyone I have a long script that uses zoo objects. In this script I used simple moving averages and these I can very efficiently calculate with filter() functions. Now, I have to use special "exponential" moving averages, and the only way I could write the code was with a for-loop, which makes everything extremely slow. I don't
2009 Jun 19
1
Need help to optimize a piece of code involving zoo objects
Hello, everyone I have a long script that uses zoo objects. In this script I used simple moving averages and these I can very efficiently calculate with filter() functions. Now, I have to use special "exponential" moving averages, and the only way I could write the code was with a for-loop, which makes everything extremely slow. I don't know how to optimize the code, but I need to
2011 Jul 26
1
intraday plot and gaps in data
Hi, I have an intraday timeseries of financial data (see below) which has gaps due to market opening and closing hours. I am trying to plot it, but the time gap is always visible in the plot. I tried converting data to xts, zoo, timeSeries and plotting it with different functions i.e. plot.xts, plot.zoo. The only way to make it work was with function 'chartSeries' in the quantmod package
2006 Nov 23
1
Problem with as.ts(zoo-object)
Dear all, I have an error message, when I try to convert a zoo object (called test) to ts (on R 2.4.0, Package zoo version 1.2-1, Windows XP) > test 1994-05-10 1994-06-09 1994-07-09 0.0024943889 0.0024881824 0.0006955831 > str(test) atomic [1:3] 0.002494 0.002488 0.000696 - attr(*, "index")=Class 'Date' num [1:3] 8895 8925 8955 > is.regular(test) [1] TRUE
2006 Nov 29
2
problem with indexing a zoo object
My problem is the following : I create 2 zoo objects and then I try to subset one of them using logic. indicesthatpass is a vector of trues and falses but when I send it into bckret, it returns an empty bckret. Obviously it has something to do with bckret being a zoo object and if I do the same subsctripting off of coredata(bckret), I'm confident it will work. But, I need to keep the minute
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
2006 Nov 03
1
as.zoo behavior (
hi all : the code pasted below runs but then, a dput on rollmeandifflogbidask gives me what is below the code. the structure of rollmeandifflogbidask is a zoo object but with a "frequency" so it's not the same structure as the original actual diff and this really causes things to blow up in later code. i'm sure gabor and achim know what to do but in the case that they are not
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 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 Mar 15
2
Pointwise division of two zoo objects?
Just trying to create returns from prices, and do something like: returns.z = tail(prices.z,-1)/head(prices.z,-1) - 1 # should be equivalent to returns = exp(diff(log(prices.z))) - 1 Curiously, I get a zoo object back with zeros everywhere and also with the index having one fewer element than it should. Does anyone know how to pointwise divide zoo objects, and what exactly "/" is
2010 May 16
3
Vector recycling and zoo
I am a bit confused about the different approaches taken to recycling in plain data frames and zoo objects. When carrying out simple arithmetic, dataframe seem to recycle single arguments, zoo objects do not. Here is an example > x <- data.frame(a=1:5*2, b=1:5*3) > x a b 1 2 3 2 4 6 3 6 9 4 8 12 5 10 15 > x$a/x$a[1] [1] 1 2 3 4 5 > x <- zoo(x) > x$a/x$a[1] 1 1 >
2012 Dec 04
1
Periodicity of Weekly Zoo
Hi List, I have weekly sales observations for several products drawn via ODBC. Source data is available at https://www.dropbox.com/s/78vxae5ic8tnutf/asr.csv. This is retail sales data, so will contain seasonality and trend information. I expect to see 52 or 53 observations per year, each observation occuring on the same day of the week (Saturday). Ultimately I'm looking to feed these series
2010 Aug 20
1
differecing a zoo series
A quick question x <- as.yearmon(2000 + seq(0, 23)/12) x [1] "Jan 2000" "Feb 2000" "Mar 2000" "Apr 2000" "May 2000" "Jun 2000" "Jul 2000" "Aug 2000" "Sep 2000" "Oct 2000" "Nov 2000" "Dec 2000" "Jan 2001" [14] "Feb 2001" "Mar 2001" "Apr
2010 Jun 15
6
working with zoo time index ??
Hello Where could I find examples on how to work with the time index in a timeseries or zoo series? Let say I've got this series DATA 1990-01-01 10:00:00 0.900 1990-01-01 10:01:00 0.910 1990-01-01 10:03:00 0.905 1990-01-01 10:04:00 0.905 1990-01-01 10:05:00 0.890 ....................... 2000-12-31 20:00:00 0.992 How do I make simple calculations such as ... ? Calculate the