Re: [Rd] S4 initialize or "generating function"

2007-01-31 Thread Seth Falcon
Thomas Petzoldt <[EMAIL PROTECTED]> writes: > Hello, > > apologies if I missed something well known. I'm just revising an own > package and wonder if it is still common to use "generating > functions" which have the same name as the corresponding S4 class as > suggested by Chambers, 2001. "Classes

Re: [Rd] S4 initialize or "generating function"

2007-01-31 Thread Seth Falcon
Thomas Petzoldt <[EMAIL PROTECTED]> writes: > One odd thing I found was that initialize does obviously not allow to > incorporate additional named parameters which are not slots. ?! Does for me: setClass("FOO", representation(x="numeric")) [1] "FOO" setMethod("initiali

Re: [Rd] "rep" missing from methods:::.BasicFunsList

2007-01-31 Thread Seth Falcon
Stephen Pope <[EMAIL PROTECTED]> writes: > With: > > R version 2.4.1 Patched (2007-01-22 r40548) > > "rep" is missing from methods:::.BasicFunsList, causing > methods:::genericForPrimitive("rep") to fail, which in turn causes > setMethod("rep", ...) to fail. (setGeneric("rep") of course fails as

Re: [Rd] S4 initialize or "generating function"

2007-01-31 Thread Seth Falcon
Thomas Petzoldt <[EMAIL PROTECTED]> writes: > Your example works but one can not arbitrarily mix slots, other named > arguments and the default callNextMethod(). The documentation states: > > "... Data to include in the new object. Named arguments correspond > to slots in the class definition." A

Re: [Rd] Problems with definitions of S4-generics

2007-02-01 Thread Seth Falcon
Jörg Beyer <[EMAIL PROTECTED]> writes: > Hello all, > > I'd like to report a problem related to S4 classes. > > Platform: > Mac G4/400 PCI (PPC-architecture) > Mac OS 10.4.8 > R 2.4.1 for Mac OS X (CRAN binary, 2006-12-19) w/ R.app 1.18 I see the same thing using a fairly recent R-devel: > se

Re: [Rd] Problem using ofstream in C++ class in package for MacOS X

2007-02-04 Thread Seth Falcon
cstrato <[EMAIL PROTECTED]> writes: > Thank you for your fast answer. > Sorrowly, I don´t know how to use a debugger on MacOS X, I am using > old-style print commands. You should be able to use gdb on OS X (works for me, YMMV). So you could try: R -d gdb run # source a script

Re: [Rd] Depending on many packages: another best practice question

2007-02-25 Thread Seth Falcon
"Gabor Grothendieck" <[EMAIL PROTECTED]> writes: > You can use > > if(require(myPackage)) { ... } Probably you will want: if (suppressWarnings(require("somePkg"))) { ... } This way, you won't get a lot of noise when somePkg isn't installed. Running the examples at least some of the time seem

Re: [Rd] S3 best practice

2007-03-02 Thread Seth Falcon
Robin Hankin <[EMAIL PROTECTED]> writes: > Hello everyone > > Suppose I have an S3 class "dog" and a function plot.dog() which > looks like this: > > plot.dog <- function(x,show.uncertainty, ...){ > >if (show.uncertainty){ >and superimpose the results on the simple plot> >

Re: [Rd] extracting rows from a data frame by looping over the row names: performance issues

2007-03-02 Thread Seth Falcon
Herve Pages <[EMAIL PROTECTED]> writes: > So apparently here extracting with dat[i, ] is 300 times faster than > extracting with dat[key, ] ! > >> system.time(for (i in 1:100) dat["1", ]) >user system elapsed > 12.680 0.396 13.075 > >> system.time(for (i in 1:100) dat[1, ]) >user syst

Re: [Rd] fortune() in .Rprofile conflicts with R CMD INSTALL

2007-03-04 Thread Seth Falcon
d so that R's output doesn't confuse itself and gcc when doing R CMD INSTALL, seems like it should be possible. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Problem using callNextMethod() in S4

2007-03-04 Thread Seth Falcon
cribing what isn't valid about the object. Don't call warning() or print(). Also, you don't need those ';' And finally, you are operating on a _copy_ in the validity method (just like everywhere else) and so this > if (substr(strg, nchar(strg), nchar(strg))

[Rd] methods package PROTECT "bug"

2007-03-14 Thread Seth Falcon
g, TRUE)); nprotect++; + thisClass = R_data_class(arg, TRUE); UNPROTECT(1); /* for arg */ + PROTECT(thisClass); nprotect++; } SET_VECTOR_ELT(classes, i, thisClass); lwidth += strlen(STRING_VALUE(thisClass)) + 1; -- Seth Falcon | Computational Bio

Re: [Rd] R 2.5.0 devel try issue in conjuntion with S4 method dispatch

2007-03-15 Thread Seth Falcon
call <- sys.call(-4) dcall <- deparse(call)[1] prefix <- paste("Error in", dcall, ": ") -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] R 2.5.0 devel try issue in conjuntion with S4 method dispatch

