similar to: need help converting data.frame to time series

Displaying 20 results from an estimated 40000 matches similar to: "need help converting data.frame to time series"

2011 Aug 16
2
trouble installing packages on OpenSuse 11.4
Hi, I am trying to install a bunch of packages via command line and can use some help in getting it right. My env is a freshly setup OpenSuse 11.4 on an amd desktop. I have not yet installed gcc (Will I need gcc to install packages? I have installed make, assuming R might need it.). I have tried it both under R2.12 and R2.13. I have a list of packages to install such as fImport, fGarch, zoo,
2010 Jun 07
2
Computing day-over-day log return for a matrix containing multiple time series
Hi all, Thanks a lot for anyone's help in advance. I am trying to find a way to compute the day-to-day return (log return) from a n x r matrix containing, n different stocks and price quotes over r days. The time series of prices are already split by using unstack function. For the result, I would like to see a n x (r-1) matrix, where by each entry is the day-over-day return of
2011 Mar 16
3
Reorganize data frame
Hi group, I am trying to convert the organization of a data frame so I can do some correlations between stocks, I have something like this: stock.returns <- data.frame(rbind(c("MSFT","20110301",0.05),c("MSFT","20110302",0.01),c("GOOG","20110301",-0.01),c("GOOG","20110302",0.04))) colnames(stock.returns) <-
2006 Jul 06
1
which data structure for a set of time series ?
Hello, I'm a R newcomer and I'm wondering the kind of data structure that would best fit to my problem: my data are equities (stocks) : so I have a time serie (say 1 year of weekly data), and a bunch of qualitative + quantitative variables : the sector of the stock (biotech/finance...), the geographical region, the name, ISIN code, P/E ratios, whatever... The data.frame is perfect for the
2009 Feb 03
1
plot multiple time series
Hi, I have a dataframe containing a date object in the first column and numeric data in two other columns, for a total of three columns. I would like to plot the 2 numeric data columns against the dates in one window. How do I do this? It is easy to do if only one data series is to be plotted against a set of dates, but two or more datasets seems to be harder. Note: I have daily data where
2012 Oct 04
4
Class for time series
Dear all, I have a time serie dataset such as the following with data acquired every 15 minutes: Date Heure Profondeur Temp?rature Salinit? Turbidit? Chloration 1 2012-07-06 08:47:22 -0.144 22.469 0.011 0.000 0 2 2012-07-06 09:02:21 -0.147 22.476 0.011 0.000 0 3 2012-07-06 09:17:21 -0.139 22.498 0.011 19.323 0 4 2012-07-06
2007 May 10
3
Quick question on merging two time-series of different frequencies
Hi, A quick beginner's question. I have two time series, A with daily data, and another B with data at varying frequencies, but mostly annual. Both the series are sorted ascending. I need to merge these two series together in the following way: For any entry of A, the lookup should match with B until we find an entry of B that's larger than A's. For all A[i], i = 1,...,N and B[j],
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
2012 Jul 24
1
getting error in Rpad::json()
Hi, I am trying to convert an R object to JSON, using Rpad::json. I get the following error when there is an empty vector in there. Using R version 2.15.0 (2012-03-30) on OpenSUSE 11.4 on an Intel machine; Rpad - 1.3.0 >Rpad::json(numeric(0)) > class(Rpad::json(numeric(0))) [1] "json" > Rpad::json(list(x=numeric(0))) Error in res[i] <- json(x[[i]]) : replacement has
2012 Jul 05
3
Return
Hello Every one I have data on Stock prices and I want to calculate the return on all the stocks and then replace all the stock prices with the returns can any one tell me how to do My data is in the format given below Date Stock1 Stock2 Stock3 01/01/2000 1 2 3 01/02/2000 5 6 7 01/03/2000 1 2 3 01/04/2000
2007 Sep 27
1
converting numbers in "YYYYMM" format to last calendar day and last exchange trading day of the month
I have a vector that contains month and year in the format YYYYMM (e.g.“200701”, “200702”) I wish to do to things: 1. I need to convert to a date that is the last calendar day of each month. 2. I need to convert this to a date that is the last U.S. stock-exchange trading day of each month. Any advice is appreciated, mymonths <- c(200701, 200702)
2006 Jan 03
2
For loop gets exponentially slower as dataset gets larger...
I am running R 2.1.1 in a Microsoft Windows XP environment. I have a matrix with three vectors (“columns”) and ~2 million “rows”. The three vectors are date_, id, and price. The data is ordered (sorted) by code and date_. (The matrix contains daily prices for several thousand stocks, and has ~2 million “rows”. If a stock did not trade on a particular date, its price is set to “NA”)
2007 May 14
6
Conditional Sums for Index creation
Hi, Apologies for the long mail. I have a data.frame with columns of price/mcap data for a portfolio of stocks, and the date. To get the total value of the portfolio on a daily basis, I calculate rowSums of the data.frame. > set.seed(1) > ab <- matrix(round(runif(100)*100),nrow=20,ncol=5) > ab[1:5,4:5] <- NA > ab[6:10,5] <- NA > ac <- as.data.frame(ifelse(ab <=
2010 Apr 20
1
converting a zoo or an xts to a data frame
Dear R People: I have the following code that I use to convert a monthly zoo object to a data.frame, and it works perfectly: library(tseries) z <- get.hist.quote(instrument=inst1, start=start1,end=end1, quote=quot1,comp = "m") y <- as.ts(aggregate(z, as.yearmon, tail, 1)) y.df <- data.frame(y=y,time=time(y)) y.df$x <- ts(y.df[,1]) tsp(y.df$x) <-
2009 Mar 20
1
Dickey Fuller test of a time series (problem)
Hi all, I tried to do a Dickey Fuller test with R using adf.test with a time series of german stock prices. I have 10 stocks from 1985 to 2009 with monthly stock prices. So if you do the math I have 289 values for each stock. I tried to do the test for each stock alone and had the 289 values of my first stock listed in R. When I tried to do the test with command adf.test(x, k=1) the following
2009 Oct 10
1
packages to download from yahoo finance
Hi I am a new R user, so if this question has been raised and answered before, perhaps you can point me that way. I was looking for some package/scripts that can download financial data from yahoo finance (or some other) website. I did check http://cran.r-project.org/web/packages/ but failed to find something like this. However, I am confident this problem has already been solved! Thanks a lot.
2011 Oct 27
1
Correllogram of Daily Time Series
Hi there, What is the best way to get a time series of daily stock price observations into R (from excel). The time series are daily but there are spaces for w/e's and holidays etc. So I am not sure a ts object will be suitable but I am not sure what I should use? What ever package you recemmned i need to be able to run a corrolelagram. Thanks Hugh -- View this message in context:
2007 Feb 19
2
help with loop over data frame
Dear List, This may be the fifth time Ive tried to send this to the list so apologies if there are multiple emails. I need some help getting started with this problem. I have a data frame containing a year of daily stock prices in the following format: Date Open High Low Close 1/15/2000 10 11 8 10 1/16/2000 12 12 10 11 etc.. I want to create a new
2018 Jan 07
1
help needed on quantmod....
dear members, I am using quantmod to work with stock prices... I am trying to append the data got from getQuote to the one got by getSymbols. The function is named "apnd". The code is as follows: function(x){ if ((class(x) == "xts") || (class(x) == "zoo")){ sym <- deparse(substitute(x))
2009 Jul 02
2
Need to study and learn about better plots
Hi, So far my plotting needs have been sort of ignored as I got acquainted with R this week, but now that I have the basics in place for the program I wanted to write it's time for me to start learning about how to make output that better suits my needs. I think I have two sort of charts I need to concentrate on learning how to produce: 1) Probably a trivial request - a single chart that