similar to: Defining a method that behaves like '$'?

Displaying 20 results from an estimated 2000 matches similar to: "Defining a method that behaves like '$'?"

2013 May 08
1
Namespace/inheritance problem in S4 methods for a union class
Hi, I started this post on bioc-devel but this seems to be more general: https://stat.ethz.ch/pipermail/bioc-devel/2013-May/004311.html See reproducible example from Martin below. Thank you. Renaud ---------- Forwarded message ---------- From: Martin Morgan <mtmorgan at fhcrc.org> Date: 7 May 2013 19:55 Subject: Re: [Bioc-devel] ExpressionSet and LumiBatch: inheritance problem in S4
2010 Sep 10
3
Non identical numerical results from R code vs C/C++ code?
Hi, suppose you have two versions of the same algorithm: one in pure R, the other one in C/C++ called via .Call(). Assuming there is no bug in the implementations (i.e. they both do the same thing), is there any well known reason why the C/C++ implementation could return numerical results non identical to the one obtained from the pure R code? (e.g. could it be rounding errors? please
2011 Jun 28
1
doMC - compiler - concatenate an expression vector into a single expression?
Hi, this post is about foreach operators, the compiler package and the last update of doMC that includes support for the compiler functionality. I am using a home-made %dopar%-like operator that adds some custom expression to be executed before the foreach loop expression itself (see sample code below). It used to work perfectly with doMC 1.2.1, but with the introduction of the compiler
2012 Jun 08
4
Multiple sub-architecture: linking issue
Hi again, following my previous post on RCurl, I cannot install Rcpp either: g++ -m32 -I/home/renaud/bin/R/2.15/lib64/R/include -I/home/renaud/bin/R/2.15/lib64/R/include/i386 -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c r_cast.cpp -o r_cast.o g++ -m32 -shared -L/usr/local/lib64 -o Rcpp.so Date.o DateVector.o Datetime.o DatetimeVector.o Dimension.o DottedPair.o
2012 Jun 08
4
Multiple sub-architecture: linking issue
Hi again, following my previous post on RCurl, I cannot install Rcpp either: g++ -m32 -I/home/renaud/bin/R/2.15/lib64/R/include -I/home/renaud/bin/R/2.15/lib64/R/include/i386 -DNDEBUG -I../inst/include/ -I/usr/local/include -fpic -g -O2 -c r_cast.cpp -o r_cast.o g++ -m32 -shared -L/usr/local/lib64 -o Rcpp.so Date.o DateVector.o Datetime.o DatetimeVector.o Dimension.o DottedPair.o
2012 Dec 18
1
Call function only when running via R CMD check?
Hi Henrik (and list), I am interested in a similar feature, and would be happy to see the suggestions you got off-line :) Have you come up with a robust solution, which would work in a variety of situations (in examples, tests, \Sexpr calls, etc..)? Thank you. Bests, Renaud -- Renaud Gaujoux Computational Biology - University of Cape Town South Africa
2011 Oct 28
3
R CMD check and error in an \Sexpr in an Rd file
Hi, another Rd related issue I encountered is that if an error occurs in an \Sexpr in an Rd file, then on get the following error: * checking for portable compilation flags in Makevars ... OK * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK * checking examples ... ERROR Error in paste(before, x, after, sep = "") : object 'exfile' not found Execution halted
2011 Mar 04
1
Extending type list: names and inherited methods issue
Hi, I want to extend the type list, but it looks like the names are not handled properly (in the show method), not the [ method. See below for code example. I imagine this comes from the S3/S4 mixing, but I would like to understand and the recommended work around (that avoid redefining all the list methods [, $, etc...). Thank you. Bests, Renaud # define S4 class that inherits from list
2012 Apr 17
1
url, readLines, source behind a proxy
Hi, when I run R CMD check with flag --as-cran, the process hangs at stage: * checking CRAN incoming feasibility ... I am pretty sure it is a proxy issue. I looked at the check code in the tools package and it seems that the issue is in the local function `.repository_db()` (defined in `tools:::.check_package_CRAN_incoming()`), which eventually calls `url()` with argument
2011 Oct 05
1
Behaviour of 'source' with URLs and proxy
Hi, I am having troubles sourcing a file from our local network from R. It looks like this file are not properly accessed by 'source', even they can be downloaded with download.file. (See below my settings and some tests I did). I ended up with a work around, but I would like to understand what is going on. Doesn't source/readLines uses the same mechanism as download.file to
2012 Jul 05
1
Extracting srcref for S4 methods
Hi, on R version 2.15.1 (2012-06-22) (Platform: i686-pc-linux-gnu (32-bit)) sourced functions have srcref attached as an attribute. Are such data also available for S4 generics and methods? How? (See sample code below) Thank you. Bests, Renaud f <- textConnection( " f <- function(){} setGeneric('myfun', function(x, ...) standardGeneric('myfun'))
2010 Jun 18
2
nchar( NA )
Hello, Is this expected ? > nchar( c( "", NA ) ) [1] 0 2 Should not the second one be NA ? Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/98Uf7u : Rcpp 0.8.1 |- http://bit.ly/c6YnCi : graph gallery collage `- http://bit.ly/bZ7ltC : inline 0.3.5
2015 Jul 08
0
List S3 methods and defining packages
Thanks Kevin, this indeed clarifies a bit the S3 method registration universe. On 8 July 2015 at 15:48, Kevin Wright <kw.stat at gmail.com> wrote: > Not sure if this answers your question, but you can't unregister a method. See > > http://tolstoy.newcastle.edu.au/R/help/06/07/30791.html > > Kevin Wright > > > On Wed, Jul 8, 2015 at 5:09 AM, Renaud Gaujoux >
2011 Aug 17
1
R cmd check and multicore foreach loop
Hi, in R 2.12.1, R CMD check hangs when building a vignette that uses a foreach loop with the doMC parallel backend. This does not happen in R 2.13.1, nor if I use doSEQ instead of doMC. All versions of multicore, doMC and foreach are the same on both my R installations. Has anybody encountered a similar issue? Thank you. Renaud ### UNIVERSITY OF CAPE TOWN This e-mail is subject to the
2011 Aug 17
3
getNativeSymbolInfo("user_unif_rand") returns different results on windows and linux
Hi, When loading a package that provides the user-supplied RNG hook user_unif_rand, calling getNativeSymbolInfo("user_unif_rand") returns informations about the loaded symbol. I am using this to identify which package currently provides the RNG hook. The results are the same on windows and linux if only one library provides the hook. If one loads a second package that provides this
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
2014 Dec 05
2
install.packages deletes PACKAGES file in local repo
Hi, running install.packages() to install a package from a local repository (i.e., starts with file:///) appears to delete the PACKAGES file that is in the src/contrib/ directory. This happens on a cluster running Scientific Linux release 6.4 (Carbon), but not on my Ubuntu local machine. Subsequent calls to install.packages() complain about src/contrib/PACKAGES not existing, although there still
2011 Jan 25
1
Missing argument vs. empty argument
Hi, is there an easy, robust, and/or recommended way to distinguish a missing argument from an empty argument as in: foo <- function(i, j){ print(missing(j)) print(nargs()) } foo(i) # TRUE, 1 foo(i,) # TRUE, 2 I know I can work around with nargs, the list of arguments and the names of the passed arguments, but I wish there is something already in place for this. This is
2013 Nov 06
1
How to do package cleanup: hooks .onUnload, R_unload_mylib, .onDetach are not called on quit
Hi, it seems that the package hooks .onLoad and its C++ pendant R_unload_mylib are actually not called when R quits, but only when explicitly calling detach('package:mylib', unload = TRUE). Maybe this is platform specific, I'm on Ubuntu 13.10 - R 3.0.2 (see below). * is there a mechanism that a package can use to effectively do some cleanup on standard exit, such as calling
2010 Jun 09
1
Highlighting Text in Console
Anyone know how I can highlight specific words/letters (e.g., bold, or different colour) when displaying text to the console using cat or equivalent? I can change e.g., the colour for everything by loading in a new Rconsole file, but what I really want to do is write "hello world" to the screen but with the word "world" highlighted in some way. I've searched the