2007-03-16 Thread Seth Falcon
standardGeneric("frob2") }) setMethod("frob1", "integer", function(x) vector(mode="integer", length=x)) setMethod("frob2", "integer", function(x) vector(mode="integer", length=x)) ###

Re: [Rd] Inherited S4 methods

2007-03-16 Thread Seth Falcon
onality defined in baseClass, analogously to C++ methods. > If this is possible, does there exist an example? The S4 object system is generic function based. Methods are not contained inside classes. You can define a generic 'myfunction' and then define methods for BaseClass and

Re: [Rd] Inherited S4 methods

2007-03-16 Thread Seth Falcon
generic that are applicable and orders them so that the most specific method comes first. When you call callNextMethod, you enter the next most specific method. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org ___

Re: [Rd] R 2.5.0 devel try issue in conjuntion with S4 method dispatch

2007-03-16 Thread Seth Falcon
> code at the R prompt via ':::' which I find just handy. If you switched to _className, then there would be no S3 confusion. There are performance implications in doing things this way, but I agree it is convenient. Cheers, + seth -- Seth Falcon | Computational

Re: [Rd] R 2.5.0 devel try issue in conjuntion with S4 method dispatch

2007-03-17 Thread Seth Falcon
Peter Dalgaard <[EMAIL PROTECTED]> writes: > I have just committed my variation of Seth's patch, so please check the > current r-devel too. Thanks, Peter. And I agree that your variation is cleaner. -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Res

Re: [Rd] Carriage returns and Sweave output

2007-03-19 Thread Seth Falcon
\r. In general, any status output of calculation should be optional since they can get in the way of things like Sweave, etc. -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-pr

Re: [Rd] how to use debug.mypkg

2007-03-22 Thread Seth Falcon
this to be useful, you need to have package code that checks if(OPTIONS$debug) and does something different. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.org mailing

Re: [Rd] Suggestion for memory optimization and as.double() with friends

2007-03-29 Thread Seth Falcon
> storage.mode(x) <- "integer" tracemem[0x1fa6df8 -> 0x1fa6d60]: tracemem[0x1fa6d60 -> 0x1fa6808]: as.integer.default as.integer eval eval storage.mode<- tracemem[0x1fa6808 -> 0x2c26b18]: as.integer.default as.integer eval eval storage.mode<- trac

[Rd] list/matrix chimera

2007-04-10 Thread Seth Falcon
3 [6,] 612 18 24 class(vv) [1] "matrix" typeof(vv) [1] "list" vv[1, 1] [[1]] [1] 1 vv[1, ] [[1]] [1] 1 [[2]] [1] 7 [[3]] [1] 13 [[4]] [1] 19 + seth -- Seth Falco

Re: [Rd] list/matrix chimera

2007-04-10 Thread Seth Falcon
guaranteed structure and so you can't avoid [[1]] since [1] will return a list and it can contain *anything*. What could be useful is the notion of a vector of S4 objects. There you could ensure they are all the same type. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson

Re: [Rd] list/matrix chimera

