Questions tagged [xts]

xts is an R package that contains an eXtensible Time Series class and methods. xts extends and behaves like zoo.

xts is an package for analysis. It provides uniform handling of R's different time-based data classes by extending the package.

Repositories

Vignettes

Other resources

Related tags

1987 questions
0
votes
1 answer

prepare xts entry in a table for hc_add_series_list

I am working with a tibble containing a column of xts as in the following example: oneDf <- data.frame( name = "first", t = seq(now(),length=5,by = "days"), val = runif(5)) secDf <- data.frame( name = "sec",t = seq(now(),length=5,by = "days"), val =…
Joker42
  • 1
  • 2
0
votes
1 answer

How can I split an xts object in by-monthly periods?

For example if I create the following xts object: index <- seq(from = Sys.Date(), by = "day", length.out = 100) xts_object <- xts(rnorm(100), order.by = index) I can split into one-month period with the "split" function: list_object <-…
dougie
  • 1
  • 1
0
votes
2 answers

Read Quarterly time series data as Dates in R

Year A B C D E F 1993-Q1 15.3 5.77 437.02 487.68 97 86.9 1993-Q2 13.5 5.74 455.2 504.5 94.7 85.4 1993-Q3 12.9 5.79 469.42 523.37 92.4 …
0
votes
2 answers

how can we remove the rows from xts based on the seconds criteria

I have a problem. i want to delete some rows from the large data set. The problem is I have data of every 30 sec but I only want to go up to per minute. So, I want to remove the rows which have 30 sec init. for better understanding, I am attaching…
CH_A_M
  • 33
  • 7
0
votes
1 answer

i am getting double date and time column after using xts? and getting error 'x' must be a time-series object

I am facing an issue. I am trying to convert my data into xts object so later I can merge time series and plot them. but I am getting an error 'x' must be a time-series object.I am going to show an example data here. time<-c("21.11.2021 22:45",…
CH_A_M
  • 33
  • 7
0
votes
1 answer

how to add data or values based on time to the time series in r

I have a problem. I have one time series and I have the values from other data. Now I just want to add 2nd data values into the time series in the new column. for better understanding, I am attaching an example down. the data that I have time …
CH_A_M
  • 33
  • 7
0
votes
2 answers

xts format assign name for index column

I have a xts file format which when reading didn't have a name for the index column, see below. How do I assign a name to it? Ideally, I wanted to use the date time field for plotting at subsequent stages. Thanks. Elapsed Time…
0
votes
1 answer

X before the date in xts time series

I have these 2 columns in 1 column I have the date and time and the other column reading of the device. I am using xts to convert the time series into xts object but after converting I am not able to plot the time series and I am getting x before…
CH_A_M
  • 33
  • 7
0
votes
1 answer

How do I fill in dates without data on xts

Say I have data xts object (data) for 30 June, 31 July, 29 August, and 30 September. I have a date object (dates) with 30 June, 31 July, 31 August, and 30 September. When I try to do new_data <- data[dates], it just skips the August data. I would…
John
  • 65
  • 5
0
votes
1 answer

How to convert data frame to xts

I have a large data frame with dates and data. In every odd column I have the dates and every second column the corresponding stock price. I would like to convert every column pair to a separate xts object. The data frame looks like this: ...1 …
Tamás F
  • 45
  • 4
0
votes
0 answers

How do I import hourly data and convert it into a workable xts object

Probably a very simple solution but I'm quite new to R and recently finished some elementry Datacamp courses. I'm trying to import hourly data from a csv file and convert it to an xts object. First I tried to directly read is as a zoo object but…
0
votes
1 answer

apple health time series as.xts Error in as.POSIXlt.character(x, tz, ...) : character string is not in a standard unambiguous format

I am trying to convert times series data from Apple Health export into an xts format. However, I can not manage to get the right data format. new = health_df %>% mutate( Type = str_remove(type, "HKQuantityTypeIdentifier"), Value =…
C_Hut
  • 31
  • 8
0
votes
0 answers

Unable to generate list of XTS objects using apply in R shiny

I have the following R-Shiny Module which tries to take the excel file path, sheet name and data range upon click of a button. The excel will always contain "Date" as the first column. I then read the inputs using read_excel() to form a dataframe…
K.RAC
  • 233
  • 1
  • 8
0
votes
1 answer

In R, how can I add a legend to a plot of an XTS object?

The following creates a two column XTS object to serve as example data. quantmod::getSymbols(c('SPY','IWM'), src = 'yahoo', from = '2010-01-01', to = '2021-02-01', …
raml5
  • 3
  • 2
0
votes
1 answer

Create a list based on dates in R

Let's say that my data has the following structure library(xts) structure(c(-0.108511, -0.446626999999999, 0.240643000000002, 1.679788, -2.278705, 0.0174959999999977, -0.23011, -1.458079, -0.770809, -0.160931000000001, -0.884409000000002,…
Eve Chanatasig
  • 397
  • 2
  • 10