r - Change `character` to `numeric` in time series -
suppose have next info set.
structure(c("0.233632449583826", "0.252105485477729", "0.591295809149662", "0.0901324567177099", "-0.0423290120373304", "0.0363874105632916", "-0.136952003053153", "0.451355935617868", "-0.291897852322839", "0.287789031880016", "-2.1", "-1.4", "-2.6", "1.9", "-0.7", "1.4", "-0.6", "-1.3", "-1.4", "0"), .dim = c(10l, 2l), .dimnames = list( null, c("return", "ci")), .tsp = c(1985, 1985.75, 12), class = c("mts", "ts", "matrix"))
i trying calculate descriptive statistics , correlation between return
, ci
using describe
, cor
. however, gives next error:
error in describe(x) : non-numeric argument 'describe'
it seems values in info set character
not numeric
. tried as.numeric
, data.matrix
still gives false
is.numeric
test.
if x
object convert numeric; however, cause attributes dropped add together them in:
xx <- as.numeric(x) attributes(xx) <- attributes(x)
you might want investigate how wound in first place. there might else wrong too.
r time-series
No comments:
Post a Comment