2007-04-10 Thread Seth Falcon
"hadley wickham" <[EMAIL PROTECTED]> writes: > That's rather a contrived example. In practice, you would create a > list containing the same type of objects. eg: Yes, great. But when you have code that is expecting a matrix argument, you can't know what you are going to get. I suspect there is

[Rd] Checking versions in Imports field?

2007-04-10 Thread Seth Falcon
Hi, Package authors can specify the minimum required version of a dependency using: Depends: somePackage (>= 1.2.3) Is there a way to demand a minimum version when importing a dependency? Version specifiers in the Imports field are currently ignored AFAICT. + seth -- Seth Fal

[Rd] Sort output of apropos

2007-04-11 Thread Seth Falcon
A further improvement to apropos() would be to sort the output. Currently, the output of apropos is in the order found on the search list and this will rarely be useful to the user. All that is needed is a sort(x) at the end of the function. + seth -- Seth Falcon | Computational Biology | Fred

Re: [Rd] how to control which version of a package library() installs?

2007-04-13 Thread Seth Falcon
ion which attempts to unload the name space and S4 methods if TRUE. It will fail if the name space is in use by another package. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ [EMAIL P

Re: [Rd] Sort output of apropos

2007-04-15 Thread Seth Falcon
Prof Brian Ripley <[EMAIL PROTECTED]> writes: > Seems sensible, but 2.5.0 is in feature freeze and it is possible that > someone has relied on this. > > I've added this (and a \value section to the help file) for R-devel. Excellent. Thank you. + seth -- Seth Falcon

[Rd] as() creates invalid entries in methods list?

2007-04-15 Thread Seth Falcon
} else { +if(canCache) { # make into method definition + asMethod <- .asCoerceMethod(asMethod, sig, FALSE) +} } ## cache in the coerce function's environment if(canCache && !is.null(asMethod)) {

[Rd] infinite recursion when printing former S4 objects

2007-04-20 Thread Seth Falcon
at hand. + seth ## 8<--8<--- setClass("Foo", representation(name="character"), contains="matrix") f <- new("Foo", name="Sam", matrix()) f m <- as(f, "matrix") m print(m)

[Rd] Problem with R-2.5.0 patched and Matrix package

2007-04-26 Thread Seth Falcon
install.packages(pkgs = pkgs, repos = repos, dependencies = dependencies, I don't have this problem when using a recent R-devel. And I'm guessing that Matrix works with the release, but haven't had time to check this. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson

Re: [Rd] evaluation in unattached namespace

2007-04-26 Thread Seth Falcon
L, panel = "panel.dotplot", ...) > { > ocall <- ccall <- match.call() > ccall$data <- data > ccall$panel <- panel > ccall[[1]] <- as.name("bwplot") > evalenv <- new.env(parent = parent.frame()) > assign(&qu

Re: [Rd] system() in packages

2007-04-27 Thread Seth Falcon
nd determine whether it errored out or not and set action based on that. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] R-2.5.0 install

2007-04-27 Thread Seth Falcon
packages("Biobase", repos=rep, installWithVers=TRUE) I would also be curious to understand your motivation for wanting installWithVers. BioC packages are developed for a particular R release and in general I would not expect BioC packages developed older R's to work with

Re: [Rd] R-2.5.0 install

2007-04-27 Thread Seth Falcon
Update: Seth Falcon <[EMAIL PROTECTED]> writes: > And for me it does. Almost. With a clean package library, I end up with an error installing matchprobes because library.dynam can't find a shared library called matchprobes_1.8.0. Since other packages that have native code are i

Re: [Rd] R-2.5.0 install

2007-04-27 Thread Seth Falcon
quot;, pkgname, lib) Thanks! I've fixed this for the release and devel versions of matchprobes. > (That's not an uncommon mistake, BTW: EBarrays, puma and twilight of > BioC seem to share it.) Indeed. I will contact the maintainers of those packages. + seth -- Seth Falcon |

[Rd] Possible problem with S4 dispatch

2007-04-30 Thread Seth Falcon
) [1] "package:AnnotationDbi" "package:base" The package code I'm working with imports the package that defines the mget method (and this package does exportMethods(mget)), yet the problem seems to be that the mget generic is not found -- but I find

