Displaying 20 results from an estimated 600 matches similar to: "package.skeleton() in R-2.4.1"
2011 Aug 03
1
NAMESPACE problems
Hi.
I am having difficulty following section 1.6.6 of the R-extensions manual.
I am trying to update the Brobdingnag package to include a NAMESPACE file (the
untb package requires the Brobdingnag package).
Without the NAMESPACE file, the package passes R CMD check cleanly.
However, if I include a NAMESPACE file, even an empty one, R CMD check
gives the following error in 00install.out:
2006 Oct 31
1
setReplaceMethod
Hi
If x <- 1:10 then x[5] <- 1i will promote
x to be a complex vector.
Suppose I have an S4 class "brob", and have functions
is.brob(), as.brob(), as.numeric() and so forth (minimal self-contained
code below).
If x is numeric (1:10, say) and y is a brob, what
is the best way to make
x[5] <- y
promote x to a brob in the same way as the complex example?
Or is
2006 Sep 15
1
setMethod() woes
Hello everybody
R version 2.4.0 alpha (2006-09-15 r39323), MacOSX 10.4.7
Next S4 problem.
I have "brob" objects that are large real numbers, and now I want "glub"
numbers that are to be a pair of glubs that represent complex numbers.
I want to define binary operator "+" so that if either the left or right
argument are glubs, it uses .ArithGlub.
If either
2006 Aug 30
1
setMethod() and log()
Hi
I am having difficulty with setMethod(). I have a "brob" class of
objects whose
representation has two slots: "x" and "positive". Slot "x" (double)
holds the log
of a number and slot "positive" (logical) its sign. The idea is
that large numbers
can be handled.
I'm trying to implement a log() method using an analogue of the
2006 Sep 04
1
setMethod("Summary")
Hi everyone and thanks for being patient. I've used "!.foo"() et
seq pro tem.
Next problem: how to define "Summary" methods for brobs.
?max says
'max' and 'min' are generic functions: methods can be defined for
them individually or via the 'Summary' group generic. For this to
work properly, the arguments '...' should be
2008 May 28
1
indexing lists, using brobdingnagian
Dear R-Gurus,
I have ended up with a calculation problem where I need to use brobs.
I have to work my way through a vector with a for loop to act on each
element in a calculation (refering to the previous
value in the new vector of results -- so as far as I know I can't use
"apply") -- this produces a list of brobs.
My problem is, how do I act on, plot this list, or do vector
2009 Oct 27
1
How to reduce key strokes when defining S4 classes?
I feel tedious when I define a S4 class and the methods. For each
method, I have to call both setMethod and setGeneric (or both
setReplaceMethod and setGeneric). I would like a more compact grammar
so that I can reduce the key strokes. I'm wondering if there is a
better way available.
setClass(
Class='A',
representation=representation(
x='numeric'
)
2006 Sep 01
1
setMethod("Logic", ...)
Hi
In V&R the "polynomial" class is explicitly specified to have no
logical operators:
setMethod("Logic", signature(e1="polynomial"), function(e1,e2){stop
("...")})
I too have a class of objects for which I want to
specify that Logic operators do not work, but executing
setClass("brob",
representation = representation
2013 Sep 23
1
tar warnings in R-3.0.2 RC when R is installed by a different (non-root) user
Hi,
I created a package as follows:
> a = 1
> package.skeleton()
Then I got the following output when building the package:
* checking for file ?anRpackage/DESCRIPTION? ... OK
* preparing ?anRpackage?:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* looking to see if a ?data/datalist?
2008 Oct 06
2
why is \alias{anRpackage} not mandatory?
Dear R developers,
if one uses package.skeleton() to create a new package, then a file
anRpackage.Rd with the following entries is prepared:
\name{anRpackage-package}
\alias{anRpackage-package}
\alias{anRpackage}
\docType{package}
Packages created this way have a definite entry or overview page, so:
?anRpackage
gives new users of a certain package a pointer where to start reading.
This is
2011 Aug 26
1
R.oo data members / inheritance
If someone is able, can you tell me if there is a better way to do this?
More specifically, do I have to rewrite all of the data members stuff and
extend stuff of parent class in the child class? See below. Thanks in
advance!
Example 1:
setConstructorS3("ClassA", function(A,x) {
if(missing(A))A=15;
if(missing(x))x=NA;
extend(Object(), "ClassA",
.size = A,
.x=x
2010 Oct 08
2
Error message in as.brob Usage
I am getting the following error message while using the as.brob function in
some computations:
Error in out.x[ss] <- pmax(x1[ss], x2[ss]) + log1p(+exp(-abs(x1[ss] - :
NAs are not allowed in subscripted assignments
Is there any obvious mistake I am making here that can resolve the above
error message?
Thanks for your help.
Chow
--
View this message in context:
2009 Nov 12
1
S4 objects in the data directory
Hi
[R-2.10.0; suse linux]
I am having difficulty creating S4 objects in the data directory of a
package. I want
to create a bunch of simple S4 objects for use in the examples section
of the Rd files.
It says in R-exts that:
" R code should be ?self-sufficient? and not make use of extra
functionality provided by the package, so that the data file can also be
used without having to load
2018 Dec 08
2
Solr
After some testsing, I managed to get proper functionning
- The schema.xml is attached below (quite different from the one
provided on teh wiki) (in bold the core differences) (NGramFilterFactory
is the class that replace the fts_squat "partial=3 full=15", everything
else is just a big hammer to smash a tiny fly)
- One need to remove the "managed-schema" file in the
2011 Aug 19
3
installing packages systemwide
I installed some downloaded packages in R. I always do
$sudo R CMD INSTALL <anRpackage.tar.gz>
By default it is storing these packages into my directory
/home/mary/R/x86_64-pc-linux-gnu-library/2.13/.
However I want them to be systemwide into /usr/local/lib/R/site-library/
folder.
I tried
$sudo R
R> install.packages("anRpackage", dep=TRUE)
I did not succeed into getting
2011 Aug 19
3
installing packages systemwide
I installed some downloaded packages in R. I always do
$sudo R CMD INSTALL <anRpackage.tar.gz>
By default it is storing these packages into my directory
/home/mary/R/x86_64-pc-linux-gnu-library/2.13/.
However I want them to be systemwide into /usr/local/lib/R/site-library/
folder.
I tried
$sudo R
R> install.packages("anRpackage", dep=TRUE)
I did not succeed into getting
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
2007 Aug 30
7
Behaviour of very large numbers
Dear all,
I am struggling to understand this.
What happens when you raise a negative value to a power and the result
is a very large number?
B
[1] 47.73092
> -51^B
[1] -3.190824e+81
# seems fine
# now this:
> x <- seq(-51,-49,length=100)
> x^B
[1] NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN <snip>
> is.numeric(x^B)
[1] TRUE
> is.real(x^B)
[1]
2008 Oct 23
1
Getting the panel location of a xyplot matrix using a mouse click in a GDCanvas
Hi:
I would like to find out the panel of a xyplot matrix where a mouse clicked.
I know this functionality is already bundled in trellis.focus but I can't
use it because I am coding a stand alone application in Java using with
GDCanvas as a graphics device.
I tried calling trellis.focus from Java with:
re.eval("t = trellis.focus()"));
However it did not work for an embedded
2020 Feb 18
2
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
I am trying to create a class union of class unions to facilitate method
dispatch. When I execute code in the global environment, everything acts as
expected, however when I put the same code in the context of a package,
selectMethod can no longer find the correct method. This first block below
puts the code in the context of a package:
fn <- "codefile.R"
writeLines(
c(