search for: foo2

Displaying 20 results from an estimated 298 matches for "foo2".

Did you mean: foo
2010 Nov 15
2
How to move an internal function to external keeping same environment?
Hi I have within a quite big function foo1, an internal function foo2. Now, in order to have a cleaner code, I wish to have the internal foo2 as "external". This foo2 was using arguments within the foo1 environment that were not declared as inputs of foo2, which works as long as foo2 is within foo1, but not anymore if foo2 is external, as is the case no...
2006 Jul 02
4
Test for argument in ...
Hello! Say I have a function foo1, which has argument ... to pass various arguments to foo2 i.e. foo1 <- function(x, ...) { foo2(x, ...) } Say that foo2 accepts argument arg1 and I would like to do the following: - if foo1 is called as foo1(x) then I would like to assign some value to arg1 inside foo1 before calling foo2 arg1 <- "some value" foo2(x, arg1=arg1) - if f...
2006 Oct 11
1
dispatching on group generics with more than one formal
please see the code below. foo2 fails to dispatch correctly, but foo does fine. i have tried 'cacheMetaData(1)' and a number of different variants of 'cacheGenericsMetaData', on the possibility there is a caching issue. but i still can't sort it out. also one general question: does it really matter wh...
2006 Apr 11
2
About list to list - thanks
Thank you very much for your useful suggestions. These are exactly what I was looking for. foo <- list(foo1, foo2, foo3) lapply(foo, function(x) matrix(unlist(x), nrow = length(x), byrow = TRUE)) or lapply(foo, function(x) do.call('rbind', x)) Best, Muhammad Subianto On 4/11/06, Muhammad Subianto <msubianto at gmail.com> wrote: > Dear all, > I have a result my experiment like this below (...
2006 Apr 11
2
About list to list
Dear all, I have a result my experiment like this below (here my toy example): foo1 <- list() foo1[[1]] <- c(10, 20, 30) foo1[[2]] <- c(11, 21, 31) foo2 <- list() foo2[[1]] <- c(100, 200, 300) foo2[[2]] <- c(110, 210, 310) foo3 <- list() foo3[[1]] <- c(1000, 2000, 3000) foo3[[2]] <- c(1100, 2100, 3100) list(foo1,foo2,foo3) The result: > list(foo1,foo2,foo3) [[1]] [[1]][[1]] [1] 10 20 30 [[1]][[2]] [1] 11 21 31 [[2]] [[2]][...
2012 Jul 27
1
C code validation
...x <- setdiff(x, findSubsets(y + 1, x[index], max(x))) + } + return(x) + } > > set.seed(12345) > exprnec <- sort(sample(13:19683, 500)) > noflevels <- rep(2, 9) > mbase <- rev(c(1, cumprod(rev(noflevels + 1))))[-1] > foo1 <- benchmark(exprnec, noflevels) > foo2 <- .Call("removeRedundants", exprnec, noflevels, mbase) > > all.equal(foo1, foo2) [1] "Numeric: lengths (184, 181) differ" > > > set.seed(12345) > exprnec <- sort(sample(13:19683, 500)) > foo2 <- .Call("removeRedundants", exprnec, noflevel...
2010 Mar 15
2
Strange behavior of assign in a S4 method.
...foo1")}) setMethod(f="foo1",signature="numeric",definition= function(x,y=1,...){ nameX<-deparse(substitute(x)) x <- x^2 assign(nameX,x,envir=parent.frame()) } ) e <- 3 foo1(e,y=5) cat(e) #------ Does work ------# setGeneric("foo2",function(x,...){standardGeneric("foo2")}) setMethod(f="foo2",signature="numeric",definition= function(x,...){ nameX<-deparse(substitute(x)) x <- x^2 assign(nameX,x,envir=parent.frame()) } ) e <- 3 foo2(e,y=5) cat(e)
2014 May 02
1
Authors@R: and Author field
Hi to all Authors@R: c(person("fooa","foob", role = c("aut","cre"), email = "fooa.foob@fooc.de"), person("foo1","foo2", role = c("ctb"), email = "foo1.foo2@foo3.de")) Author: fooa foob, with contributions from foo1 foo2 using r CMD check --as-cran .. (R 3.1 and Windows) I get an error Author field differs from that derived from Authors@R Author: 'fooa foob, wi...
2018 Apr 05
1
potential file.copy() or documentation bug when copy.date = TRUE
This is a recent R-devel. file.copy() is not vectorized if multiple destinations succeed: cat("foo1\n", file = "foo1") cat("foo2\n", file = "foo2") unlink(c("copy1", "copy2"), recursive = TRUE) file.copy(c("foo1", "foo2"), c("copy1", "copy2"), copy.date = TRUE) #> Error in Sys.setFileTime(to[okay], fi$mtime) : invalid 'path' argument # B...
2010 Feb 10
1
How to solve: Error in * unused argument(s) ?
Hi all, For some reason, I would like to use functions bellow (see example code bellow), but instead I get the following error message: *Error in foo2(...) : unused argument(s) (arg3 = 3)* #--------------------- # example code #--------------------- foo1 <- function(arg1,...) { print(arg1) foo2(...) foo3(...) } foo2 <- function(arg2) { print(arg2) } foo3 <- function(arg3) { print(arg3) } foo1(arg1 = 1, arg2 = 2, arg3 =3) #------...
2012 May 29
1
Slow do.call when having an error
...d the problem to the following small reproducible example: Consider the following function: foo <- function(nr = 2e6, nc=3, use.do.call = FALSE) { nn <- paste("V", 1:nc, sep="") z <- data.frame(matrix(rnorm(nr*nc), nrow=nr, ncol = nc, dimnames = list(NULL, nn))) foo2 <- function(x) x[,"V1"] + x[,"V0"] if (use.do.call) do.call(foo2, list(z)) else foo2(z) } foo2, when called, generates an error because it accesses the V0 column which does not exist. When use.do.call==FALSE, foo2 is called directly. When use.do.call==TRUE, foo2...
2008 Mar 25
1
Passing (Optional) Arguments
Dear List: In short, I am writing a number of functions as building blocks for other functions and have some questions about scoping and passing arguments. Suppose I have functions foo1, foo2, and foo3 such that: foo1<-function(a=1,b=TRUE,c=FALSE){#do stuff}; foo2<-function(x=1,y=FALSE,z=c(1,2,3,4)){#do stuff}; foo3<-function(lambda,...){lambda*foo1()*foo2()}; I want to be able to pass a,b,c,x,y,z to the functions foo1 and foo2 though foo3 (whether I define default values...
2019 Nov 12
0
RFC 5258 violation: incomplete response for "LIST ($OPT RECURSIVEMATCH) ..."
...s that don't meet the selection criteria, regardless of whether they have a child that does. The violation is visible when reproducing example #9 from Section 5 [0]: $ env -i USER=user HOME=/dev/shm/dovecot-test/user PATH=/usr/bin:/bin \ doveadm -c /tmp/dovecot.conf mailbox create foo2 baz2 $ env -i USER=user HOME=/dev/shm/dovecot-test/user PATH=/usr/bin:/bin \ doveadm -c /tmp/dovecot.conf mailbox create -s \ foo2/{bar1,bar2} baz2/{bar2,bar22,bar222} eps2 eps2/mamba qux2/bar2 $ env -i USER=user HOME=/dev/shm/dovecot-test/user PATH=/usr/bin:/bin \...
2012 Jan 15
1
Calling Fortran from R: Issues with dynamic loading of fortran dll
...my fortran procedures under WinXP and 32 bit R. Alas, the same isn't true with my next Windows 7/64 machine, R 2.14.1 (64 bit) and the gnu gfortran (64) compiler (mingw64 v. 4.6.1). Though I'm able to compile the routines from the command line using gfortran '...', .Fortran('foo2') results in an error saying the Fortran symbol name "foo2" not in load table. foo.f90: Module foo contains Subroutine foo2(x) real(kind=8),intent(inout) :: x x = x + 2 end subroutine foo2 end module foo c:\mingw64\bin\gfortran --shared -Wall -pedantic -g -o foo.dll f...
2006 Jun 29
3
advice on arguments
I have a general style question about R coding. Suppose I'm writing a function (foo1) that calls other functions (foo2, foo3, ...) which have complicated argument lists (e.g. optim(), plot()), _and_ I may be calling several different functions in the body of foo1. Since foo2 and foo3 have different sets of arguments, I can't just use "..." ; I did write some code a while ago that would look at formal...
2012 Oct 17
1
Do *not* pass '...' to NextMethod() - it'll do it for you; missing documentation, a bug or just me?
...ing pitfall when using NextMethod(): If you explicitly pass argument '...' to NextMethod(), you will effectively pass those argument twice to the "next" method! EXAMPLE: foo0 <- function(...) UseMethod("foo0"); foo1 <- function(...) UseMethod("foo1"); foo2 <- function(...) UseMethod("foo2"); foo2.A <- foo1.A <- foo0.A <- function(object, a=1, b=2, c=3, d=4, ...) { str(c(list(object=object, a=a, b=b, c=c, d=d), list(...))); } ## CORRECT: Don't pass arguments '...', but all other ## *named* arguments that you wish...
2014 Dec 08
2
CRAN packages mis-using \donttest : falsy
...: [...] > Why not declare colorspace as a "Suggests:" kind of dependency? I guess that is a solution. :/ In another example in the 'disposables' package I have: \donttest{ pkg <- make_packages( foo1 = { f <- function() print("hello!") ; d <- 1:10 }, foo2 = { f <- function() print("hello again!") ; d <- 11:20 } ) foo1::f() foo2::f() foo1::d foo2::d dispose_packages(pkg) } So in this case should I suggest 'foo1' and 'foo2'? Gabor [...]
2015 Dec 17
2
Multiple IPs and hostname
Hi, I'm running postfix as SMTP-server and dovecot as IMAP-server. The server has multiple IPs, and postfix is configured that every domain is using a separate IPv4-address. Examle: foo1.com --> 11.22.33.44 foo2.com --> 22.33.44.55 foo3.com --> 33.44.55.66 bar.org --> 66.77.88.99 The hostname of the server is: mail.bar.org Now I have a request from one of my customers, who is using 3 different domains: - foo1.com - foo2.com - foo3.com If he receives a mail to "user at foo1.com"...
2010 Apr 29
3
dump not evaluating promises?
I'm using the dump command to pass data to WinBUGS/OpenBUGS/JAGS and have run into a problem. Here is some R-code: foo <- array(1:6, dim=c(2,3)) dump('foo', file='dumpdata.R') dump('foo', file='dumpdata.R', append=TRUE, evaluate=TRUE) foo2 <- array(c(2,3,5,7,9,7,5,3), dim=c(2,4)) dump('foo2', file='dumpdata.R', append=TRUE) And here is the file dumpdata.R: foo <- structure(1:6, .Dim = 2:3) foo <- structure(1:6, .Dim = 2:3) foo2 <- structure(c(2, 3, 5, 7, 9, 7, 5, 3), .Dim = c(2L, 4L)) Looking at the hel...
2010 Oct 29
2
[LLVMdev] strict aliasing and LLVM
...could tell it to pass a flag along to them, but it doesn't. As it > stands, you can't turn -enable-tbaa on when running clang. > > So, putting that together, one way to do it is: > > clang -O2 -fstrict-aliasing foo.c -flto -c -o foo.bc > opt -O2 -enable-tbaa foo.bc foo2.bc > llc -O2 -enable-tbaa foo2.bc -o foo2.s clang -O2 foo.c -S -o foo.s -mllvm -enable-tbaa