Skip to content
Prev 31058 / 63421 Next

particulars of importing/loading libraries

Sorry Simon, you are right. I tried to recreate a problem that I had
with other packages where the packages were added to Depends but made a
mistake. However the problem remains if I do the following.

Added: pack1 to Depends of pack2. Now I create pack3 with the following
contents: it does not import pack1 directly, nor depends on it. It
rather imports pack2 and depends on pack2. I then expect the
functionality of pack1 to be available still if I only load pack3. But I
now get errors with pack3 calling the function from pack1. Does this
mean I need to import and depend on pack1 and methods explicitly in
pack3. I.e. do I have to import and depend on ALL the packages that may
be in use, even if they are imported by other that I depend on and
import:

---- pack3: DESCRIPTION -----

Package: pack3
Version: 0.0.1
Date: 12 Jan 2009
Title: pack1 to test S3/S4 methods compatibility
Author:  Oleg Sklyar
Depends: R (>= 2.7.1), pack2
Maintainer: Oleg Sklyar <osklyar at maninvestments.com>
Description: pack3
LazyLoad: yes
License: Proprietary
URL: http://www.maninvestments.com
LazyLoad: no

---- pack3: NAMESPACE ------
import(pack2)
exportPattern("^[^\\.]")

---- pack3: posix.R ------
testPosix2 = function() {
    z = as.POSIXct(testPosixVal)
    print(z)
    print(class(z))
    z
}

Note, that the above function is the same as in pack2, just a different
name.


*** R 2.9.0 (svn -r 46585) [/share/research/R-devel/20081002/lib64/R]
***
Loading required package: pack2
Loading required package: pack1
[1] "2009-01-13 15:29:50 UTC"
[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"




Dr Oleg Sklyar
Research Technologist
AHL / Man Investments Ltd
+44 (0)20 7144 3107
osklyar at maninvestments.com
**********************************************************************
Please consider the environment before printing this email or its attachments.
The contents of this email are for the named addressees ...{{dropped:19}}