Skip to content
Prev 31062 / 63424 Next

particulars of importing/loading libraries

Well, this is very reasonable and this is how it should be I would say.
If it was consistent, there would be no problem as they would be easy to
nail down. However, the problem is now that if I load pack3 only (which
imports pack2 only) then as.POSIXct exported from pack1 is NOT available
for functions in pack3, but is available for calls from the global env
(see example below). It is obviously available for calls from functions
in pack2 as there it is imported directly. Although, why also
testPosix() of pack2 is then available for calls from the global env as
it was only loaded as import for pack3?

In my understanding if pack3 does not depend on pack1 directly,
functionality of pack1 should not be available anywhere apart from
functions called from pack2 as well as functions in pack2 should only be
available for calls by functions in pack3 but not in the global env...
The semantics seems to be broken here, is it not?
Loading required package: pack2
Loading required package: pack1
[1] "2009-01-13 15:29:50 UTC"
[1] "POSIXt"  "POSIXct"
[1] "2009-01-13 15:29:50 UTC"
Error in as.POSIXct.default(testPosixVal) : 
  do not know how to convert 'testPosixVal' to class "POSIXlt"
[1] "2009-01-13 15:29:50 UTC"



Dr Oleg Sklyar
Research Technologist
AHL / Man Investments Ltd
+44 (0)20 7144 3107
osklyar at maninvestments.com