Hi all, I've noticed a couple of small bugs/documentation errors related to S3 internal and group generics: * In ?S3groupGeneric, log2 and log10 are not listed as group generics, even though they are in the equivalent S4 groups, and are the source code for do_log1arg contains DispatchGroup("Math", ...) * As well as log2 and log10, tools:::.get_internal_S3_generics() fails to include cbind and rbind, even though they are listed in ?"internal generics" Based on my reading of the documentation and the source code, I believe this function lists all S3 internal generics: s3_internal <- function(fname) { # Functions in S4 group generics should be the same group <- c(getGroupMembers("Arith"), getGroupMembers("Compare"), getGroupMembers("Logic"), getGroupMembers("Math"), getGroupMembers("Math2"), getGroupMembers("Summary"), getGroupMembers("Complex")) primitive <- .S3PrimitiveGenerics # Extracted from ?"internal generic" internal <- c("[", "[[", "$", "[<-", "[[<-", "$<-", "unlist", "cbind", "rbind", "as.vector") c(group, primitive, internal) } Have I missed anything? Thanks! Hadley -- Chief Scientist, RStudio http://had.co.nz/
I have found the following generics which your function did not inlcude.1] "as.character.default" "as.expression.default" "as.list.default" "as.name" [5] "as.pairlist" "as.single.default" "as.symbol" "body<-" [9] "kronecker" I used the following code:base_objs <- objects("package:base")base_function <- mapply(function(x)ftype(get(x)), base_objs)base_objs_generic <- base_objs[grep("generic",base_function)] -- View this message in context: http://r.789695.n4.nabble.com/S3-internal-and-group-generics-tp4672746p4708174.html Sent from the R devel mailing list archive at Nabble.com. [[alternative HTML version deleted]]
Martin Maechler
2015-Jun-04 13:01 UTC
[Rd] Nabble gibberish on R-devel: please stop it (Re: S3 internal ...)
This is completely out of context, (and mailman needs to "munge" your sender e-mail because of unpleasant DMARC stuff),>>>>> edson bastos via R-devel <r-devel at r-project.org> >>>>> on Thu, 4 Jun 2015 05:13:55 -0700 writes:> I have found the following generics which your function did not inlcude.1] > "as.character.default" "as.expression.default" "as.list.default" > "as.name" [5] "as.pairlist" "as.single.default" > "as.symbol" "body<-" [9] "kronecker" I used the > following code:base_objs <- > objects("package:base")base_function <- > mapply(function(x)ftype(get(x)), base_objs)base_objs_generic <- > base_objs[grep("generic",base_function)] and is mangled because you've post via Nabble which may always use HTML. I'd really us to consider **banning** the use of Nabble for R-devel, completely. People on this list should be able to subscribe to a mailing list and deal with mail filtering etc... Martin Maechler, ETH Zurich