Displaying 20 results from an estimated 78 matches for "roebuck".
2004 Sep 15
7
Splitting vector into individual elements
Is there a means to split a vector into its individual
elements without going the brute-force route for arguments
to a predefined function call?
offred.rgb <- c(1, 0, 0) * 0.60;
## Brute force style
offred.col <- rgb(offred.rgb[1],
offred.rgb[2],
offred.rgb[3],
names = "offred")
## Desired style
2006 Apr 13
2
[R] S4 method dispatch matrixOrArray (fwd)
...= "vector"
A = "array"
A = "integer"
(inherited from A = "vector")
A = "matrix"
(inherited from A = "vector")
But including setMethod("bar", "matrix", ...) in the source code makes
bar() work fine.
Paul Roebuck wrote:
>Sorry to bother but could you shed some light on this?
>I don't understand why order of setMethod calls makes
>any difference. Since it obviously does, it has shaken
>the foundations of what I thought I understood about
>S4 methods. Even Gabor was surprised...
>
>...
2012 Feb 07
2
Canonical package directory name for JAR files?
We have an R package which needs to include a JAR file.
Is there a canonical directory for it?
2015 Jan 28
2
[Q] Get formal arguments of my implemented S4 method
...sweep.cols": calc.medians,
"recalc.after.sweep": sweep.cols,
"?"
}
not those of the generic:
{
"object",
"?"
}
From: Michael Lawrence <lawrence.michael at gene.com>
Date: Wednesday, January 28, 2015 11:28 AM
To: "Roebuck,Paul L" <PLRoebuck at mdanderson.org>
Cc: R-devel <r-devel at r-project.org>
Subject: Re: [Rd] [Q] Get formal arguments of my implemented S4 method
Would you please clarify your exact use case?
Thanks,
Michael
On Wed, Jan 28, 2015 at 9:02 AM, Roebuck,Paul L
<PLRoebuck at...
2004 Jul 12
2
.Platform addition (was Re: where does R search when source()?)
On Sun, 11 Jul 2004, Gabor Grothendieck wrote:
> search.path <-
> function(fn,
> paths = strsplit(Sys.getenv("PATH"), split = ";")[[1]],
> fsep = "\\") {
> for(d in paths) {
> f <- file.path(d, fn, fsep = fsep)
> if (file.exists(f))
> return(f)
> }
> return(NULL)
> }
>
2006 May 03
3
sprintf question
How would one go about getting sprintf to use the
values of a vector without having to specify each
argument individually?
> v <- c(1, 2, -1.197114, 0.1596687)
> iv <- c(3, 1, 2, 4)
> sprintf("%9.2f\t%d\t%d\t%8.3f", v[3], v[1], v[2], v[4])
[1] " -1.20\t1\t2\t 0.160"
Essentially, desired effect would be something like:
>
2006 Feb 08
1
invalid graphics state using dev.print (fwd)
On Mon, 6 Feb 2006 18:12, Simon Urbanek wrote:
> On Feb 6, 2006, at 5:24 PM, Paul Roebuck wrote:
>
>> Tried on R-Sig-Mac with no responses, but I need some kind
>> of answer.
>> [...]
>> Does the following work on your system?
>
> Interesting, no, it doesn't either. For png and pdf I use
> Quartz + quartz.save (it produces much nicer results) so
&...
2006 Apr 20
0
Breakdown a number [Broadcast]
...{
numPieces <- sum(s == 1)
ans <- diff(c(0, breaks[1:numPieces], x))
}
ans
}
Some tests:
> chop(1200, c(250, 800))
[1] 250 550 400
> chop(800, c(250, 800))
[1] 250 550
> chop(100, c(250, 800))
[1] 100
> chop(600, c(250, 800))
[1] 250 350
Andy
From: Paul Roebuck
>
> On Wed, 19 Apr 2006, Gabor Grothendieck wrote:
>
> > On 4/19/06, Paul Roebuck <roebuck at mdanderson.org> wrote:
> >
> > > Isn't there a builtin method for doing this and, if so,
> what is it
> > > called?
> > >
> > >...
2006 Mar 29
2
Recall for parent
What's the best way to simulate Recall for parent function?
Consider this one-time recursive code:
alwaysEven <- function(x) {
handleOdd <- function(x) {
alwaysEven(x-1) # use Recall-like here
}
return(if (x %% 2) handleOdd(x) else x)
}
any2even <- alwaysEven
rm(alwaysEven)
any2even(3)
----------------------------------------------------------
SIGSIG --
2005 Feb 14
2
Test Tools
Anyone aware of tools available that can provide complexity
metrics and/or code coverage analysis for R source?
----------------------------------------------------------
SIGSIG -- signature too long (core dumped)
2005 May 18
2
R Include File Guards
R 2.1.0/src/include from 2005/04/18 download
Naming inconsistent for guards as well but that's pedantic.
Simple convention:
file <foo.h>
#ifndef R_FOO_H
file <R_ext/bar.h>
#ifndef R_EXT_BAR_H
Missing guards:
<IOStuff.h>
<Internal.h>
<Parse.h>
<R_ext/GraphicsBase.h>
<R_ext/GraphicsDevice.h>
<R_ext/GraphicsEngine.h>
2005 Jul 19
2
R_AllocatePtr
Had been looking into Luke Tierney's R_AllocatePtr() and
was left with a question about exactly when does R reclaim
heap memory. Implication of 'simpleref.nw' is that one can
allocate C data on the R heap, and as long as pointer object
is alive, the data and pointer will remain valid. But it
calls allocString() which is implemented using R_alloc().
'Writing R Extensions" says
2005 Nov 12
2
sibling list element reference during list definition
Can the value of a list element be referenced from a
sibling list element during list creation without the use
of a temporary variable?
The following doesn't work but it's the general idea.
> list(value = 2, plusplus = $value+1)
such that the following would be the output from str()
List of 2
$ value : num 2
$ plusplus: num 3
2015 Jan 29
0
[Q] Get formal arguments of my implemented S4 method
At this point I would just due:
formals(body(method)[[2L]])
At some point we need to figure out what to do with this .local() confusion.
On Wed, Jan 28, 2015 at 10:07 AM, Roebuck,Paul L <PLRoebuck at mdanderson.org>
wrote:
> I'm attempting to reflect the information for use with corresponding
> fields in GUI (in a different package), to provide default values,
> argname as key for UI label lookups, etc.
>
> So I want something much more like the fo...
2004 Dec 31
4
install.packages() for local source file
Wish to install a local source package on Un*x platform from
within R. Same thing as I can accomplish from cmdline as
$ export R_LIBS=~/R/library
$ cd /path/to/pkg
$ R CMD INSTALL -l $R_LIBS <pkgname>
So, how do you go about this anyway?
And isn't this a bug in 'install.packages'?
-------
$ R
R : Copyright 2004, The R Foundation for Statistical Computing
Version 1.9.0
2015 Jan 29
3
[Q] Get formal arguments of my implemented S4 method
...cal"))) {
local <- eval(b[[2]][[3]])
if(is.function(local))
return(formals(local))
warning("Expected a .local assignment to be a function. Corrupted method?")
}
genFormals
}
>
>
>
>
> On Wed, Jan 28, 2015 at 10:07 AM, Roebuck,Paul L <PLRoebuck at mdanderson.org>
> wrote:
>
>> I'm attempting to reflect the information for use with corresponding
>> fields in GUI (in a different package), to provide default values,
>> argname as key for UI label lookups, etc.
>>
>> So I want...
2004 Sep 28
2
S4 method selection based on second argument
I'm translating some Matlab code and need some help figuring
out how to change this call into an S4 generic method.
In matlab, there's a function called 'repmat' with three
calling sequences (all I have to deal with anyway):
1) B = repmat(A, m, n)
2) B = repmat(A, [m n])
3) B = repmat(A, n)
In all cases, A is the fill value, m is number of rows,
and n is number of
2004 Jun 22
3
[Q] GET_DIM() crash on Windows only
I have the following contrived code in package format.
On Solaris and Mac OS X, code runs just fine. On Windows,
it crashes the R environment with the "Send Bug Report"
dialog. I tried R 1.8.1 (Win2K) and R 1.9 (WinXP) binaries
with the same result. PCs otherwise appear properly
configured for creating R packages. Anything blatantly
wrong? Suggestions?
TIA
Relevant files from package
2015 Jan 28
2
[Q] Get formal arguments of my implemented S4 method
Interrogating some (of my own) code in another package.
>norm.meth <- getMethod("normalize", "MatrixLike")
>message("str(norm.meth)")
>str(norm.meth)
>message("show(norm.meth at .Data)")
>show(norm.meth at .Data)
Last show() displays this:
function (object, ...)
{
.local <- function (object, method = c("median",
2004 Jul 06
1
Enumeration in R
I want the equivalent of this 'C' declaration.
enum StoplightColor {
green = 3,
yellow = 5,
red = 7
};
This mostly works except the validity checking doesn't
seem to occur automatically. What didn't I do to enable
it?
setClass("stoplightColor",
representation(value = "integer"),
prototype = integer(1))