[R-SIG-Finance] object .blotter not found
gsee000 at gmail.com
Sun May 6 16:31:32 CEST 2012
My guess is that either you used a "clear workspace" button on your
GUI, or you did something to the effect of rm(list=ls(all=TRUE)).
.blotter is an environment that is stored under your .GlobalEnv when
you load the package. If you delete it, you have to put it back with
something like this
if (!exists('.blotter')) .blotter <- new.env()
Prior to 2012, the .instrument environment was also stored in the
.GlobalEnv, but with FinancialInstrument version 0.10.0, it was moved
to live in the top level of the package. Therefore, the .instrument
environment doesn't get wiped out if the user clears their workspace.
But, it appears to be missing unless you know where to look.
This should work
But, it's not as robust as using
.blotter should probably be moved out of the .GlobalEnv as well, but
for now, either don't clear your .GlobalEnv, or recreate a .blotter
environment after you do.
On Sun, May 6, 2012 at 1:23 AM, Peter Chan <heypeterchan at yahoo.com> wrote:
> Hi there
> I am running demo(longtrend) but it is failing on initPortf (although the blotter package is loaded):
>> ltportfolio='longtrend' > ltaccount='longtrend' > initPortf(ltportfolio,'GSPC', initDate=initDate) Error in exists(paste("portfolio", name, sep = "."), envir = .blotter, : object '.blotter' not found
> Any ideas? I also noticed that .instrument environment isn't found in my workspace, but I can use getInstrument!
>> ls(envir=.instrument) Error in ls(envir = .instrument) : object '.instrument' not found > getInstrument('USD') primary_id :"USD"
> currency :"USD"
> multiplier :1
> tick_size :0.01
> identifiers: list()
> type :"currency" > ls(envir=.blotter) Error in ls(envir = .blotter) : object '.blotter' not found
>> sessionInfo() R version 2.15.0 (2012-03-30)
> Platform: x86_64-pc-mingw32/x64 (64-bit) locale:
>  LC_COLLATE=English_Singapore.1252 LC_CTYPE=English_Singapore.1252
>  LC_MONETARY=English_Singapore.1252 LC_NUMERIC=C
>  LC_TIME=English_Singapore.1252 attached base packages:
>  stats graphics grDevices utils datasets methods base other attached packages:
>  blotter_0.8.8 FinancialInstrument_0.14.2 quantmod_0.3-17
>  TTR_0.21-1 xts_0.8-6 zoo_1.7-7
>  Defaults_1.1-1 loaded via a namespace (and not attached):
>  grid_2.15.0 lattice_0.20-6 tools_2.15.0
> [[alternative HTML version deleted]]
> R-SIG-Finance at r-project.org mailing list
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
More information about the R-SIG-Finance