s-news
[Top] [All Lists]

Re: creating libraries

To: Joe Cerniglia <cj5815@yahoo.com>
Subject: Re: creating libraries
From: Tim Hesterberg <timh@insightful.com>
Date: 25 Nov 2005 11:44:21 -0800
Cc: s-news@lists.biostat.wustl.edu
In-reply-to: <20051125182945.71455.qmail@web50209.mail.yahoo.com> (message from Joe Cerniglia on Fri, 25 Nov 2005 10:29:44 -0800 (PST))
References: <20051125182945.71455.qmail@web50209.mail.yahoo.com>
library() attached read-only.
You could use attach() instead.

Also, you might like to use
        createChapter()
        sourceChapter()

Tim Hesterberg

>I am trying to create a library and load data and
>functions into that library.  I get the following
>error message when I run the code:
>
>Problem in assign(mylib.funcs[1], get(mylib.funcs[1]),
>wh..: database "mylib" is read-only 
>Use traceback() to see the call stack
>
>
>#
>#code
>#
>
>
>mkdir("c:\\temp\\mylib")
>mkdir("c:\\temp\\mylib\\.Data")
>mkdir("c:\\temp\\mylib\\.Prefs")
>mkdir("c:\\temp\\mylib\\.Data\\_Help")
>
>my.sqrt <- function(x)
>{
>       y <- sqrt(x)
>       cat("\nThe square root of ", x, " is ", y, ".\n", sep
>= "")
>       invisible(y)
>}
>
>library(mylib, pos=2, lib.loc = "c:\\temp\\")
>mylib.funcs<-c("my.sqrt")
>assign(mylib.funcs[1], get(mylib.funcs[1]),where=2)

========================================================
| Tim Hesterberg       Research Scientist              |
| timh@insightful.com  Insightful Corp.                |
| (206)802-2319        1700 Westlake Ave. N, Suite 500 |
| (206)283-8691 (fax)  Seattle, WA 98109-3012, U.S.A.  |
|                      www.insightful.com/Hesterberg   |
========================================================
Download the S+Resample library from www.insightful.com/downloads/libraries

Two Research Scientist positions:
        data mining
        frailty/mixed effects
    http://www.insightful.com/company/jobs.asp

Speak out about biased science in Washington D.C.
    http://home.comcast.net/~timhesterberg/ScientificIntegrity.html


<Prev in Thread] Current Thread [Next in Thread>