search for: myfoo

Displaying 20 results from an estimated 21 matches for "myfoo".

2002 May 18
5
Length of a string
Hi, Suppose I have created something like this in R: foo <- "myfoo" and I want to find out the number of character in foo (in other words, R should return 5 since "myfoo" has 5 charactors. How can I do it? I tried: length(foo) but it returned 1. Cheers, Kevin ------------------------------------------------------------------------------ Ko-Ka...
2009 Sep 11
4
[LLVMdev] LLVM-GCC & GV zeroinitializers, 2.5 vs 2.6.
Hello folks, I have a small piece of C code written like this: typedef struct { char a; int b; int c; } foo; foo myFoo[5] = {{0}}; With llvm-gcc 2.5, I get the following IR: %struct.foo = type { i8, i32, i32 } @myFoo = global [5 x %struct.foo] zeroinitializer, align 32 With the current 2.6, I get this: %0 = type { i8, [11 x i8] } %struct.foo = type { i8, i32, i32 } @myFoo = global [5 x %0] z...
2012 Feb 08
1
optparse::parse_args, using equals sign or not
Hi We've found that when using parse_args(..., positional_arguments=FALSE), it is permissible to invoke our script with either "--myfoo=bar" or "--myfoo bar"; that is, whether or not the equals sign is present makes no difference, and in fact both usage forms are demonstrated in the optparse vignette. However, we've found that when using parse_args(..., positional_arguments=TRUE), it is no longer possible to...
2011 Jul 23
1
call a function with explicitly not setting an argument
...second function, myfun2, serializes all arguments and is out of my control. myfun <- function(...){ return(myfun2(...)); } now, the value for arguments of myfun are stored in variables. Say I want to call it with arguments 'foo' and 'bar', which are stored in variables 'myfoo' and 'mybar'. So in my script I call myfun(foo=myfoo, bar=mybar); However, I also want to be able to call myfun2 without any arguments. Is there any value that I can assign to myfoo and mybar, so that myfun(foo=myfoo, bar=mybar); is identical to myfun(); -- View this message in c...
2009 Sep 11
0
[LLVMdev] LLVM-GCC & GV zeroinitializers, 2.5 vs 2.6.
...7:55:37 PM > Subject: [LLVMdev] LLVM-GCC & GV zeroinitializers, 2.5 vs 2.6. > > Hello folks, > > I have a small piece of C code written like this: > > typedef struct { > char a; > int b; > int c; > } foo; > > foo myFoo[5] = {{0}}; > > With llvm-gcc 2.5, I get the following IR: > > %struct.foo = type { i8, i32, i32 } > @myFoo = global [5 x %struct.foo] zeroinitializer, align 32 > > With the current 2.6, I get this: > > %0 = type { i8, [11 x i8] } > %struct.foo = ty...
2011 May 26
1
Is it possible to define a function's arguments via a wildcard in 'substitute()'?
...that the function's formal arguments are specified by a "wildcard" that is substituted when the expression is evaluated? Simple example: x.args <- formals("data.frame") x.body <- expression( out <- myArg + 100, return(out) ) expr <- substitute( myFoo <- function( ARGS, myArg ){ print("hello world!") print(ARGS) eval(BODY) }, list(ARGS=x.args, BODY=x.body) ) eval(expr) myFoo(myArg=5) # works myFoo(a=1:3, stringsAsFactors=FALSE, myArg=5) # does not work It works for wild...
2001 Nov 09
1
One package calling C-code from another package.
Dear R people We have two packages, where the first package (geoR) is required by the second (geoRglmm). Both packages have functions calling C-code via .C(). We would like to call C-functions included in the first package from within the C-code in the second package. Is this possible? An appropriate header file was included in the src directory of the second package but this alone did not
2006 Apr 11
4
Managing "application scope" data - best practices
All, I have some data that I need to be able to see across the application. For J2EE people out there, I need something that I want to have available in the "application scope" of my app. What is the best way to handle this? I''m trying to access a class variable that I created in my controller from my view (to no avail). Create a class variable in my helper class and use
2005 Aug 25
1
"couldn't find function" error message in R 2.1.1
Dear R-help, I have a home-made package works perfectly under R 1.9.1. Now I'm trying to port it to R > 2.0. So I rebuild the package under R 2.1.1. It installs and loads OK. But when I try to call some functions "myfoo" in this package, it returns error message: "Couldn't find function myfoo". I checked all available manuals, and didn't find any specific requirement that I'm violating. Have anybody in the list ever had similar problem before and how did you solve it? Thanks a lot for...
2011 Feb 26
0
[LLVMdev] LLVM IR Type System Rewrite
...temRewrite.txt > > Comments welcome! So struct types would unique by name. How important would it be for the linker to preserve those names? Because I can think of a few examples where it could be problematic. For instance, if you want to link %Foo = type { i32 } %Bar = type { i32 } %myFoo = global %Foo declare void @useBar(%Bar* %arg) ; ... with %Baz = type { i32 } %myFoo = global %Baz declare void @useBar(%Baz* %par) ; ... then AFAICS the linker would either have to insert some casts (ugly) or it would need to somehow recognize that %Baz, %Foo *and* %Bar need to be...
2010 Apr 27
2
Resolving functions using R's namespace mechanism can double runtime
It appears that the runtime for an R script can more than double if a few references to a function foo() are replaced by more explict references of the form pkgname::foo(). The more explicit references are of course required when two loaded packages define the same function. I can understand why use of this mechanism is not free in an interpreted environment like R, but the cost seems rather
2010 Apr 15
1
R CMD REMOVE etc. query
I've been working on a fairly complex package that is a wrapper for several optimization routines. In this work, I've attempted to do the following: - edit the package code foo.R - in a root terminal at the right directory location R CMD REMOVE foo R CMD INSTALL foo However, I don't get the right code. In fact, if I just do the remove, library(foo) does not throw an
2010 Feb 12
1
Darwinian software development and the library function
Hi all, Legend has it, that polite R programmers don't overwrite, say, the print function. However, this seems quite un-Darwinian to me (especially given that I don't want to call all my arguments x and y). I might want a function print.foo (myfoo, ...). So I decided to be very impolite (in one of my packages) and overwrite a few standard generics. Plus, to the best of my knowledge it doesn't interfere with normal use (yay...). This brings us to the library function. Which by default gives a whole lot of warnings loading my package (an...
2011 Jun 09
1
Error: missing values where TRUE/FALSE needed
I'm writing a function and keep getting the following error message. myfunc <- function(lst) { lst <- list(roots = c("car insurance", "auto insurance"), roots2 = c("insurance"), prefix = c("cheap", "budget"), prefix2 = c("low cost"), suffix = c("quote", "quotes"), suffix2 = c("rate",
2004 Aug 24
2
Run function in BATCH mode?
Hi, I am working on a shell script where i need to start a R function defined in a script. I know how to run the script; with R CMD BATCH script which would be equal to source("script") in R. But how do I run a function(param) of that script in the BATCH mode? Thanks in advance.
2018 May 21
1
S4 class slot type S4 class
All, I am considering creating an S4 class whose slots (2) are both S4 classes. ?Since an S4 slot can be an S3 class I figure this can be done. ?However, the correct syntax of which I am unsure. ?Reviewing the docs I have come to the following conclusion: SetClass('myfoo', ? ? ? ? ? ? ? ? ? slots = (foo1, foo2)) Without a type I believe each slot is .Data. ?A get method on the above class slots would return say foo1 which will have all methods and generics belonging to foo1 class. ?Is this the correct approach? Best, Glenn
2007 Aug 17
3
Is there any good tools to facilitate us to create R functions?
Dear R users, We have some programs for the specific task in our research, but they were very commonly used. We want to make some functions for them, anybody can recommend any good tools to facilitate us to create R functions even without going deep into the theories of R functions ? Any suggestions or help are greatly appreciated. -- With Kind Regards, oooO::::::::: (..):::::::::
2006 Jun 06
1
vague errors on R CMD check for very minimal S4-style package
...graphics" "grDevices" "utils" "datasets" "base" > library(simplepkg,lib.loc="/home/roels/R/lib") > > getClass("foo") Slots: Name: name age Class: character numeric > > myfoo <- new("foo",name="abc",age=10) > myfoo I am abc > But when I do R CMD check, it fails (or perhaps the "errors" are really "warnings"??): --------------------------------------- sun890% R CMD check simplepkg * checking for working latex ... OK *...
2011 Feb 26
17
[LLVMdev] LLVM IR Type System Rewrite
Several people have been proding me to write up my thoughts on how to fix the IR type system for LLVM 3.0. Here are some (fairly stream of conscious) thoughts on the matter: http://nondot.org/sabre/LLVMNotes/TypeSystemRewrite.txt Comments welcome! -Chris
2012 Oct 02
3
PROBLEM : Cannot require an Exec
hello: i currently am using Puppet to run some commands in a sequence. there are two sequences of exec resources. we found that we cannot use require => Exec and it does not work at all as expected. here is some sample code. exec { "exec-AAA": command => "/bin/true", returns => 0, notify => Exec["exec-BBB"], } exec { "exec-BBB":