similar to: SV: Documentation of S3 and S4 classes, inheritance

Displaying 20 results from an estimated 4000 matches similar to: "SV: Documentation of S3 and S4 classes, inheritance"

2005 May 23
2
Documentation of S3 and S4 classes, inheritance
I'd like to have a class A that computes a likelihood, and a subclass B that computes the same likelihood by sometimes throws in an additional term (B includes measurement error). So B's likelihood needs to call A's, and then (sometimes) multiply by an additional term. It sounds as if, in the S3 scheme, NextMethod is supposed to do this: like.A <- function(stuff) compute value
2020 Oct 11
3
Installing bioconduction packages in connection with loading an R package
Dear all, My gRbase package imports functionality from the bioconductor packages graph, Rgraphviz and RBGL. To make installation of gRbase easy, I would like to have these bioconductor packages installed in connection with installation of gRbase, but to do so the user must use setRepositories() to make sure that R also installs packages from bioconductor. Having to call setRepositories causes
2018 Jul 08
2
[R] consider running tools::compactPDF(gs_quality = "ebook")
Dear all, I run R CMD build --compact-vignettes="both" gRbase and/or R CMD build --compact-vignettes="gs+qpdf" gRbase and in the log from r-devel (on winbuilder) I get * checking sizes of PDF files under 'inst/doc' ... WARNING 'gs+qpdf' made some significant size reductions: compacted 'gRbase-arrays.pdf' from 421Kb to 115Kb consider
2018 Jul 08
0
[R] consider running tools::compactPDF(gs_quality = "ebook")
?did this inside R; not ideal but worked. ________________________________ From: R-devel <r-devel-bounces at r-project.org> on behalf of S?ren H?jsgaard <sorenh at math.aau.dk> Sent: 08 July 2018 15:46 To: r-devel at r-project.org Subject: Re: [Rd] [R] consider running tools::compactPDF(gs_quality = "ebook") Dear all, I run R CMD build --compact-vignettes="both"
2018 Jul 08
2
consider running tools::compactPDF(gs_quality = "ebook")
Dear all, I run R CMD build --compact-vignettes="both" gRbase and/or R CMD build --compact-vignettes="gs+qpdf" gRbase and in the log from r-devel (on winbuilder) I get * checking sizes of PDF files under 'inst/doc' ... WARNING 'gs+qpdf' made some significant size reductions: compacted 'gRbase-arrays.pdf' from 421Kb to 115Kb consider
2018 Jul 08
2
consider running tools::compactPDF(gs_quality = "ebook")
Dear all, I run R CMD build --compact-vignettes="both" gRbase and/or R CMD build --compact-vignettes="gs+qpdf" gRbase and in the log from r-devel (on winbuilder) I get * checking sizes of PDF files under 'inst/doc' ... WARNING 'gs+qpdf' made some significant size reductions: compacted 'gRbase-arrays.pdf' from 421Kb to 115Kb consider
2006 Mar 07
3
Making an S3 object act like a data.frame
"[.ggobiDataset" <- function(x, ..., drop=FALSE) { x <- as.data.frame(x) NextMethod("[", x) } "[[.ggobiDataset" <- function(x, ..., drop=FALSE) { x <- as.data.frame(x) NextMethod("[[", x) } "$.ggobiDataset" <- function(x, ..., drop=FALSE) { x <- as.data.frame(x) NextMethod("$", x) } > class(x) [1]
2002 Oct 25
0
[., multiple inheritance, and R 1.6
Matt Nelson <MNelson at sequenom.com> reported a problem using the Hmisc library that did not occur with versions of R before 1.6. I am running platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 1 minor 6.0 year 2002 month 10 day 01 language R > library(Hmisc) > g <-
2008 Dec 02
0
Rcmd build problem: gcc.exe no input files (R.2.8.0 on Win XP)
Building a package using R.2.8.0 on Windows XP gives problems when compiling C code: Trying to run 'rcmd build' on R.2.8.0 on Windows XP gives ... ---------- Making package gRbase ------------ adding build stamp to DESCRIPTION making DLL ... gcc -std=gnu99 -Ic:/Programs/R/current/include ------------------------------------ gcc.exe: no input files make[3]: *** [setops.o] Error 1
2009 Oct 19
1
Defining S3-methods for S4-objects: cannot coerce type 'S4' to vector of type 'integer'
In the 'doBy' package there is an esticon() function for calculating linear contrasts for various model types. I have defined an S3-method 'esticon.mer()' for 'mer' objects from the lme4 package. Building the package and invoking the method gives: > esticon(fm1, c(1,1)) Confidence interval ( WALD ) level = 0.95 Error in as.integer(x) : cannot coerce type 'S4'
2009 Jun 05
1
S4: Initialization method called during setClass??
Dear UseRs, A simple class inheritance example: > setClass("test",representation(a="numeric")) > setMethod("initialize","test", function(.Object,x,...){ print("Initialization!!!") callNextMethod(.Object,a=x,...) }) > new("test",x=23) [1] "Initialization!!!" An
2019 Nov 01
0
[External] R C api for 'inherits' S3 and S4 objects
On Fri, 1 Nov 2019, Jan Gorecki wrote: > Dear R developers, > > Motivated by discussion about checking inheritance of S3 and S4 > objects (in head matrix/array topic) I would light to shed some light > on a minor gap about that matter in R C API. > Currently we are able to check inheritance for S3 class objects from C > in a robust way (no allocation, thread safe). This is
2017 Aug 08
0
Inheritance for S3 classes
You might find http://adv-r.hadley.nz/s3.html to be helpful (in particular, http://adv-r.hadley.nz/s3.html#constructors-1, gives my advice about subclass constructors) Hadley On Mon, Aug 7, 2017 at 7:06 PM, Kym Nitschke <kym.nitschke at icloud.com> wrote: > Hi R Users, > > I am relatively new to programming in R ? so I apologise if my questions appear ?dumb?. > > I am using
2008 Jul 28
0
S4 classes that extend S3 classes
Up to now, writing an S4 class that extends an S3 class (using contains= in the call to setClass) has been discouraged for two main reasons: 1. You can't say anything formal about S3 classes, so validating objects, having formal slots for their properties, etc. are not generally feasible. 2. In any case, the S3 class, which may have multiple strings in the class attribute, was not
2019 Nov 01
0
[External] R C api for 'inherits' S3 and S4 objects
On Fri, 1 Nov 2019, Jan Gorecki wrote: > Thank you Luke. > That is why I don't use Rf_inherits but INHERITS which does not > allocate, provided in the email body. Your definition can allocate because STING_ELT can allocate. getAttrib can GC in general. Currently it would not GC or allocate in this case, but this could change. You can't assume thread-safety for calls into the R
2012 Jan 24
0
Partial R2 values calculated using different packages
Dear fellow R-users I've always used Prof Harrell's rms package to calculate/visualize partial R2 values from a standard regression analysis (below is a quick example on how I've done so). Recently, I calcuated partial R2 values using the ppcor and gRbase packages. As it turns out, ppcor and gRbase agree with each other but the values generated from these packages tended to be greater
2011 Nov 18
1
S4 : defining [<- using inheritance from 2 classes
Hi the list, I define a class 'C' that inherit from two classes 'A' and 'B'. 'A' and 'B' have no slot with similar names. ---------------- setClass( Class="C", contains=c("A","B") ) To define the get operator '[' for class "C", I simply use the get of "A" or "B" (the constante
2018 May 24
0
Creating S3 methods for S4 classes (coming from r-package-devel)
You only have to make an S4 method if there is already an S4 generic. If there is just an S3 generic, then just define S3 methods on it. I think we should stay away from defining S4 generics when there is no good reason for them. Good reasons include multiple dispatch, or a non-default signature. Neither of those apply in this case. Michael On Thu, May 24, 2018 at 6:39 AM, Joris Meys
2003 Jul 23
1
S3 and S4 classes
Hi helpers, I've been programming in R for a few months now but I still have doubts about my code - I would like it to be completely S4-compatible. The current code works fine but is probably 'unclean'. I read the interesting article in the last R News and it helped me understand the difference on the whole between S3 and S4 classes, but I need a practical example. Could anyone
2017 Aug 08
0
Inheritance for S3 classes
The S3 class model isn't really a class model. It's more a way of overloading functions. So it's rather simple, and there's less there than you might be expecting. I always thought the "Object Oriented Programming" chapter of the R language definition manual that ships with R was a very good treatment. Have you tried there? If not, please do so. But surely you know how