[S] Splus 5.0 Release 2 --- Problem with library()

Diego Kuonen (Diego.Kuonen@epfl.ch)
Wed, 25 Nov 1998 12:48:38 +0100


Dear Splus users,

I use Splus Version 5.0 Release 2 for Sun SPARC, SunOS 5.5.

Everything works fine, except loading one of the standard
libraries (by means of library()), say we want to load the trellis library:

...> library(trellis,first=T)
Problem in objects(where, meta = 2): Can't interpret as a database: names(object) has
length 0, != length object (3)
Use traceback() to see the call stack

I tried to look at the function(s) in details:

...> library
function(section = NULL, first = F, help = NULL, pos, lib.loc = paste(getenv("SHOME"),
"library", sep = "/"))
{
value = NULL
# user may want to assign lib.loc on where=0 in her .First().
# if given as argument, we ignore the stored version entirely
# we always search $SHOME/library, but after the others on the list
....
setDBStatus(value, F)
}
}
invisible(value)
}

Until the call of setDBStatus(value, F) everything works fine:

...> value
An object of class "attached"

Slot "name":
[1] "trellis"

Slot "class":
[1] "character"

Slot "id":
[1] 498658 8388615

Looking at setDBStatus() yields:

..> setDBStatus
## for each database, set status, `writable' can be logical to turn
## write permission on and off. Alternately, it can be one of the character-strings
## `"read"', `"readwrite"', or `"modified"'.
function(where, writable)
{
dbset2 = function(where, meta, writable)
{
if(is.logical(writable)) {
if(writable) {
if(database.status(where, meta = meta) !=
"read")
return()
writable = "readwrite"
}
else writable = "read"
}
database.status(where, meta = meta) = writable
}
dbset2(where, 0, writable)
if(is.character(objects(where, meta = 1)))
dbset2(where, 1, writable)
if(is.character(objects(where, meta = 2)))
dbset2(where, 2, writable)
}

Here's the output (note that where=value, writable=F)

...> dbset2(value, 0, F)
[1] "read"

...> is.character(objects(value, meta = 1))
[1] T
.
..> dbset2(value, 1, F)
[1] "read"

...> is.character(objects(value, meta = 2))
Problem in objects(value, meta = 2): Can't interpret as a database: names(object) has
length 0, != length object (3)

...> objects(value, meta = 2)
Problem in objects(value, meta = 2): Can't interpret as a database: names(object) has
length 0, != length object (3)

...> dbset2(value, 2, F)
Problem in database.status(where, meta = meta) = wri..: Can't interpret as a database:
names(object) has length 0, != length object (3)

And finally, looking in details at the function objects():

...> .Internal(objects(value, meta = 2), "S_dictionary", T,5)
Problem: Can't interpret as a database: names(object) has length 0, != length object (3)

Why does the interface to the built-in C code deliver this message?

Do I just have to set some paths?

Or, what's wrong?

Thanks in advance,

Diego Kuonen

--------------------------------------------------------------
Diego Kuonen
Department of Mathematics, EPFL, 1015 Lausanne, Switzerland
Phone: + 41 (0)21 693 5508
Fax : + 41 (0)21 693 4250
mailto:Diego.Kuonen@epfl.ch
http://dmawww.epfl.ch/~kuonen
http://statwww.epfl.ch/~kuonen
--------------------------------------------------------------

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news