namespace locked for RQuantLib

Multi tool use
Multi tool use












0















Running this on RStudio/Windows. The last line fails with:




Error in registerNames(names, package, ".global", add) : The
namespace for package "RQuantLib" is locked; no changes in the global
variables list may be made.




library(RQuantLib)

myStrike <- 1240
myPrice <- 1410

volVec <- c(0.1, 0.2, 0.3, 0.4, 0.5)
priceVec <- c(1500,1400,1300,1200,1100)
myType <- "put"
rfRate <- 0.02
maturity <- 360/360
vol <- 0.3


EO = EuropeanOption(type = myType,price = myPrice,strike = myStrike, dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,volatility = vol )
EOres = EuropeanOptionArrays(type = myType,price = priceVec,strike = myStrike, dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,volatility = volVec )
summary(EO)
plotOptionSurface(EOres)









share|improve this question



























    0















    Running this on RStudio/Windows. The last line fails with:




    Error in registerNames(names, package, ".global", add) : The
    namespace for package "RQuantLib" is locked; no changes in the global
    variables list may be made.




    library(RQuantLib)

    myStrike <- 1240
    myPrice <- 1410

    volVec <- c(0.1, 0.2, 0.3, 0.4, 0.5)
    priceVec <- c(1500,1400,1300,1200,1100)
    myType <- "put"
    rfRate <- 0.02
    maturity <- 360/360
    vol <- 0.3


    EO = EuropeanOption(type = myType,price = myPrice,strike = myStrike, dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,volatility = vol )
    EOres = EuropeanOptionArrays(type = myType,price = priceVec,strike = myStrike, dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,volatility = volVec )
    summary(EO)
    plotOptionSurface(EOres)









    share|improve this question

























      0












      0








      0








      Running this on RStudio/Windows. The last line fails with:




      Error in registerNames(names, package, ".global", add) : The
      namespace for package "RQuantLib" is locked; no changes in the global
      variables list may be made.




      library(RQuantLib)

      myStrike <- 1240
      myPrice <- 1410

      volVec <- c(0.1, 0.2, 0.3, 0.4, 0.5)
      priceVec <- c(1500,1400,1300,1200,1100)
      myType <- "put"
      rfRate <- 0.02
      maturity <- 360/360
      vol <- 0.3


      EO = EuropeanOption(type = myType,price = myPrice,strike = myStrike, dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,volatility = vol )
      EOres = EuropeanOptionArrays(type = myType,price = priceVec,strike = myStrike, dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,volatility = volVec )
      summary(EO)
      plotOptionSurface(EOres)









      share|improve this question














      Running this on RStudio/Windows. The last line fails with:




      Error in registerNames(names, package, ".global", add) : The
      namespace for package "RQuantLib" is locked; no changes in the global
      variables list may be made.




      library(RQuantLib)

      myStrike <- 1240
      myPrice <- 1410

      volVec <- c(0.1, 0.2, 0.3, 0.4, 0.5)
      priceVec <- c(1500,1400,1300,1200,1100)
      myType <- "put"
      rfRate <- 0.02
      maturity <- 360/360
      vol <- 0.3


      EO = EuropeanOption(type = myType,price = myPrice,strike = myStrike, dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,volatility = vol )
      EOres = EuropeanOptionArrays(type = myType,price = priceVec,strike = myStrike, dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,volatility = volVec )
      summary(EO)
      plotOptionSurface(EOres)






      r quantlib






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 29 '18 at 15:58









      DavveKDavveK

      126110




      126110
























          1 Answer
          1






          active

          oldest

          votes


















          2














          Thanks for asking this question, and apologies for missing it for a few days. An issue ticket at GitHub would have been ok too.



          The code you post (and possibly quoted from old documentation of mine...) is buggy. The second argument to both EuropeanOption() and EuropeanOptionArrays() is now underlying, not price. So we make this



          library(RQuantLib)

          myStrike <- 1240
          myPrice <- 1410

          volVec <- c(0.1, 0.2, 0.3, 0.4, 0.5)
          priceVec <- c(1500,1400,1300,1200,1100)
          myType <- "put"
          rfRate <- 0.02
          maturity <- 360/360
          vol <- 0.3


          EO <- EuropeanOption(type = myType, underlying = myPrice,strike = myStrike,
          dividendYield = 0, riskFreeRate = rfRate, maturity = maturity,
          volatility = vol )
          EOres <- EuropeanOptionArrays(type = myType, underlying = priceVec,strike = myStrike,
          dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,
          volatility = volVec )
          summary(EO)
          plotOptionSurface(EOres)


          Next, in the function plotOptionSurface() we need to comment out the call to globalVariables(), this can no longer be in a function body. So make it eg



          pos <- function(EOres, ylabel="", xlabel="", zlabel="", fov=60) {
          if (requireNamespace("rgl", quietly=TRUE)) {
          #utils::globalVariables(c("clear3d", "bg3d", "ligh3d", "rgl.viewpoint", "rgl.surface", "tgl.texts"))
          axis.col <- "black"
          text.col <- axis.col
          ylab <- ylabel
          xlab <- xlabel
          zlab <- zlabel
          y <- EOres

          ## clear scene:
          rgl::clear3d()
          rgl::clear3d(type="bbox")
          rgl::clear3d(type="lights")

          ## setup env:
          rgl::bg3d(color="#DDDDDD")
          rgl::light3d()

          rgl::rgl.viewpoint(fov=fov)

          x <- 1:nrow(y)
          z <- 1:ncol(y)
          x <- (x-min(x))/(max(x)-min(x))
          y <- (y-min(y))/(max(y)-min(y))
          z <- (z-min(z))/(max(z)-min(z))
          rgl::rgl.surface(x, z, y, alpha=0.6, lit=TRUE, color="blue")
          rgl::rgl.lines(c(0,1), c(0,0), c(0,0), col=axis.col)
          rgl::rgl.lines(c(0,0), c(0,1), c(0,0), col=axis.col)
          rgl::rgl.lines(c(0,0),c(0,0), c(0,1), col=axis.col)
          rgl::rgl.texts(1,0,0, xlab, adj=1, col=text.col)
          rgl::rgl.texts(0,1,0, ylab, adj=1, col=text.col)
          rgl::rgl.texts(0,0,1, zlab, adj=1, col=text.col)

          ## add grid (credit's to John Fox scatter3d)
          xgridind <- round(seq(1, nrow(y), length=25))
          zgridind <- round(seq(1, ncol(y), length=25))
          rgl::rgl.surface(x[xgridind], z[zgridind], y[xgridind,zgridind],
          color="darkgray", alpha=0.5, lit=TRUE,
          front="lines", back="lines")

          ## animate (credit to rgl.viewpoint() example)
          start <- proc.time()[3]
          while ((i <- 36*(proc.time()[3]-start)) < 360) {
          rgl::rgl.viewpoint(i,i/8);
          }
          } else {
          message("Please install the 'rgl' package before using this function.")
          }
          }


          Now we can call with element of the result list, eg



          pos(EOres[[1]])  # value


          and ditto for the others.






          share|improve this answer
























          • Thanks! Do you generally recommend definig a new function rather than overwriting?

            – DavveK
            Jan 10 at 12:39











          • No that was just for the example. More importantly it's a bug that I will fix. Where did you see the outdated example though?

            – Dirk Eddelbuettel
            Jan 10 at 12:44











          • I made it, my fault with price rather than underlying.

            – DavveK
            Jan 10 at 12:45











          • Yes, your call was wrong, but the bug to fix is the utils::globalVariables() call which needs to move outside the function -- this lead to the error in your Subject:. Error on my side, and I will fix it.

            – Dirk Eddelbuettel
            Jan 10 at 13:32











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53971066%2fnamespace-locked-for-rquantlib%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Thanks for asking this question, and apologies for missing it for a few days. An issue ticket at GitHub would have been ok too.



          The code you post (and possibly quoted from old documentation of mine...) is buggy. The second argument to both EuropeanOption() and EuropeanOptionArrays() is now underlying, not price. So we make this



          library(RQuantLib)

          myStrike <- 1240
          myPrice <- 1410

          volVec <- c(0.1, 0.2, 0.3, 0.4, 0.5)
          priceVec <- c(1500,1400,1300,1200,1100)
          myType <- "put"
          rfRate <- 0.02
          maturity <- 360/360
          vol <- 0.3


          EO <- EuropeanOption(type = myType, underlying = myPrice,strike = myStrike,
          dividendYield = 0, riskFreeRate = rfRate, maturity = maturity,
          volatility = vol )
          EOres <- EuropeanOptionArrays(type = myType, underlying = priceVec,strike = myStrike,
          dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,
          volatility = volVec )
          summary(EO)
          plotOptionSurface(EOres)


          Next, in the function plotOptionSurface() we need to comment out the call to globalVariables(), this can no longer be in a function body. So make it eg



          pos <- function(EOres, ylabel="", xlabel="", zlabel="", fov=60) {
          if (requireNamespace("rgl", quietly=TRUE)) {
          #utils::globalVariables(c("clear3d", "bg3d", "ligh3d", "rgl.viewpoint", "rgl.surface", "tgl.texts"))
          axis.col <- "black"
          text.col <- axis.col
          ylab <- ylabel
          xlab <- xlabel
          zlab <- zlabel
          y <- EOres

          ## clear scene:
          rgl::clear3d()
          rgl::clear3d(type="bbox")
          rgl::clear3d(type="lights")

          ## setup env:
          rgl::bg3d(color="#DDDDDD")
          rgl::light3d()

          rgl::rgl.viewpoint(fov=fov)

          x <- 1:nrow(y)
          z <- 1:ncol(y)
          x <- (x-min(x))/(max(x)-min(x))
          y <- (y-min(y))/(max(y)-min(y))
          z <- (z-min(z))/(max(z)-min(z))
          rgl::rgl.surface(x, z, y, alpha=0.6, lit=TRUE, color="blue")
          rgl::rgl.lines(c(0,1), c(0,0), c(0,0), col=axis.col)
          rgl::rgl.lines(c(0,0), c(0,1), c(0,0), col=axis.col)
          rgl::rgl.lines(c(0,0),c(0,0), c(0,1), col=axis.col)
          rgl::rgl.texts(1,0,0, xlab, adj=1, col=text.col)
          rgl::rgl.texts(0,1,0, ylab, adj=1, col=text.col)
          rgl::rgl.texts(0,0,1, zlab, adj=1, col=text.col)

          ## add grid (credit's to John Fox scatter3d)
          xgridind <- round(seq(1, nrow(y), length=25))
          zgridind <- round(seq(1, ncol(y), length=25))
          rgl::rgl.surface(x[xgridind], z[zgridind], y[xgridind,zgridind],
          color="darkgray", alpha=0.5, lit=TRUE,
          front="lines", back="lines")

          ## animate (credit to rgl.viewpoint() example)
          start <- proc.time()[3]
          while ((i <- 36*(proc.time()[3]-start)) < 360) {
          rgl::rgl.viewpoint(i,i/8);
          }
          } else {
          message("Please install the 'rgl' package before using this function.")
          }
          }


          Now we can call with element of the result list, eg



          pos(EOres[[1]])  # value


          and ditto for the others.






          share|improve this answer
























          • Thanks! Do you generally recommend definig a new function rather than overwriting?

            – DavveK
            Jan 10 at 12:39











          • No that was just for the example. More importantly it's a bug that I will fix. Where did you see the outdated example though?

            – Dirk Eddelbuettel
            Jan 10 at 12:44











          • I made it, my fault with price rather than underlying.

            – DavveK
            Jan 10 at 12:45











          • Yes, your call was wrong, but the bug to fix is the utils::globalVariables() call which needs to move outside the function -- this lead to the error in your Subject:. Error on my side, and I will fix it.

            – Dirk Eddelbuettel
            Jan 10 at 13:32
















          2














          Thanks for asking this question, and apologies for missing it for a few days. An issue ticket at GitHub would have been ok too.



          The code you post (and possibly quoted from old documentation of mine...) is buggy. The second argument to both EuropeanOption() and EuropeanOptionArrays() is now underlying, not price. So we make this



          library(RQuantLib)

          myStrike <- 1240
          myPrice <- 1410

          volVec <- c(0.1, 0.2, 0.3, 0.4, 0.5)
          priceVec <- c(1500,1400,1300,1200,1100)
          myType <- "put"
          rfRate <- 0.02
          maturity <- 360/360
          vol <- 0.3


          EO <- EuropeanOption(type = myType, underlying = myPrice,strike = myStrike,
          dividendYield = 0, riskFreeRate = rfRate, maturity = maturity,
          volatility = vol )
          EOres <- EuropeanOptionArrays(type = myType, underlying = priceVec,strike = myStrike,
          dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,
          volatility = volVec )
          summary(EO)
          plotOptionSurface(EOres)


          Next, in the function plotOptionSurface() we need to comment out the call to globalVariables(), this can no longer be in a function body. So make it eg



          pos <- function(EOres, ylabel="", xlabel="", zlabel="", fov=60) {
          if (requireNamespace("rgl", quietly=TRUE)) {
          #utils::globalVariables(c("clear3d", "bg3d", "ligh3d", "rgl.viewpoint", "rgl.surface", "tgl.texts"))
          axis.col <- "black"
          text.col <- axis.col
          ylab <- ylabel
          xlab <- xlabel
          zlab <- zlabel
          y <- EOres

          ## clear scene:
          rgl::clear3d()
          rgl::clear3d(type="bbox")
          rgl::clear3d(type="lights")

          ## setup env:
          rgl::bg3d(color="#DDDDDD")
          rgl::light3d()

          rgl::rgl.viewpoint(fov=fov)

          x <- 1:nrow(y)
          z <- 1:ncol(y)
          x <- (x-min(x))/(max(x)-min(x))
          y <- (y-min(y))/(max(y)-min(y))
          z <- (z-min(z))/(max(z)-min(z))
          rgl::rgl.surface(x, z, y, alpha=0.6, lit=TRUE, color="blue")
          rgl::rgl.lines(c(0,1), c(0,0), c(0,0), col=axis.col)
          rgl::rgl.lines(c(0,0), c(0,1), c(0,0), col=axis.col)
          rgl::rgl.lines(c(0,0),c(0,0), c(0,1), col=axis.col)
          rgl::rgl.texts(1,0,0, xlab, adj=1, col=text.col)
          rgl::rgl.texts(0,1,0, ylab, adj=1, col=text.col)
          rgl::rgl.texts(0,0,1, zlab, adj=1, col=text.col)

          ## add grid (credit's to John Fox scatter3d)
          xgridind <- round(seq(1, nrow(y), length=25))
          zgridind <- round(seq(1, ncol(y), length=25))
          rgl::rgl.surface(x[xgridind], z[zgridind], y[xgridind,zgridind],
          color="darkgray", alpha=0.5, lit=TRUE,
          front="lines", back="lines")

          ## animate (credit to rgl.viewpoint() example)
          start <- proc.time()[3]
          while ((i <- 36*(proc.time()[3]-start)) < 360) {
          rgl::rgl.viewpoint(i,i/8);
          }
          } else {
          message("Please install the 'rgl' package before using this function.")
          }
          }


          Now we can call with element of the result list, eg



          pos(EOres[[1]])  # value


          and ditto for the others.






          share|improve this answer
























          • Thanks! Do you generally recommend definig a new function rather than overwriting?

            – DavveK
            Jan 10 at 12:39











          • No that was just for the example. More importantly it's a bug that I will fix. Where did you see the outdated example though?

            – Dirk Eddelbuettel
            Jan 10 at 12:44











          • I made it, my fault with price rather than underlying.

            – DavveK
            Jan 10 at 12:45











          • Yes, your call was wrong, but the bug to fix is the utils::globalVariables() call which needs to move outside the function -- this lead to the error in your Subject:. Error on my side, and I will fix it.

            – Dirk Eddelbuettel
            Jan 10 at 13:32














          2












          2








          2







          Thanks for asking this question, and apologies for missing it for a few days. An issue ticket at GitHub would have been ok too.



          The code you post (and possibly quoted from old documentation of mine...) is buggy. The second argument to both EuropeanOption() and EuropeanOptionArrays() is now underlying, not price. So we make this



          library(RQuantLib)

          myStrike <- 1240
          myPrice <- 1410

          volVec <- c(0.1, 0.2, 0.3, 0.4, 0.5)
          priceVec <- c(1500,1400,1300,1200,1100)
          myType <- "put"
          rfRate <- 0.02
          maturity <- 360/360
          vol <- 0.3


          EO <- EuropeanOption(type = myType, underlying = myPrice,strike = myStrike,
          dividendYield = 0, riskFreeRate = rfRate, maturity = maturity,
          volatility = vol )
          EOres <- EuropeanOptionArrays(type = myType, underlying = priceVec,strike = myStrike,
          dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,
          volatility = volVec )
          summary(EO)
          plotOptionSurface(EOres)


          Next, in the function plotOptionSurface() we need to comment out the call to globalVariables(), this can no longer be in a function body. So make it eg



          pos <- function(EOres, ylabel="", xlabel="", zlabel="", fov=60) {
          if (requireNamespace("rgl", quietly=TRUE)) {
          #utils::globalVariables(c("clear3d", "bg3d", "ligh3d", "rgl.viewpoint", "rgl.surface", "tgl.texts"))
          axis.col <- "black"
          text.col <- axis.col
          ylab <- ylabel
          xlab <- xlabel
          zlab <- zlabel
          y <- EOres

          ## clear scene:
          rgl::clear3d()
          rgl::clear3d(type="bbox")
          rgl::clear3d(type="lights")

          ## setup env:
          rgl::bg3d(color="#DDDDDD")
          rgl::light3d()

          rgl::rgl.viewpoint(fov=fov)

          x <- 1:nrow(y)
          z <- 1:ncol(y)
          x <- (x-min(x))/(max(x)-min(x))
          y <- (y-min(y))/(max(y)-min(y))
          z <- (z-min(z))/(max(z)-min(z))
          rgl::rgl.surface(x, z, y, alpha=0.6, lit=TRUE, color="blue")
          rgl::rgl.lines(c(0,1), c(0,0), c(0,0), col=axis.col)
          rgl::rgl.lines(c(0,0), c(0,1), c(0,0), col=axis.col)
          rgl::rgl.lines(c(0,0),c(0,0), c(0,1), col=axis.col)
          rgl::rgl.texts(1,0,0, xlab, adj=1, col=text.col)
          rgl::rgl.texts(0,1,0, ylab, adj=1, col=text.col)
          rgl::rgl.texts(0,0,1, zlab, adj=1, col=text.col)

          ## add grid (credit's to John Fox scatter3d)
          xgridind <- round(seq(1, nrow(y), length=25))
          zgridind <- round(seq(1, ncol(y), length=25))
          rgl::rgl.surface(x[xgridind], z[zgridind], y[xgridind,zgridind],
          color="darkgray", alpha=0.5, lit=TRUE,
          front="lines", back="lines")

          ## animate (credit to rgl.viewpoint() example)
          start <- proc.time()[3]
          while ((i <- 36*(proc.time()[3]-start)) < 360) {
          rgl::rgl.viewpoint(i,i/8);
          }
          } else {
          message("Please install the 'rgl' package before using this function.")
          }
          }


          Now we can call with element of the result list, eg



          pos(EOres[[1]])  # value


          and ditto for the others.






          share|improve this answer













          Thanks for asking this question, and apologies for missing it for a few days. An issue ticket at GitHub would have been ok too.



          The code you post (and possibly quoted from old documentation of mine...) is buggy. The second argument to both EuropeanOption() and EuropeanOptionArrays() is now underlying, not price. So we make this



          library(RQuantLib)

          myStrike <- 1240
          myPrice <- 1410

          volVec <- c(0.1, 0.2, 0.3, 0.4, 0.5)
          priceVec <- c(1500,1400,1300,1200,1100)
          myType <- "put"
          rfRate <- 0.02
          maturity <- 360/360
          vol <- 0.3


          EO <- EuropeanOption(type = myType, underlying = myPrice,strike = myStrike,
          dividendYield = 0, riskFreeRate = rfRate, maturity = maturity,
          volatility = vol )
          EOres <- EuropeanOptionArrays(type = myType, underlying = priceVec,strike = myStrike,
          dividendYield = 0,riskFreeRate = rfRate, maturity = maturity,
          volatility = volVec )
          summary(EO)
          plotOptionSurface(EOres)


          Next, in the function plotOptionSurface() we need to comment out the call to globalVariables(), this can no longer be in a function body. So make it eg



          pos <- function(EOres, ylabel="", xlabel="", zlabel="", fov=60) {
          if (requireNamespace("rgl", quietly=TRUE)) {
          #utils::globalVariables(c("clear3d", "bg3d", "ligh3d", "rgl.viewpoint", "rgl.surface", "tgl.texts"))
          axis.col <- "black"
          text.col <- axis.col
          ylab <- ylabel
          xlab <- xlabel
          zlab <- zlabel
          y <- EOres

          ## clear scene:
          rgl::clear3d()
          rgl::clear3d(type="bbox")
          rgl::clear3d(type="lights")

          ## setup env:
          rgl::bg3d(color="#DDDDDD")
          rgl::light3d()

          rgl::rgl.viewpoint(fov=fov)

          x <- 1:nrow(y)
          z <- 1:ncol(y)
          x <- (x-min(x))/(max(x)-min(x))
          y <- (y-min(y))/(max(y)-min(y))
          z <- (z-min(z))/(max(z)-min(z))
          rgl::rgl.surface(x, z, y, alpha=0.6, lit=TRUE, color="blue")
          rgl::rgl.lines(c(0,1), c(0,0), c(0,0), col=axis.col)
          rgl::rgl.lines(c(0,0), c(0,1), c(0,0), col=axis.col)
          rgl::rgl.lines(c(0,0),c(0,0), c(0,1), col=axis.col)
          rgl::rgl.texts(1,0,0, xlab, adj=1, col=text.col)
          rgl::rgl.texts(0,1,0, ylab, adj=1, col=text.col)
          rgl::rgl.texts(0,0,1, zlab, adj=1, col=text.col)

          ## add grid (credit's to John Fox scatter3d)
          xgridind <- round(seq(1, nrow(y), length=25))
          zgridind <- round(seq(1, ncol(y), length=25))
          rgl::rgl.surface(x[xgridind], z[zgridind], y[xgridind,zgridind],
          color="darkgray", alpha=0.5, lit=TRUE,
          front="lines", back="lines")

          ## animate (credit to rgl.viewpoint() example)
          start <- proc.time()[3]
          while ((i <- 36*(proc.time()[3]-start)) < 360) {
          rgl::rgl.viewpoint(i,i/8);
          }
          } else {
          message("Please install the 'rgl' package before using this function.")
          }
          }


          Now we can call with element of the result list, eg



          pos(EOres[[1]])  # value


          and ditto for the others.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 10 at 3:12









          Dirk EddelbuettelDirk Eddelbuettel

          277k37514603




          277k37514603













          • Thanks! Do you generally recommend definig a new function rather than overwriting?

            – DavveK
            Jan 10 at 12:39











          • No that was just for the example. More importantly it's a bug that I will fix. Where did you see the outdated example though?

            – Dirk Eddelbuettel
            Jan 10 at 12:44











          • I made it, my fault with price rather than underlying.

            – DavveK
            Jan 10 at 12:45











          • Yes, your call was wrong, but the bug to fix is the utils::globalVariables() call which needs to move outside the function -- this lead to the error in your Subject:. Error on my side, and I will fix it.

            – Dirk Eddelbuettel
            Jan 10 at 13:32



















          • Thanks! Do you generally recommend definig a new function rather than overwriting?

            – DavveK
            Jan 10 at 12:39











          • No that was just for the example. More importantly it's a bug that I will fix. Where did you see the outdated example though?

            – Dirk Eddelbuettel
            Jan 10 at 12:44











          • I made it, my fault with price rather than underlying.

            – DavveK
            Jan 10 at 12:45











          • Yes, your call was wrong, but the bug to fix is the utils::globalVariables() call which needs to move outside the function -- this lead to the error in your Subject:. Error on my side, and I will fix it.

            – Dirk Eddelbuettel
            Jan 10 at 13:32

















          Thanks! Do you generally recommend definig a new function rather than overwriting?

          – DavveK
          Jan 10 at 12:39





          Thanks! Do you generally recommend definig a new function rather than overwriting?

          – DavveK
          Jan 10 at 12:39













          No that was just for the example. More importantly it's a bug that I will fix. Where did you see the outdated example though?

          – Dirk Eddelbuettel
          Jan 10 at 12:44





          No that was just for the example. More importantly it's a bug that I will fix. Where did you see the outdated example though?

          – Dirk Eddelbuettel
          Jan 10 at 12:44













          I made it, my fault with price rather than underlying.

          – DavveK
          Jan 10 at 12:45





          I made it, my fault with price rather than underlying.

          – DavveK
          Jan 10 at 12:45













          Yes, your call was wrong, but the bug to fix is the utils::globalVariables() call which needs to move outside the function -- this lead to the error in your Subject:. Error on my side, and I will fix it.

          – Dirk Eddelbuettel
          Jan 10 at 13:32





          Yes, your call was wrong, but the bug to fix is the utils::globalVariables() call which needs to move outside the function -- this lead to the error in your Subject:. Error on my side, and I will fix it.

          – Dirk Eddelbuettel
          Jan 10 at 13:32


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53971066%2fnamespace-locked-for-rquantlib%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          EcL4FulF,J v4K CpmLdfzYzs6PLgsUR5LtCfa40Kpoj5
          x0tpF2SHUC2Q8ohjssXbI2K5 Wkcj,svB1xeaLDXydDCXz1CUfbVo2o,O

          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas