Cren
2012-Aug-08 07:54 UTC
[R] RQuantLib: SET_VECTOR_ELT() can only be applied to a 'list', not a 'symbol'
# Hi all, # trying to run the following example code # from 'RQuantLib' package... HullWhite <- list(term = 0.055, alpha = 0.03, sigma = 0.01, gridIntervals = 40) Price <- rep(as.double(100),24) Type <- rep(as.character("C"), 24) Date <- seq(as.Date("2006-09-15"), by = '3 months', length = 24) callSch <- data.frame(Price, Type, Date) callSch$Type <- as.character(callSch$Type) bondparams <- list(faceAmount=100, issueDate = as.Date("2004-09-16"), maturityDate=as.Date("2012-09-16"), redemption=100, callSch = callSch) dateparams <- list(settlementDays=3, calendar="us", dayCounter = "ActualActual", period="Quarterly", businessDayConvention = "Unadjusted", terminationDateConvention= "Unadjusted") coupon <- c(0.0465) CallableBond(bondparams, HullWhite, coupon, dateparams) # ...I get the following error: # ---> SET_VECTOR_ELT() can only be applied to a 'list', not a 'symbol' <--- # Wandering through Internet, I found something similar to my # issue which has been solved by updating packages. # I tried the same but no results :( # Two weeks ago the same code worked properly. # Any idea about what changed in the meantime? # Thanks :) -- View this message in context: http://r.789695.n4.nabble.com/RQuantLib-SET-VECTOR-ELT-can-only-be-applied-to-a-list-not-a-symbol-tp4639542.html Sent from the R help mailing list archive at Nabble.com.
Cren
2012-Aug-08 08:04 UTC
[R] RQuantLib: SET_VECTOR_ELT() can only be applied to a 'list', not a 'symbol'
Cren wrote> > # trying to run the following example code > # from 'RQuantLib' package... ># Obviously, run require(RQuantLib) # before executing the example :) -- View this message in context: http://r.789695.n4.nabble.com/RQuantLib-SET-VECTOR-ELT-can-only-be-applied-to-a-list-not-a-symbol-tp4639542p4639544.html Sent from the R help mailing list archive at Nabble.com.
Enrico Schumann
2012-Aug-08 09:18 UTC
[R] RQuantLib: SET_VECTOR_ELT() can only be applied to a 'list', not a 'symbol'
Am 08.08.2012 09:54, schrieb Cren:> # Hi all, > # trying to run the following example code > # from 'RQuantLib' package... > > HullWhite <- list(term = 0.055, alpha = 0.03, sigma = 0.01, > gridIntervals = 40) > > Price <- rep(as.double(100),24) > Type <- rep(as.character("C"), 24) > Date <- seq(as.Date("2006-09-15"), by = '3 months', length = 24) > callSch <- data.frame(Price, Type, Date) > callSch$Type <- as.character(callSch$Type) > > bondparams <- list(faceAmount=100, issueDate = as.Date("2004-09-16"), > maturityDate=as.Date("2012-09-16"), redemption=100, > callSch = callSch) > dateparams <- list(settlementDays=3, calendar="us", > dayCounter = "ActualActual", > period="Quarterly", > businessDayConvention = "Unadjusted", > terminationDateConvention= "Unadjusted") > coupon <- c(0.0465) > > CallableBond(bondparams, HullWhite, coupon, dateparams) >> # ...I get the following error: > # ---> SET_VECTOR_ELT() can only be applied to a 'list', not a > 'symbol' I cannot reproduce this error. I get Concise summary of valuation for CallableBond Net present value : 64.73968 clean price : 64.003 dirty price : 64.74 accrued coupon : 0.73689 yield : 9.2989 cash flows : Date Amount 2004-12-16 1.1561 2005-03-16 1.1460 2005-06-16 1.1721 2005-09-16 1.1721 ##... > sessionInfo() R version 2.15.1 (2012-06-22) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 [3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C [5] LC_TIME=German_Germany.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] RQuantLib_0.3.8 Rcpp_0.9.13 Regards, Enrico