[R-SIG-Finance] xts

Joshua Ulrich josh.m.ulrich at gmail.com
Wed Jun 1 16:08:29 CEST 2011


Emmanuel,

This does not help.  Jeff asked for the output from dput() and he
asked you *not* to send 600+ lines.  We also asked for a reproducible
example, which you still have not provided.  Give us code that we can
copy from your email to our R session that will show us the error,
then we will be able to help you.

For example:
EXX.dm <- structure(c(25.13083, 58.50875, 54.98292, 55.98917, 68.47125,
68.13833, 61.83625, 66.03333, 64.29583, 66.32458), class = c("xts",
"zoo"), .indexCLASS = "Date", .indexTZ = "", index = structure(c(1199167200,
1199253600, 1199340000, 1199426400, 1199685600, 1199772000, 1199858400,
1199944800, 1200031200, 1200290400), tzone = "", tclass = "Date"),
.Dim = c(10L,
1L))

We are all extremely busy, so you need to make it as easy as possible
for us if you want our help for free.

Best,
--
Joshua Ulrich  |  FOSS Trading: www.fosstrading.com


On Wed, Jun 1, 2011 at 8:54 AM, Emmanuel Senyo <emmanuel.senyo at gmail.com> wrote:
>
> Dear Jeffrey,
> Sorry if you misunderstood what I posted, I guess it was it quite clear.
> Find below the structure of EXX.dm I hope this help.

<snip>

>
> On Mon, May 30, 2011 at 7:34 PM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote:
>>
>> Hi Emmanuel,
>>
>> On Mon, May 30, 2011 at 12:27 PM, Emmanuel Senyo
>> <emmanuel.senyo at gmail.com> wrote:
>> > Dear All,
>> > I am creating an xts object for a univariate time series data , EXX.dm but
>> > it does not work. The data starts from 01/01/2008 to 09/05/2011 and I use
>> > 01/01/1970 as the base year. Below is my code.
>> > library(PerformanceAnalytics)
>> > library(xts)
>> > b<-as.xts(EXX.dm, order.by=as.Date(13880:15104), origin=1970-01-01)
>> > C<-VaR(b, p=0.5,method = c("historical"),portfolio_method =
>> > c("single"),weights = NULL, mu = NULL, sigma = NULL,
>> >    m3 = NULL, m4 = NULL, invert = TRUE))
>> >
>> > I got the following error message:
>> > Error in xts(x, order.by = order.by, frequency = frequency, ...) :
>> >  NROW(x) must match length(order.by)
>>
>> Please provide a minimal, reproducible example.  We need to know the
>> exact structure of EXX.dm and exactly where the error occurs.
>>
>> > I am new to R and need an assistance.
>> > Regards
>> > Emma
>> >
>> >
>>
>> Best,
>> --
>> Joshua Ulrich  |  FOSS Trading: www.fosstrading.com
>



More information about the R-SIG-Finance mailing list