Displaying 20 results from an estimated 11000 matches similar to: ""privileged slots""
2004 Oct 25
1
usage and behavior of 'setIs'
Hello,
am I using 'setIs' in the correct way in the subsequent (artifical) example?
Do I have to specify explicit 'setAs' for 'list' and 'vector' or
should this work automatically, since "getClass("List1")" states
an explicit coerce also for these classes.
I'm working with R 2.0.0 Patched (2004-10-06) on windows 2000.
Thanks for your
2004 Dec 30
2
is.vector(...) <-> is(..., "vector")
Hello,
Is it intended that is.vector(...) and is(..., "vector")
do not always give identical results?
is.vector() works as documented ('is.vector' returns
'FALSE' if 'x' has any attributes except names.)
Thus,
A <- array(1:2, 1:2)
M <- diag(2)
is.vector(M) # FALSE, as documented
# and
is.vector(A) # FALSE, as documented
# however
is(M,
2004 Jan 30
2
request for comments --- package "distr" --- S4 Classes for Distributions
Hello,
after some discussions with Martin Maechler and Josef Leydold (WU Wien),
we have felt the need for some package that should allow for an
object-orientated
approach to distributions.
Our small group at Bayreuth now has developed a package "distr" which
tries to fill this gap, implementing distributions by means of
S4--classes.
A mother class "Distribution" is
2004 Jan 15
1
Exactness of ppois
Hello,
by checking the precision of a convolution algorithm, we found the
following "inexactness":
We work with R Version 1.8.1 (2003-11-21) on Windows systems (NT, 2000,
XP).
Try the code:
## Kolmogorov distance between two methods to
## determine P(Poisson(lambda)<=x)
Kolm.dist <- function(lam, eps){
x <- seq(0,qpois(1-eps, lambda=lam), by=1)
max(abs(ppois(x,
2006 Jan 03
1
S4 default initialization: unwanted NULL
The default initialization for slots of class "factor" and
"data.frame" gives NULL. This seems odd, since those slots can't ever
be set to NULL by the user. I would expect zero-length instances of
factor and data.frame.
Here is an example:
setClass("FOO", representation(a="factor", b="data.frame", c="numeric"))
[1] "FOO"
2004 Oct 14
2
setClassUnion
Hello,
I have a question concerning "setClassUnion".
I'm working with R 2.0.0 Patched (2004-10-06) on windows 2000.
I tried to use "setClassUnion" in a package I am currently working on. The
situation is similar to the following example:
The DESCRIPTION file has entries:
Depends: R (>= 2.0.0), methods
Imports: methods
LazyLoad: yes
The NAMESPACE file has
2004 Oct 14
2
setClassUnion
Hello,
I have a question concerning "setClassUnion".
I'm working with R 2.0.0 Patched (2004-10-06) on windows 2000.
I tried to use "setClassUnion" in a package I am currently working on. The
situation is similar to the following example:
The DESCRIPTION file has entries:
Depends: R (>= 2.0.0), methods
Imports: methods
LazyLoad: yes
The NAMESPACE file has
2006 Feb 09
4
New user: Custom probability distribution
Hello,
Given a probability function: p(x) = 12 / (25(x+1)) , x=0, 1, 2, 3 we
generate the following values:
C1 C2
0 0.48
1 0.24
2 0.16
3 0.12
Now, I'm supposed to create 50 random values using this table. In
MiniTab, I simply selected Calc -> Random Data -> Discrete, and selected
the columns, and it created 50 random values in a new column.[1]
How do I do the
2024 Sep 27
1
Disabling S4 primitive dispatch during method resolution affects namespace load actions
Hello,
This problem originally surfaced as an interaction between 'brms',
'rstan' and 'Rcpp' [1]: a call to dimnames() from the 'brms' package on
an object of an S4 class owned by the 'rstan' package tried to load its
namespace. rstan:::.onLoad needs to load Rcpp modules, which uses load
actions and reference classes. Since methods:::.findInheritedMethods
2024 Sep 27
1
Disabling S4 primitive dispatch during method resolution affects namespace load actions
>>>>> Ivan Krylov via R-devel
>>>>> on Fri, 27 Sep 2024 13:32:27 +0300 writes:
> Hello,
> This problem originally surfaced as an interaction between 'brms',
> 'rstan' and 'Rcpp' [1]: a call to dimnames() from the 'brms' package on
> an object of an S4 class owned by the 'rstan' package tried to
2004 Jun 26
1
S4 group "Math", "getGroupMembers", "genericForPrimitive"
Hi,
I found the following on Windows 2000/NT
R Version 1.9.1 (2004-06-21) (also Version 1.9.0):
The S4 group "Math" doesn't work as documented; i.e., "log", "log10",
"gamma" and "lgamma" are included
in the documentation but don't work. See example code below.
Moreover, what about 'genericForPrimitive' which is used
in
2008 May 14
4
Heatmap.2 - eliminate cluster and dendrogram
Using the heatmap.2 function, I am trying to generate a heatmap of a
2 column x 500 row matrix of numeric values. I would like the 1st
column of the matrix sorted from the highest to the lowest values -
so that the colors reflected in the first column of the heatmap (top
to bottom) go from red to green.
After sorting the matrix (z), I tried the following command, but the
data remains
2008 May 21
2
\S4method in combination with "[" and "[<-"
Dear developers,
We want to use "\S4method" to document new S4-methods for "[" and "[<-".
We use this for other functions/methods and it works without any
problem, but in case of "[" and "[<-" we didn't manage to bring this to
work.
The problem occurs in the development version of our package "distrSim"
which can be found
2005 Sep 29
2
solution of convolution equation
Hello,
May be somebody can help me...
I am trying to find a solution of a convolution equation using fft (and
unfortunately I do not have a good background for this).
So I am just trying to figure out how it can be implemented in R. I have
two multidimensional independent variables X and Z
and I know their densities fx and fz, which are multidimensional arrays.
So I have to find the density of
2007 Jan 21
5
Integration + Normal Distribution + Directory Browsing Processing Questions
Hi everyone,
I am new to R, but it's really great and helped me a lot!
But now I have 2 questions. It would be great, if someone can help me:
1. I want to integrate a normal distribution, given a median and sd.
The integrate function works great BUT the first argument has to be a
function
so I do integrate(dnorm,0,1) and it works with standard m. and sd.
But I have the m and sd given.
2008 Dec 14
2
Sweave/Rweave and results="verbatim"
Hello,
in a Rnw-file I have this used stuff to try out tex-results...
==============================
<<>>>=
texme <- function() cat( "{\\bf Hallo, das ist voll fett!}\n" )
@
<<results="verbatim">>=
texme()
@
==============================
I used this command: "R CMD Sweave example.Rnw"
and got this error:
2005 Dec 23
2
convolution of the double exponential distribution
Is there any R function that computes the convolution of the double
exponential distribution?
If not, is there a good way to integrate ((q+x)^n)*exp(-2x) over x from
0 to Inf for any value of q and for any positive integer n? I need to
perform the integration within a function with q and n as arguments. The
function integrate() is giving me this message:
"evaluation of function gave a
2009 Sep 15
2
S3 objects in S4 slots
Hello,
I am the maintainer of the stringkernels package and have come across
a problem with using S3 objects in my S4 classes.
Specifically, I have an S4 class with a slot that takes a text corpus
as a list of character vectors. tm (version 0.5) saves corpora as
lists with a class attribute of c("VCorpus", "Corpus", "list"). I
don't actually need the
2005 Nov 01
4
S4 classes in existing packages
R-devel,
I'm interested in looking at some examples of existing R packages that
rely heavily on S4 classes to get a feel for varying styles and
package organization techniques. Could you recommend any packages
that might serve as a good starting point?
Thanks in advance,
Jeff
2005 Nov 01
4
S4 classes in existing packages
R-devel,
I'm interested in looking at some examples of existing R packages that
rely heavily on S4 classes to get a feel for varying styles and
package organization techniques. Could you recommend any packages
that might serve as a good starting point?
Thanks in advance,
Jeff