similar to: S4 method for '[' with extra arguments: distinguishing between x[i] and x[i, ]

Displaying 20 results from an estimated 10000 matches similar to: "S4 method for '[' with extra arguments: distinguishing between x[i] and x[i, ]"

2007 Jan 28
0
"[", .local and S4 methods (was: "[" operator and indexing ambiguity)
Dear Tony, thanks for the tip with "nargs", when suitably applied, this answers the problem. The behaviour of "nargs" in S4 methods has some subtleties compared to that in normal functions, as shown in the example below. I admit that this is what had earlier created some confusion about the semantics of "nargs". From the perspective of "nargs" and its
2008 Jul 01
1
[.data.frame speedup
Below is a version of [.data.frame that is faster for subscripting rows of large data frames; it avoids calling duplicated(rows) if there is no need to check for duplicate row names, when: i is logical attr(x, "dup.row.names") is not NULL (S+ compatibility) i is numeric and negative i is strictly increasing "[.data.frame" <- function (x, i, j,
2006 Nov 07
1
data frame subscription operator
Hi all, I was looking at the data frame subscription operator (attached in the end of this e-mail) and got puzzled by the following line: class(x) <- attr(x, "row.names") <- NULL This appears to set the class and row.names attributes of the incoming data frame to NULL. So far I was not able to figure out why this is necessary - could anyone help ? The reason I am
2010 Oct 26
1
S4 methods for rbind()
Hello. I am trying to write an S4 method for rbind(). I have a class of objects called 'mdm', and I want to be able to rbind() them to one another. I do not want the method for rbind() to coerce anything to an mdm object. I want rbind(x1,x2,x1,x2) to work as expected [ie rbind() should take any number of arguments]. This is what I have so far: setGeneric(".rbind_pair",
2023 Dec 16
2
Partial matching performance in data frame rownames using [
On Wed, 13 Dec 2023 09:04:18 +0100 Hilmar Berger via R-devel <r-devel at r-project.org> wrote: > Still, I feel that default partial matching cripples the functionality > of data.frame for larger tables. Changing the default now would require a long deprecation cycle to give everyone who uses `[.data.frame` and relies on partial matching (whether they know it or not) enough time to
2023 Dec 19
1
Partial matching performance in data frame rownames using [
Hi Hilmar and Ivan, I have used your code examples to write a blog post about this topic, which has figures that show the asymptotic time complexity of the various approaches, https://tdhock.github.io/blog/2023/df-partial-match/ The asymptotic complexity of partial matching appears to be quadratic O(N^2) whereas the other approaches are asymptotically faster: linear O(N) or log-linear O(N log N).
2011 Mar 11
2
Using missing() in a S4 method with extra arguments
Hi all, I have a function which makes use of missing() to determine which arguments are provided in the call - basically, there are two sets of arguments that map to different strategies the function uses to fulfill its task. After conversion to an S4 generic I've run into the problem that if a method uses extra arguments that are not in the signature of the generic, usage of missing()
2008 Feb 20
0
Non-standard S4 behavior
Hi all, I've been trying out the code from Chamber's "Classes and Methods in the S language": http://www.omegahat.org/RSMethods/Intro.pdf >From my session: R> whatis <- function(object) paste( "sdw" ) R> setMethod( "whatis", "vector", function(object) paste( "cswdvcr" ) ) R> dumpMethod( "whatis",
2009 Sep 17
1
Why S4 method is not visible from another package?
Dear All, maybe this is something obvious, I seem to be incapable of understanding how S4 works. So, in package 'A' I defined a "summary" method for my class: setMethod("summary", signature(object="ListHyperGResult"), function(object, pvalue=pvalueCutoff(object), categorySize=NULL) { "whatever" })
2009 Jul 20
1
S4 method dispatch with inheritance
Hi, I'm trying to create a new S4 class (myMatrix) which for now just extends dgCMatrix (from package Matrix). Then I want to use "[" which is defined in Matrix. Out of the box with "[" (defined in Matrix) I lose the class information and the result is an object of class dgCMatrix. If I specify a "["-method for myMatrix, it is not used because a signature
2023 May 20
0
issue with .local() hack used in S4 methods
Hi, Just ran across this: ??? foo <- function(x, ..., z=22) z ??? setMethod("foo", "character", function(x, y=-5, z=22) y) ??? # Creating a generic function from function ?foo? in the global environment Then: ??? foo("a") ??? # [1] 22 Should return -5, not 22. That's because the call to .local() used internally by the foo() method does not name
2013 Mar 13
1
S4 generic not exported correctly / incorrect dispatch?
In this post https://stat.ethz.ch/pipermail/bioc-devel/2013-March/004152.html a package author reports that S4 dispatch fails. I can reproduce this with a PkgA (attached; 'intervals' is a relatively light-weight CRAN package) that has DESCRIPTION with Depends: intervals Imports: graphics NAMESPACE: importFrom(graphics, "plot") export("plot")
2014 Nov 22
3
R string comparisons may vary with platform (plain text)
A colleague?s R program behaved differently when I ran it, and we thought we traced it probably to different results from string comparisons as below, with different R versions. However the platforms also differed. A friend ran it on a few machines and found that the comparison behavior didn?t correlate with R version, but rather with platform. I wonder if you?ve seen this. If it?s not some
2016 Jan 06
0
[klibc:master] Add accept4(), handle fallback from accept () to accept4()
Commit-ID: cf8147c43a60d9eb6a6713d16f30364a698a6936 Gitweb: http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=cf8147c43a60d9eb6a6713d16f30364a698a6936 Author: H. Peter Anvin <hpa at linux.intel.com> AuthorDate: Tue, 5 Jan 2016 18:31:40 -0800 Committer: H. Peter Anvin <hpa at linux.intel.com> CommitDate: Tue, 5 Jan 2016 18:35:16 -0800 [klibc] Add accept4(), handle
2015 Mar 04
3
supermin on arm
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi all, I was testing oz/imagefactory on 32 bit arm, you have to have kernel-lpae installed to run kvm. while you can have the regular kernel installed also. You end up having the system booting the regular kernel and you do not get kvm. Ideally supermin will work with the lpae kernel.
2014 Nov 22
0
R string comparisons may vary with platform (plain text)
On 22/11/2014, 2:59 PM, Stuart Ambler wrote: > A colleague?s R program behaved differently when I ran it, and we thought > we traced it probably to different results from string comparisons as > below, with different R versions. However the platforms also differed. A > friend ran it on a few machines and found that the comparison behavior > didn?t correlate with R version, but
2008 Jun 27
1
include S4 class and methods in a package
DeaR list, Pardon the stupidity of this question but I've been trying this for a while now without success. I've followed the example given in the green book "programming with data", and I now have a working example of a S4 class with a few methods (plot, summary, as.data.frame). It's all very nice in one file, but I cannot find the way to put this information in a
2003 Dec 01
0
No subject
the directory I setup in the smb.conf file on the LINUX machine named DP-WS67/CDs I want to give all members of the DP group ownership of the directory. When I enter chgrp 'HY-VEE\AUDIT' /RH1dat/CDs it works. When I enter chgrp 'Hy-VEE\DP' /RH1dat/CDs I get = chgrp: invalid group=20 name 'HY-VEE\\DP' =20 I ran these 2 commands with strace
2010 Jan 10
0
commandArgs return value
Hello, I plan to use a script with R CMD BATCH on different platforms Linux, Windows and Mac OSX. I use the commandArgs(trailing = FALSE) function to retrieve the name of the script and the arguments (example below with output.) The online docs for "Introduction to R" (sections B.1 Invoking R from the command line and B.4 Scripting with R) and help("commandArgs")
2003 Nov 17
0
Context: launching FreeBSD "pxeboot" from PXELINUX is the Very L ast Bug.
Hello... Last week I demonstrated a problem with PXELINUX's ability to launch the FreeBSD "pxeboot" program. Mr. Anvin suggests that this can be fixed. I'm glad, because this PXELINUX/pxeboot problem is the very last technical issue for a project on which I've been working since September. My company has a proprietary disk-imaging system that they would like to replace.