Re: [Rd] Possible problem with S4 dispatch

2007-05-01 Thread Seth Falcon
(ename == "") { cat(" first five entires\n") print(ls(etmp)[1:5]) } etmp <- parent.env(etmp) } } One thing to note: One might expect each import to be in the chain of parent environments. Instead all impo

[Rd] Questions about name space directives

2007-05-01 Thread Seth Falcon
ackage that only sets methods on generic "foo", an exportMethods("foo") directive does not re-export the "foo" generic. I find it confusing that exportMethods sometimes exports the generic and sometimes not. The generic can be re-exported using ex

Re: [Rd] Embedding R and registering routines

2007-05-01 Thread Seth Falcon
to package developers to dynamically register routines. Just as R can load packages to make new routines available, I don't see why an R package should not be able to provide an analogous plugin mechanism of its own. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer

[Rd] Problem calling $ inside a $ method

2007-05-07 Thread Seth Falcon
name)) [1] "$" ## But it doesn't work. Why? f$bo NULL f$al NULL ## Here is a hackish workaround. setMethod("$", "Foo", function(x, name) eval(substitute([EMAIL PROTECTED], list(FOO=name)))) [1] "$" f$

Re: [Rd] Problem calling $ inside a $ method

2007-05-08 Thread Seth Falcon
;- "bob" >> `$`(f, nm) > NULL Thanks, this is the piece I was missing. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Best Practise

