similar to: generic functions question in building a new package

Displaying 20 results from an estimated 40000 matches similar to: "generic functions question in building a new package"

2013 Aug 24
2
Correct NAMESPACE approach when writing an S3 method for a generic in another package
Dear List, In one of my packages I have an S3 method for the plot3d generic function from package rgl. I am trying to streamline my Depends entries but don't know how to have plot3d(foo) in the examples section for the plot3d method in my package, without rgl being in Depends. Note that I importFrom(rgl, plotd3d) and register my S3 method via S3Method() in the NAMESPACE. If rgl is not in
2005 Jan 31
2
printing impossible on win98 and samba 3.0.10
Hello, i am using net-fs/samba-3.0.10 on an updated gentoo linux on x86 machine. recently i was using some older version, probably 3.0.9 i didn't change my smb.conf but now printing from windows 98 clients does not work anymore. the errormessage on win98 is (translated from german): Error when writing on \\master\stylus1160 vor printer (EPSON Stylus Color 1160): The network printer ist not
2009 Sep 19
1
generic methods - in particular the summary function
Hi all, I'm currently working on the fitdistrplus package (that basically fit distributions). There is something I do not understand about the generic function summary. In the current version on CRAN, there is no NAMESPACE saying S3method(summary, fitdist) . However if we use summary on an object send by fitdist function it works fine... According to R-lang, we have " The most
2004 Jan 26
1
Domain + Workgroup with same name: problem?
Hello everybody! I finally managed to set up a Samba 3.0.1 PDC that ran perfectly in the test-environment. Problems arose, when I installed it in a real bureau network. On a prepared w2k client that was already a domain member one could log on to the domain with the administrator's account, but trying to add other w2k clients failed with error msgs like: "Domain controller not
2012 Dec 08
1
namespace S3 and S4 generic imports cannot both be satisfied:
PkgA wishes to write a method for 'unique' on S4 class 'A'. ?Methods indicates that one should setGeneric("unique") setClass("A") unique.A <- function(x, incomparables=FALSE, ...) {} setMethod(unique, "A", unique.A) Both S3 and S4 methods need to be exported in the NAMESPACE import(methods) S3method(unique, A)
2009 Nov 05
1
plot.envfit/move labels
Dear r-helpers! Jan Thiele asked r-help-list in february, but I could not find an answer to his question. I have the same problem: While preparing figures of 'envfit' plots with vegan for publication, I ran into a layout problem, that I found no solution for in the literature or the help archive: The labels of the vectors that indicate correlations of environental variables sometimes
2023 Apr 01
2
Autocompletion for the new S3 generic @ method?
I agree, this is a good idea and would be very helpful in interactive contexts. I have a draft patch implementing this feature here: https://github.com/r-devel/r-svn/pull/122 (Append ?.patch? to the URL to get a raw patch.) Regards, Tomasz > On Mar 31, 2023, at 2:11 PM, Karolis K <karolis.koncevicius at gmail.com> wrote: > > Hello, > > In the current R-devel @ is S3
2009 May 27
1
"Error: package/namespace load failed"
I am writing my first R package, and I have been getting the following series of errors when I run R CMD check: * checking S3 generic/method consistency ... WARNING Error: package/namespace load failed for 'REEMtree' Call sequence: 2: stop(gettextf("package/namespace load failed for '%s'", libraryPkgName(package)), call. = FALSE, domain = NA) 1: library(package,
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")
2019 Jun 17
1
Could generic functions check different S3 methods for an object when one of them produces an error?
Hi, Let's say one has an object with multiple classes, and a generic function to apply to it has associated S3 methods for more than one of those classes. Further, the method it chooses (I do not know how; some order in the class vector?) is not the suitable one and it produces an error. Would there be some way to make the generic function to choice the correct method, or in case that for
2010 Nov 30
1
warning creating an as.array method in a package
[Env: R 2.11.1, Win Xp, using Eclipse/StatET] In a package I'm working on, I want to create as.matrix() and as.array() methods for a particular kind of object (log odds ratios). These are returned in a loddsratio object as the $coefficients component, a vector, but really reflect an underlying (R-1)x(C-1)xstrata array, whose attributes are contained in other components. I define coef,
2019 May 14
2
[R-pkg-devel] Three-argument S3method declaration does not seem to affect dispatching from inside the package.
CCing r-devel. On Tue, 14 May 2019 at 02:11, Pavel Krivitsky <pavel at uow.edu.au> wrote: > > Dear All, > > I've run into this while updating a package with unfortunately named > legacy functions. It seems like something that might be worth changing > in R, and I want to get a sense of whether this is a problem before > submitting a report to the Bugzilla. > >
2010 Dec 09
1
warning creating an as.array method in a package
I posted on this topic to r-help, but never got a sufficient answer, so I'm reposting here. [Env: R 2.11.1, Win Xp, using Eclipse/StatET] In a package I'm working on, I want to create as.matrix() and as.array() methods for a particular kind of object (log odds ratios). These are returned in a loddsratio object as the $coefficients component, a vector, but really reflect an underlying
2023 Mar 31
1
Autocompletion for the new S3 generic @ method?
Hello, In the current R-devel @ is S3 generic, so we can do things like - for example - use it to extract matrix rows by name: .S3method("@", "mm", function(object, name) object[name,]) m <- structure(matrix(rnorm(20), ncol=2), dimnames=list(paste0("row", 1:10), paste("col", 1:2)), class="mm") m at row1 However, seems like
2010 Feb 14
1
How S3method() is implemented and called? And when to use it?
R-exts.pdf discribes S3method a little bit. But I want to understand more on how it is called, implemented and when to use it. I don't find it in an R session. But I see S3method() in some NAMESPACE files. > S3method Error: object 'S3method' not found > ?S3method No documentation for 'S3method' in specified packages and libraries: you could try '??S3method' I
2015 Jul 07
3
List S3 methods and defining packages
Hi, from the man page ?methods, I expected to be able to build pairs (class,package) for a given S3 method, e.g., print, using attr(methods(print), 'info'). However all the methods, except the ones defined in base or S4 methods, get the 'from' value "registered S3method for print", instead of the actual package name (see below for the first rows). Is this normal
2004 Jan 27
2
MS Word and Samba File Permissions Problem
Hello everybody! Obviously Samba as a PDC and Fileserver for w2k clients is not as easy as I first thought. Soon after setup and integration in a network a problem with the shares and MS Word appeared. Any time a file is opened with M$ Word directly from a share and edited it can't be saved. The M$ user gets the msg that the file is write-protected and on the samba side the file
2019 May 14
2
[R-pkg-devel] Three-argument S3method declaration does not seem to affect dispatching from inside the package.
On Tue, 14 May 2019 at 12:31, Pavel Krivitsky <pavel at uow.edu.au> wrote: > > > Note that disabling name-based dispatch implies two things: 1) the > > inability to override your method by defining gen.formula in the > > global environment, and 2) another package can break yours (i.e., > > internal calls to gen()) by registering an S3 method for gen() after >
2015 May 04
1
Define replacement functions
No. I fixed that, the NAMESPACE file now contains: S3method("[[<-", mylist) S3method("$<-", mylist) It still does not work. I also created a print method (print.mylist) which did work out of the box, regardless of being in the NAMESPACE file or not. Could it be somehow in here (also in my NAMESPACE file): exportPattern("^[[:alpha:]]+") Or could it be that
2013 Apr 19
2
NAMESPACE and imports
I am cleaning up the rms package to not export functions not to be called directly by users. rms uses generic functions defined in other packages. For example there is a latex method in the Hmisc package, and rms has a latex method for objects of class "anova.rms" so there are anova.rms and latex.anova.rms functions in rms. I use: