similar to: Importing time series

Displaying 20 results from an estimated 10000 matches similar to: "Importing time series"

2018 Apr 24
2
Rolling window difference for zoo time series
Hi, I have a 'zoo' time series as below : Zoo_TS = zoo(5:1, as.Date(Sys.time())+0:4) Now I want to calculate First order difference of order 1, rolling window basis i.e. (Zoo_TS[2] - Zoo_TS[1] ) / Zoo_TS[1] (Zoo_TS[3] - Zoo_TS[2] ) / Zoo_TS[2] ..... Is there any direct function available to achieve this? Thanks,
2018 Apr 24
0
Rolling window difference for zoo time series
Zoo_TS/lag(Zoo_TS) - 1 On Tue, Apr 24, 2018 at 9:29 PM, Christofer Bogaso < bogaso.christofer at gmail.com> wrote: > Hi, > > I have a 'zoo' time series as below : > > Zoo_TS = zoo(5:1, as.Date(Sys.time())+0:4) > > Now I want to calculate First order difference of order 1, rolling > window basis i.e. > > (Zoo_TS[2] - Zoo_TS[1] ) / Zoo_TS[1] >
2017 Aug 10
3
Zoo rolling window with increasing window size
Hi Joshua, thanks for your prompt reply. However as I said, sum() function I used here just for demonstrating the problem, I have other custom function to implement, not necessarily sum() I am looking for a generic solution for above problem. Any better idea? Thanks, On Fri, Aug 11, 2017 at 12:04 AM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote: > Use a `width` of integer index
2017 Aug 10
0
Zoo rolling window with increasing window size
Replace "sum" with your custom function's name. I don't see any reason why that wouldn't work, and the problem with my solution is not clear in your response. r <- rollapplyr(x, seq_along(x), yourCustomFunctionGoesHere) On Thu, Aug 10, 2017 at 1:39 PM, Christofer Bogaso <bogaso.christofer at gmail.com> wrote: > Hi Joshua, thanks for your prompt reply. However
2017 Aug 10
2
Zoo rolling window with increasing window size
Hi again, I am wondering there is any function for 'zoo' time series, where I can apply a user defined function rolling window basis, wherein window size is ever increasing i.e. not fixed. For example, let say I have below user defined function and a zoo time series : > library(zoo) > UDF = function(x) sum(x) > TS = zoo(rnorm(10), seq(as.Date('2017-01-01'),
2017 Aug 10
0
Zoo rolling window with increasing window size
Use a `width` of integer index locations. And you likely want = "right" (or rollapplyr(), as I used). R> set.seed(21) R> x <- rnorm(10) R> rs <- rollapplyr(x, seq_along(x), sum) R> cs <- cumsum(x) R> identical(rs, cs) [1] TRUE On Thu, Aug 10, 2017 at 1:28 PM, Christofer Bogaso <bogaso.christofer at gmail.com> wrote: > Hi again, > > I am
2011 Apr 06
2
A zoo related question
Dear all, please consider my following workbook: library(zoo) lis1 <- vector('list', length = 2) lis2 <- vector('list', length = 2) lis1[[1]] <- zooreg(rnorm(20), start = as.Date("2010-01-01"), frequency = 1) lis1[[2]] <- zooreg(rnorm(20), start = as.yearmon("2010-01-01"), frequency = 12) lis2[[1]] <- matrix(1:40, 20) lis2[[2]] <-
2010 Jul 12
3
How to create sequence in month
Hi all, can anyone please guide me how to create a sequence of months? Here I have tried following however couldn't get success > library(zoo) > seq(as.yearmon("2010-01-01"), as.yearmon("2010-03-01"), by="1 month") Error in del/by : non-numeric argument to binary operator What is the correct way to do that? Thanks for your time.
2010 Jul 10
7
Need help on date calculation
Hi all, please see my code: > library(zoo) > a <- as.yearmon("March-2010", "%B-%Y") > b <- as.yearmon("May-2010", "%B-%Y") > > nn <- (b-a)*12 # number of months in between them > nn [1] 2 > as.integer(nn) [1] 1 What is the correct way to find the number of months between "a" and "b", still
2010 Jul 07
3
Need help in handling date
Dear all, I have a date related question. Suppose I have a character string "March-2009", how I can convert it to a valid date object like as.yearmon("2009-01-03") in the zoo package? Is there any possibility there? Ans secondly is there any R function which will give the names of of all months as "LETTERS" does? Thanks for your time. [[alternative HTML version
2013 Apr 07
1
importing and merging many time series
Hello. I've got many (5-20k) files with time series in a text format like this: 1359635460 2.006747 1359635520 1.886745 1359635580 3.066988 1359635640 3.633578 1359635700 2.140082 1359635760 2.033564 1359635820 1.980123 1359635880 2.060131 1359635940 2.113416 1359636000 2.440172 First field is a unix timestamp, second is a float number. Its
2009 Jul 01
1
A problem on zoo object
I have a zoo object on daily data for 10 years. Now I want to create a list, wherein each member of that list is the monthly observations. For example, 1st member of list contains daily observation of 1st month, 2nd member contains daily observation of 2nd month etc. Then for a particular month, I want to divide all observations into 3 parts (arbitrary) and then want to calculate some statistics
2017 Sep 16
2
require help
You can just use the same code that I provided before but now use your dataset. Like this df <- read.csv(file="data2.csv",header=TRUE) dates <- as.Date(paste(df$year,"-01-01",sep="")) myXts <- xts(df,order.by=dates) head(myXts) #The last command "head(myXts)" shows you the first few rows of the xts object year cnsm incm wlth
2017 Sep 16
0
require help
oky.. thank you very much to all of you On Sat, Sep 16, 2017 at 2:06 PM, Eric Berger <ericjberger at gmail.com> wrote: > You can just use the same code that I provided before but now use your > dataset. Like this > > df <- read.csv(file="data2.csv",header=TRUE) > dates <- as.Date(paste(df$year,"-01-01",sep="")) > myXts <-
2017 Sep 22
2
require help
Assuming the input data.frame, DF, is of the form shown reproducibly in the Note below, to convert the series to zoo or ts: library(zoo) # convert to zoo z <- read.zoo(DF) # convert to ts as.ts(z) # Note: DF <- structure(list(year = c(1980, 1981, 1982, 1983, 1984), cnsm = c(174, 175, 175, 172, 173), incm = c(53.4, 53.7, 53.5, 53.2, 53.3), with = c(60.3, 60.5, 60.2, 60.1, 60.7)),
2009 Sep 24
2
Downloading data from from internet
Hi all, I want to download data from those two different sources, directly into R : http://www.rateinflation.com/consumer-price-index/usa-cpi.php http://eaindustry.nic.in/asp2/list_d.asp First one is CPI of US and 2nd one is WPI of India. Can anyone please give any clue how to download them directly into R. I want to make them zoo object for further analysis. Thanks, -- View this message in
2008 Mar 31
1
concatenating two successive time series
Dear Helpers, I am looking for methods and tools to compare and then to concatenate two successive time series. They are both in the same frequency and they describe one phenomena. There is no time gap between them. The problem is that the method of measurements has changed between both time series and they are no statistically the same. I would like to merge them to receive one homogeneous
2017 Sep 16
0
require help
> On 15 Sep 2017, at 11:38, yadav neog <yadavneog at gmail.com> wrote: > > hello to all. I am working on macroeconomic data series of India, which in > a yearly basis. I am unable to convert my data frame into time series. > kindly help me. > also using zoo and xts packages. but they take only monthly observations. > > 'data.frame': 30 obs. of 4 variables:
2017 Sep 15
0
require help
> On 15 Sep 2017, at 12:38, yadav neog <yadavneog at gmail.com> wrote: > > hello to all. I am working on macroeconomic data series of India, which in > a yearly basis. I am unable to convert my data frame into time series. Do you really need to convert your data to time series/xts/zoo? I don?t know you try what kind of an analysis but perhaps you don?t have to. > kindly
2012 Feb 17
4
How can I tabulate time series data (in RStudio or any other R editor)?
Hello, I have a question on how to tabulate the time series data. I use RStudio, but if can be done in any other R editor, it should work in RStudio as well. > a1<-11:22 > a1ts<-ts(a1, frequency=4, start=c(1978,1)) > a1ts Qtr1 Qtr2 Qtr3 Qtr4 1978 11 12 13 14 1979 15 16 17 18 1980 19 20 21 22 If I click the variable "a1ts" on the