2007-05-14 Thread Seth Falcon
ng to do (and your subject line is confusing, this isn't a best practice question IMO, but a how do I use R objects in C question). Perhaps the above hints will get you going. I would recommend reading over the relevant sections of the Writing R Extensions manual and the R internals manual. +

[Rd] RFC: allow packages to advertise vignettes on Windows

2007-05-14 Thread Seth Falcon
enu <- paste("Vignettes", pkgName, sep="/") winMenuAdd(pkgMenu) for (i in vigs) { item <- sub(".pdf", "", basename(i)) winMenuAddItem(pkgMenu, item, paste("shell.exec(\"", as.charac

Re: [Rd] RFC: allow packages to advertise vignettes on Windows

2007-05-14 Thread Seth Falcon
ng at a time, I guess. If there is some agreement about vignettes being automatically added and that this only happens when a package is attached, then I can look into modifying the existing function to handle this. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Cente

Re: [Rd] RFC: allow packages to advertise vignettes on Windows

2007-05-15 Thread Seth Falcon
Simon Urbanek <[EMAIL PROTECTED]> writes: > On May 15, 2007, at 1:57 PM, Prof Brian Ripley wrote: > >> On Mon, 14 May 2007, Seth Falcon wrote: >> >>> Duncan Murdoch <[EMAIL PROTECTED]> writes: >>>> I'm interested in making vignettes more

Re: [Rd] RFC: allow packages to advertise vignettes on Windows

2007-05-16 Thread Seth Falcon
s a hook such that a GUI can add the vignette info for attached packages. Comments from others in this thread suggest that there is a desire that this be an opt-in feature for package authors [I don't really understand this desire as it seems to me it should be a feature/decision of the GUI] and aga

[Rd] RFC: adding an 'exact' argument to [[

2007-05-17 Thread Seth Falcon
signature. However, by adding an argument, we are able to move more slowly towards a non-partially matching [[ (eventually, the default could be exact=TRUE, but that is a discussion for another day). + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research

Re: [Rd] RFC: adding an 'exact' argument to [[

2007-05-17 Thread Seth Falcon
l matching is desirable because it saves typing during interactive sessions now has a lot less weight. The recent integration of the completion code gives less typing and complete names. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.o

Re: [Rd] Passing R CMD Check without data

2007-05-21 Thread Seth Falcon
lace under inst/). You might also look at the vsn package in Bioconductor which uses a Makefile to avoid R CMD check from building its vignette because it is too time consuming... + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Resea

Re: [Rd] relist, an inverse operator to unlist

2007-05-21 Thread Seth Falcon
ure="flesh", function(flesh, skeleton=attr(flesh, "skeleton") standardGeneric("foo"))) + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] RFC: adding an 'exact' argument to [[

2007-05-22 Thread Seth Falcon
Hi again, Robert has committed the proposed patch to R-devel. So [[ now has an 'exact' argument and the behavior is as described: Seth Falcon <[EMAIL PROTECTED]> writes: >1. [[ gains an 'exact' argument with default value NA > >2. Behavior of &

Re: [Rd] relist, an inverse operator to unlist

2007-05-23 Thread Seth Falcon
Andrew Clausen <[EMAIL PROTECTED]> writes: > Hi Seth, > > On Mon, May 21, 2007 at 05:15:10PM -0700, Seth Falcon wrote: >> I will also add that the notion of a default argument on a generic >> function seems a bit odd to me. If an argument is available for >> disp

[Rd] Recent changes in R related to CHARSXPs

2007-05-25 Thread Seth Falcon
) Ncells 5837253 311.86910418 369.1 6193578 330.8 Vcells 16831859 128.5 45712717 348.8 39456690 301.1 Best Wishes, + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-de

Re: [Rd] S4 assignment \alias and \usage

2007-05-30 Thread Seth Falcon
methods for a generic documented elsewhere. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] S4 assignment \alias and \usage

2007-05-30 Thread Seth Falcon
"TSdoc") <- value ; x }) > > setGeneric("TSdoc", >def= function(x) standardGeneric("TSdoc"), >useAsDefault= function(x) attr(x, "TSdoc")) Aside: It seems odd to me to define such defaults. How do you know x is going to have a TSd

Re: [Rd] Possible changes to connections

2007-05-30 Thread Seth Falcon
lected when no R object refers to them. This would allow > for example > > readLines(gzfile("foo.gz")) I think this would be a nice improvement as it matches what many people already assume happens as well as matches what some other languages do (in particular, Python). +

Re: [Rd] Possible changes to connections

2007-05-31 Thread Seth Falcon
e when coding R and it would be nice to make it work for connections. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] Possible changes to connections

2007-05-31 Thread Seth Falcon
> > http://wiki.r-project.org/rwiki/doku.php?id=developers:r_connections_api I wanted to voice a "me too" for wanting to see an interface added for working with connections from C in package code. There are a number of places where this would be useful and provide cleaner solution

Re: [Rd] HTML vignette browser

2007-06-04 Thread Seth Falcon
vailable to them -- I just had a question from someone who wanted to know how to make a plot that appeared in a vignette, for example. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org

Re: [Rd] missing IntegerFromString()

2007-06-05 Thread Seth Falcon
ude/Rinternals.h Best Wishes, + seth PS: Nice to see you again :-) -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] missing IntegerFromString()

2007-06-07 Thread Seth Falcon
CHARSXP, it does not work. > > So, how could I get the actual values in the column names? How about: SEXP colnums; int *ivals; PROTECT(colnums = coerceVector(cl, INTSXP)); ivals = INTEGER(colnums); Here you convert the STRSXP cl into an INTSXP. If you want the actual int

Re: [Rd] package check note: no visible global function definition (in functions using Tcl/Tk)

2007-06-11 Thread Seth Falcon
silenced. [Note 1: I don't have any ideas at the moment for how this could work.] [Note 2: Despite the false-positives, I've already caught a handful of bugs by reading over these NOTEs and think they provide a lot of value to the check process] + seth -- Seth Falcon | Computational Bio

Re: [Rd] bug in R environments? Was: [BioC] 'recursive default argument' error...

2007-06-12 Thread Seth Falcon
nt contains environments. The lazy loading db is important at runtime when users may only need to access one or two of the environments. We generate the lazy-loading dbs by hand so that users installing from source do not have to repeat the process themselves. Since the environments are lar

[Rd] PATCH: install inst/ before doing lazyload on Windows

2007-06-12 Thread Seth Falcon
/MakePkg -s lazyload endif - @$(MAKE) --no-print-directory -f $(RHOME)/src/gnuwin32/MakePkg -s $(DPKG)/demo $(DPKG)/exec $(DPKG)/inst $(DATA) ifeq ($(strip $(LAZYDATA)),true) @$(MAKE) --no-print-directory -f $(RHOME)/src/gnuwin32/MakePkg -s lazydata endif -- Seth Falcon

Re: [Rd] step() in sink() and Sweave()

2007-06-13 Thread Seth Falcon
tter to have outdated documents than crippled documents. I'm not trying to argue that the function shouldn't change, but if it is so annoying, you can also resolve this problem by defining your own step function and calling it (forgetting about withC

Re: [Rd] PATCH: install inst/ before doing lazyload on Windows

2007-06-13 Thread Seth Falcon
Seth Falcon <[EMAIL PROTECTED]> writes: > On Windows, package files in the inst/ subdir are installed after the > lazyload creation. This differs from Linux where inst/ is installed > _before_ lazyload creation. > > Since packages may need data in inst, I think the order o

Re: [Rd] Getting param names of primitives

2007-07-11 Thread Seth Falcon
ake sense so making it work seems like a good idea. I'll agree that it working might encourage someone to try formals<-(), but the fact that it cannot do anything but error seems like a strange reason not to make formals() work. + seth -- Seth Falcon | Computational Biology | Fred Hut

Re: [Rd] S4 coerce

2007-07-16 Thread Seth Falcon
uot; > > setAs("TSconnection", "DBIConnection", def = function(from) [EMAIL > PROTECTED]) I think things work as you expect up until this pint. > > setIs("TSconnection", "DBIConnection", coerce = function(x) > > [EMAIL PROTECTED]) I'

Re: [Rd] X11() dies in remote background

2007-07-21 Thread Seth Falcon
omplicate your desire to use X11(), but perhaps with Xvfb run from the screen session things will work. Do all of the graphics devices require access to X11()? I thought you could use pdf() for example, without X11() but I'm not certain. + seth -- Seth Falcon | Computational Biology |

[Rd] dict package: dictionary data structure for R

2007-07-21 Thread Seth Falcon
userprimary.net/software/dict_0.0.4.tar.gz Windows binary: R-2.5.x: http://userprimary.net/software/dict_0.0.4.zip + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.o

Re: [Rd] dict package: dictionary data structure for R

2007-07-21 Thread Seth Falcon
is what we see with an environment: > e = new.env(hash=T, size=2^14) > for (k in keys2) e[[k]] = k > summary(env.profile(e)$counts) Min. 1st Qu.Median Mean 3rd Qu. Max. 0.0.0.0.79350. 2700. -- Se

Re: [Rd] dict package: dictionary data structure for R

2007-07-23 Thread Seth Falcon
t it might actually be useful to people. It's main use may turn out to be for investigating hash functions behavior and for a test tool it may be sufficient as-is. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http://bioconductor.org __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] dict package: dictionary data structure for R

2007-07-23 Thread Seth Falcon
gate other hashing functions since computing the next prime and doing so for resizes will take longer than not having to do it and it will add complexity to the code. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center http:

Re: [Rd] Using R_MakeExternalPtr

2007-07-25 Thread Seth Falcon
reateSession(attributes); > void* temp = session; It isn't clear from your example, are you sure that temp is valid at this point? > SEXP out = R_MakeExternalPtr(temp, R_NilValue, R_NilValue); I was expecting to see: SEXP out = R_MakeExternalPtr((void *)sesPtr, R_NilValue,

Re: [Rd] Convert multiple C strings into an R character vector

2007-08-10 Thread Seth Falcon
i; SEXP cvect; PROTECT(cvect = allocVector(STRSXP, numStrings)); for (i = 0; i < numStrings; i++) { SET_STRING_ELT(cvect, i, mkChar(yourStrings[i])); } UNPROTECT(cvect); return cvect; + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer

Re: [Rd] package dependencies

2007-08-15 Thread Seth Falcon
eck can not be executed. The error message is: Instead of require(pkgname), simply list pkgname in the Depends field of your package's DESCRIPTION file. See the Writing R Extensions manual for details. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center Bi

Re: [Rd] Overriding S4 methods in an installed package

2007-08-18 Thread Seth Falcon
ly, then it will be much easier to simply edit the source for pkg, reinstall and test. If you find and fix a bug, most package maintainers will be quite happy to integrate your fix. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center BioC: http://bioconductor.org/ Blog: http://userprimary.net/user/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] [R] Suspected memory leak with R v.2.5.x and large matrices with dimnames set

2007-08-18 Thread Seth Falcon
you from getting things done, or just a concern that there is a leak that needs fixing? It is worth noting that the internal handling of character vectors has changed in R-devel and so IMO testing there would make sense before persuing this further, I suspect your results will be di

Re: [Rd] .Call and to reclaim the memory by allocVector

2007-08-25 Thread Seth Falcon
ding up with multiple copies of the object on the R side during some of your operations. I would recommend recompiling with --enable-memory-profiling and using tracemem() to see if you can identify places where copies of your large object are occurring. You can also take a look at Rprof(memory.

Re: [Rd] R CMD check: Error in function (env) : could not find function "finalize"

2007-08-28 Thread Seth Falcon
narrow it down, gctorture may help or running the examples under valgrind. + seth -- Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center BioC: http://bioconductor.org/ Blog: http://userprimary.net/user/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] R CMD check recursive copy of tests/

2007-08-31 Thread Seth Falcon
at R CMD check doesn't recurse really isn't a problem. You can have a driver script at the top-level that runs as many of the tests in subdirs as you want. And this is really a good thing since as you mentioned later in your response, some tests take a long time to run and prob

Re: [Rd] warning upon automatic close of connection

2007-09-12 Thread Seth Falcon
quot;yes" can write "yes" ## start new R session for (i in 1:75) file("foo") gc() warnings()[1:3] > gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 149603 4.0 35 9.4 35 9.4 Vcells 101924 0.8 786432 6.0 486908 3.8 There w

Re: [Rd] RSQLite indexing

2007-10-22 Thread Seth Falcon
he_size=64000 and synchronous=0 and that this was determined by a handful of experiments on typical annotation dbs. Columns with few levels may not benefit from an index. See this thread: http://thread.gmane.org/gmane.comp.db.sqlite.general/23683/focus=23693 But your column with many levels sho

Re: [Rd] package installation order

2007-11-14 Thread Seth Falcon
l probably already wrote it) but what you get from > getInstallOrder() should suit your needs here. makeDepGraph returns a graphNEL instance and Rgraphviz knows how to plot those. The entire graph will likely not produce a particularly compelling visualization. But you can subs

Re: [Rd] isOpen on closed connections

2007-11-14 Thread Seth Falcon
= { > close(con) > }) This doesn't address isOpen, but why do you have the call to close inside the tryCatch block? Isn't the idea that finally will always be run and so you can be reasonably sure that close gets called once? If your real

Re: [Rd] segfault in gregexpr()

2008-01-30 Thread Seth Falcon
gexpr("", "abc", fixed=TRUE) [[1]] [1] 1 2 3 attr(,"match.length") [1] 0 0 0 > gregexpr("", "abc", perl=TRUE) [[1]] [1] 1 2 3 attr(,"match.length") [1] 0 0 0 + seth -- Seth Falcon | [EMAI

Re: [Rd] segfault in gregexpr()

2008-01-31 Thread Seth Falcon
Hi again, > Herve wrote: > > gregexpr("", "abc", fixed=TRUE) > >*** caught segfault *** > address 0x1c09000, cause 'memory not mapped' This should be fixed in latest svn. Thanks for the report. + seth -- Seth Falcon | [EMAI

Re: [Rd] Suggestion: isLoaded() to test if a package is loaded (without loading it)

2008-02-21 Thread Seth Falcon
ckageName(package, version); > } > pattern <- sprintf("package:%s", package); > (pattern %in% s); > } This only tests whether or not the given package is attached to the search path. You also (I think) want to search loaded namespaces. Bu

Re: [Rd] R 2.7.0, match() and strings containing \0 - bug?

2008-04-28 Thread Seth Falcon
majority of R's internal string processing functions use standard C semantics and truncated at first nul there has always been some room for "interesting" behavior. The change in R-2.7 was an attempt to start resolving these inconsistencies. Since then the core team has agr

Re: [Rd] NAMESPACE & methods guidance, please

2008-06-01 Thread Seth Falcon
of namespaces, looking > in the search list seems a bad idea in principle. I agree that using the dynamic lookup when the static lookup is available is bad programming practice. However, given the flexibility of the current tools, it seems not unreasonable to expect that picking up a method via the se

Re: [Rd] RSQLite bug fix for install with icc

2008-06-04 Thread Seth Falcon
> in > RSQLite/src/RS-DBI.h I will see about making such a change. I suspect the correct fix is one that tweaks configure to determine where things are based on the current system (the current code is correct for gcc I believe). Anyhow, thanks for the report. I will try to have an up

[Rd] RSQLite 0.6-9 uploaded to CRAN [was: RSQLite bug fix for install with icc]

2008-06-10 Thread Seth Falcon
Hi all, A new version of RSQLite has been uploaded to CRAN and should be available soon. This update contains a minor change to the C code that should improve compatibility on various unix OS. + seth -- Seth Falcon | http://userprimary.net/user

Re: [Rd] how to install header files in package

2008-06-13 Thread Seth Falcon
ovided by pkgA, then you can use the LinkingTo field in the DESCRIPTION file as described in Writing R Extensions in the "Registering native routines" section. + seth -- Seth Falcon | http://userprimary.net/user/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

Re: [Rd] S4 coercion responsibility

2008-09-15 Thread Seth Falcon
is-a integer. The fact that the as() method dispatch doesn't match that of SQLiteConnection should really be that surprising. I don't see how this could be the responsibility of the author of the class you've subclassed. I would also quest

Re: [Rd] S4 coercion responsibility

2008-09-17 Thread Seth Falcon
A couple more comments... * On 2008-09-15 at 10:07 -0700 Seth Falcon wrote: > > The example is with RSQLite but the same thing happens with > > RMySQL, and other DBI packages. The use of as() within the various DBI packages should be re-evaluated. I suspect some of that code was amo

Re: [Rd] S4 coercion responsibility

2008-09-17 Thread Seth Falcon
* On 2008-09-17 at 19:25 -0700 Seth Falcon wrote: > In the latest R-devel code (svn r46542), this behaves differently (and > works as you were hoping). I get: > > library("RSQLite") > setClass("SQLConPlus", contains=c("SQLiteConnection","

Re: [Rd] S4 coercion responsibility

2008-09-17 Thread Seth Falcon
Continuing to talk to myself here... * On 2008-09-17 at 21:06 -0700 Seth Falcon wrote: > *argh* I'm certain this was working for me and yet when I try to > reproduce in a new R shell it errors out. This looks like an infelicity in the methods caching. To make it work: libra

Re: [Rd] R crashes on sprintf with bad format specification (PR#13283)

2008-11-13 Thread Seth Falcon
intf (call=0x10cb470, op=0x1018924, args=, env=0x10a40b0) at ../../../../R-devel-all/src/main/sprintf.c:179 #5 0x003fe1af in do_internal (call=0x10cb4a8, op=0x100fc38, args=0x10a40e8, env=0x10a40b0) at ../../../../R-devel-all/src/main/names.c:1140 + seth -- Seth Falcon | http://us

Re: [Rd] Side-effects of require() vs library() on x86_64 aka amd64

2009-01-31 Thread Seth Falcon
ifferent run paths resulted in different allocation patterns, one of which triggered the bug. + seth -- Seth Falcon | http://userprimary.net/user/ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel

<    1   2   3   4   >