Displaying 20 results from an estimated 9000 matches similar to: "NAMESPACE"
2011 Jun 23
1
Class not found when search in .onLoad
Hi,
I am facing with a strange behaviour of isClass and extends when these
are called in .onLoad in both R 2.12.1 and R 2.13.0. This is preventing
my package from doing some object initializations at a proper place
(i.e. in .onLoad).
Suppose one defines two S4 classes in a package, and that one needs to
check the inheritance between these two when loading the package (e.g.
to validate slots
2005 Aug 27
2
Writing R-extensions
G'day all,
After reading through "Writing R Extensions", Version 2.1.1
(2005-06-20), I thought the the following points might need
clarifications or corrections. (I checked that these comments also
hold for "Writing R Extensions", Version 2.2.0.)
1) When I ran "package.skeleton" recently, I noticed that the
DESCRIPTION file and an entry `type'. This
2004 Mar 16
2
Documentation on how to put classes and methods in packages with namespace?
Documentation on how to put classes and methods in packages with namespace?
How should I define my classes and methods in "dynamicGraph"???
(That is - Can some one point me to the documentation on
how to put classes and methods in packages with a namespace? )
Currently it is done by the code below.
This gives problems, when a workspace with a "dynmaicGraph" is
2006 Apr 13
1
Wishlist: 'quietly' argument for .onAttach() / .First.li b()
From: Prof Brian Ripley
>
> On Thu, 13 Apr 2006, Peter Ruckdeschel wrote:
>
> > Hi R-devels,
> >
> > in "Writing R extensions" as well as in the help
> > to .onAttach(), you mention that one could
> > use this function to issue a start-up message/banner
> > for the package.
> >
> > My little wish for Easter:
> >
> > a
2011 Jan 26
1
Problem with "setMethod" in R package
Dear all,
My apologies for re-posting this question, but I have not found any
solution to my problem so far. I also think that my post may have been
overseen due to the posting time and high traffic on this list.
I experience a problem in implementing a S4 class in a package and would
appreciate your help in this matter.
The class is implemented using Rcpp, which works well. I then extend
2011 Sep 14
1
[Q] Package NS Hook Lint NOTE
Have a question about the following NOTEs appearing on CRAN checks:
> .onLoad calls:
> require(methods)
>
> Package startup functions should not change the search path.
> See section ?Good practice? in ?.onAttach.
For years, I have had the following in my S4-requiring packages.
##---------------------------------------------------------------------
.onLoad <-
2011 Jul 22
1
Problem with creating default NAMESPACE on FreeBSD
After building and installing R-devel from 21/07/2011 on FreeBSD
9.0-CURRENT (amd64), starting R gives the following warning:
[..snip..]
Beim Start - Warnmeldung:
package 'datasets' in options("defaultPackages") was not found
This happens with all versions after 14/07/2011. I think it is related to
NEWS Sat, 16 Jul 2011
CHANGES IN R-devel PACKAGE INSTALLATION
Packages without
2024 Mar 06
1
Never exporting .__global__ and .__suppressForeign__?
Hello,
(Dear Richard, I hope you don't mind being Cc:'d on this thread in
R-devel. This is one of the ways we can prevent similar problems from
happening in the future.)
Sometimes, package authors who use both exportPattern('.') and
utils::globalVariables(...) get confusing WARNINGs about undocumented
exports:
https://stat.ethz.ch/pipermail/r-package-devel/2024q1/010531.html
I
2006 Apr 13
4
Wishlist: 'quietly' argument for .onAttach() / .First.lib()
Hi R-devels,
in "Writing R extensions" as well as in the help
to .onAttach(), you mention that one could
use this function to issue a start-up message/banner
for the package.
My little wish for Easter:
a 'quietly'-type argument for .onAttach() / .First.lib()
which is passed through by functions
require() and library() respectively,
and by means of which one could optionally
2013 Jul 26
1
How to best implement package options?
Dear developeRs,
I have a package, pls, that implements package options. The users are
supposed to use a function pls.options() to manipulate them.
If a user changes the options, they are stored in .GlobalEnv. I was
recently informed that this is against current CRAN submission policies,
so I need to change that.
I have looked at several different packages that implement package
options, and
2004 Mar 16
0
VS: Documentation on how to put classes and methods in packages with namespace?
> -----Oprindelig meddelelse-----
> Fra: Jens Henrik Badsberg
> Sendt: 16. marts 2004 11:37
> Til: 'r-help@stat.math.ethz.ch'
> Emne: Documentation on how to put classes and methods in packages with namespace?
>
>
> Documentation on how to put classes and methods in packages with namespace?
>
> How should I define my classes and methods in
2014 Jul 06
0
useDynLib
I would like to be able to load two versions of a package at once and
to do that was thinking of giving each version a different package
name in the DESCRIPTION file and the building and installing each such
version separately.
library(myPkg1)
library(myPkg2)
and then use myPkg1::myFun() and myPkg2::myFun().
To do that easily it would be convenient if one could change the
package name in only
2004 Apr 14
1
Re: [R] Execute function at startup
I think you can already do this via .First(). If you start your .First with something like this [give or take some parentheses]
if( !is.null( runfirst <- Sys.getenv( 'RUNFIRST')))
try( eval( parse( text=runfirst))))
then whatever you pass in as RUNFIRST=... should get executed on startup. Could even be a call to source(...) if you want to source a particular file. I have a similar
2009 Mar 31
4
what is the preferred method to create a package local variable?
for the moment, I'm using:
.onAttach <- function(libname, pkgname) {
.bbg.db.conn <<- dbConnect(dbDriver("PostgreSQL"), user="blah","blah")
}
.onUnload <- function(libpath) {
dbDisconnect(.bbg.db.conn)
}
which results in a hidden global variable in the global environment.
I would prefer to make the assignment only in the package namespace.
2012 May 24
1
New S3 methods for optional package
Hi,
I have asked this question before, but the solution I ended up with (see
below) creates a note when running R CMD check. So I am trying again...
I am developing a package B that, among other things, also offers some
extra S3-methods for functions in package A if the user has installed A.
I do not want to list A under Depends of B, as the dependency list of A
is rather long, and most
2007 Feb 20
1
Custom per-package options passed down via library() ?
I want to load an in-house library 'differently' in a particular context and,
to achieve this, would like to govern the behaviour of its .onLoad()
function.
In a related context, Frank Harrell and I have been wondering on and off
about how to tell Hmisc to be less verbose in certain situations. He
achieves this by placing information in a custom field in options().
I could do the same
2012 Apr 07
4
Display instruction text on package load
I'm currently working on a new package for R that interfaces with an API.
Most of the package's functionality requires users to supply an access key
that allows the package to work with the API. I want to display text
immediately upon loading the package that instructs/reminds users to enter
their access key before attempting to do anything (as the package won't
really work without
2005 Nov 21
2
NAMESPACE, S4, and .onLoad
The Writing R Extensions manual instructs developers who use S4
classes and methods in a package with a name space to:
There needs to be an .onLoad action to ensure that the methods package
is loaded and attached:
.onLoad <- function(lib, pkg) require(methods)
I'm wondering if listing methods in the Depends field of the package's
DESCRIPTION file is sufficient.
2008 Mar 08
1
R cmd check error reg namespace
Hi,
When running R CMD check I'm getting a number of errors that I don't
quite follow and don't know where to start looking for an answer, any
hints appreciated.
R CMD check trunk
* checking for working latex ... OK
* using log directory '/Users/ivisser/Documents/projects/
depmixProject/depmixNew/rforge/depmix/trunk.Rcheck'
* using R version 2.6.2 (2008-02-08)
* checking
2011 Jan 23
0
setMethod call in package code using Rcpp
Dear all,
I experience a problem in implementing a S4 class in a package and would
appreciate your help in this matter.
The class is implemented using Rcpp, which works well. I then extend the
class with R functions, adding them as methods with a call to
setMethod(...). When I do this outside the package (after loading the
package with "library(...)"), everything works smoothly.