similar to: change function scope?

Displaying 20 results from an estimated 2000 matches similar to: "change function scope?"

2000 Jul 25
2
number of parameters of a function.
Is there a way to programmatically determine how many arguments a function accepts? In S, one can compute this as length(theFunction) - 1 and determine the parameter names as names(theFunction) due to the representation of functions. (Just in case anyone is thinking of nargs(), that is just for particular calls and does not concern itself with the function definition.)
2011 Mar 30
3
how about a "<p-" operator?
I was cursing Matlab again today (what else is new) because the default action for every Matlab command is to spew the result to the console, and one must remember to put that darn ";" at the end of every line. So I just wondered: was there ever a discussion as to providing some modified version of the "<-" and "->" operators in R to do the reverse?
2006 Mar 21
2
Multiple commands per priority
Hi everybody. I have been searching and trying for an answer, but no luck, so here I go.. Is there anyway to execute multiple commands on a single priority in extensions.conf? eg: exten => X.,1,Dial(SIP/1111) & somefunction(${EXTEN}) I need the dial command to dial internal extensions, and the "somefunction" to kick of our own outgoing system for redirection to outside lines;
2010 Feb 17
2
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
I am new to llvm so I might be missing a critical step. My system is Fedora 12 but this also happens in Mac OS X 10.6.2. Here are the steps I used to compile llvm: export TARGETS=x86,x86_64,cpp export INSTALLDIR=/home/rovitotv/llvm ../llvm-2.6/configure --prefix=$INSTALLDIR --enable-bindings=none --enable-targets=$TARGETS --enable-optimized --with-llvmgccdir=$INSTALLDIR
2010 Feb 17
0
[LLVMdev] Kaleidoscope toy4 failure seg fault on llvm::ExecutionEngine::getTargetData (this=0x0)
First, you have to call llvm-g++ to use the llvm-gcc front end, but it doesn't matter here. I'd like to suggest that you use pastebin to put your code and the send us the link, so that we can download it. The problem is that TheExecutionEngine is set to NULL (maybe because of a previous error), but it will be really better if you use pastebin. On Wed, Feb 17, 2010 at 6:01 AM, Todd Rovito
2010 Dec 01
2
default arguments and '...' in a function
Dear R-users, I'm trying to work out a way to set default values for arguments in a function which includes the optional argument '...'. In practice, I have a 'plot' method for a function which specifies different types of plots. Every different plot should have different default arguments (for example for 'col', 'ylim' etc), plus the argument '...' to
2011 Mar 11
2
How to get all combinations between two character vectors?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi I know there is a function - I have used it before - but I always forget what it is called... I need the combination of two character vectors, i.e: x <- c("a", "b") y <- c("x", "y") z <- THEFUNCTION(x, y) z == c("ax", "ay", "bx", "by") I promise I will
2002 Nov 07
2
combinations
I need to construct all possible combinations of an vector of length N taken X at a time for simulation purposes. Taking a a small vector as an example: >input <- c('a','b','c','d') >somefunction(input) a,b,c a,b,d a,c,d b,c,d my only solution thus far is: somefunction <- function(x){ ...a series of grotesque and horribly inefficient loops
2004 Feb 27
1
Outer with Three Vectors
Hello, outer() is great for avoiding things like: for (val1 in val1s) { for (val2 in val2s)) { x[i,j] <- somefunction(val1, val2) } } The same can be obtained with: outer(val1s, val2s, somefunction) But what if there are three (or more) sets of values to loop over? Any way of avoiding the loops then? Thanks, -- Wolfgang Viechtbauer
2009 Oct 11
3
[LLVMdev] Problems linking shared library with __declspec(dllexport)
Hi all, I am trying to use llvm-gcc to link shared libraries on windows/mingw32. When I try to link libraries that contain functions declared with __declspec(dllexport) someFunction(); I get the link error: Cannot export _someFunction: symbol not found Removing the declspec directive solves the problem, but this is not a very feasible solution for me. Using 'regular' gcc does not
2009 Oct 11
0
[LLVMdev] Problems linking shared library with __declspec(dllexport)
> I am trying to use llvm-gcc to link shared libraries on windows/mingw32. > When I try to link libraries that contain functions declared with >  __declspec(dllexport) someFunction(); > > I get the link error: > >  Cannot export _someFunction: symbol not found dllexport declspec should be put on the function definition, in this example there is nothing to export - dllexport
2007 Feb 28
1
problem with help.start and ?somefunction
Hi all, I am going to be teaching a workshop next week using R and Bioconductor in one of our university's computer labs. They have recently installed R 2.4.1 for me, and I'm checking all my scripts. I just noticed that using the ?somefunction call to access the documentation for that function is not working. On my own PC, the ? call output changed between R 2.3 and 2.4; before it would
2005 Apr 20
5
Overloading methods in R
(1) It seems to me that, generally, in R it is not possible to overload functions. Is that right? (2) Assuming that the above is true, or partially true, is there any extra packages to handle overloading in R? (3) Assuming (1) is TRUE and (2) is FALSE, can anyone provide some advice on developing some function that understand what the arguments are and then calls the right overloaded
2016 Jun 14
2
Calling a null pointer. How undefined it is?
Hi all: This question is related to a state machine generated by LLVM for a coroutine. I stripped all coroutine related details to get to the essence of the question. Let's say I have a state machine that looks like this: struct State { FnPtr Fn; State() : Fn(&SomeFunction) {} void Go() { (*Fn)(); } void Stop() { Fn = nullptr; } bool IsDone() { return Fn ==
2008 Mar 25
1
peak finding
Hi all Is there a function that can find the start and end position of peaks in a set of numbers. eg. x=c(14,15,12,11,12,13,14,15,16,15,14,13,12,11,14,12) y=somefunction(x) y 4 14 Thanks John [[alternative HTML version deleted]]
2008 May 13
2
Remove an object by the reference
Hi R, A simple question, but don't know the answer... x="a" a=5 I need to remove the object "a" by using only x. something like rm(somefunction(x))...Is this possible? Shubha Karanth | Amba Research Ph +91 80 3980 8031 | Mob +91 94 4886 4510 Bangalore * Colombo * London * New York * San José * Singapore * www.ambaresearch.com This e-mail may contain
2010 May 12
3
intersect
Hi there, how can I test every element in a vector whether appears in another vector? such as a<-c("aa", "bb", "ff", "cc") b <-c("oo","jj","bb","cc") somefunction(a,b) gives [False, True, False, True] thanks yuan jian [[alternative HTML version deleted]]
2007 Feb 27
3
How to use bash command in R script?
Dear All: Maybe it is a too basic question, but I don't how to find the answer. Sorry for that. What I want to do is call a shell command, which will provide two numbers, and assign those numbers to a vector. For example: The following command: $mxresult.sh ABC.mx mxresult.sh is a script written by myself and ABC.mx is a Mx script. I can get two numbers, 126.128 and 29, with this command.
2018 Jul 23
2
LLVM FunctionType cannot be returned as VectorType?
Hi Stefan, Thank you very much for answering my question! I followed your suggestion but the function still cannot return the correct result. I also set target-feature attributes for my function. I am using LLVM 6.0. It only prints out some random large numbers but the correct answer is supposed to be all 0. Can you please help me figure out what's going on here? Any help will be greatly
2010 Mar 12
2
[LLVMdev] large modules, PPC on OS X, "ld: 32-bit pic-base out of range in"
I'm trying to build a very large shared library (bundle) for PPC on Mac OS X 10.5. The build looks something like this, where mybundlebitcode.o is the large object llc -relocation-model=pic -o=mybundle.s mybundlebitcode.o gcc -arch ppc -c -x assembler -o mybundle.o mybundle.s g++ -o mybundle.bundle -bundle mybundle.o -lotherlibrary I get the following error: ld: 32-bit pic-base out of