Displaying 20 results from an estimated 12000 matches similar to: "Multiple commands per priority"
2011 May 26
3
change function scope?
I'm still getting used to R's scoping. I've run into the following situation
value=0
thefunction <- function() print( value )
somefunction <- function() { value=99; thefunction() }
somefunction()
now, I understand that somefunction() returns 0 because thefunction() was
defined with value=0 in its parent envrionment, it dosent look at all in the
environment of somefunction. My
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?
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
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
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.
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
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 ==
2009 Jul 23
2
Navigate to Index page of a package from R command prompt
Hi all,
Is there a way to navigate directly to the "Index" page of help
for a package?
Here's my connundrum:
I download and install package "foo".
I don't know what functions are in package "foo",
so I can't invoke the help for package "foo" via
> ?someFunction
help(package = "foo")
pops up some non-hyperlinked information page,
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]]
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
2006 Feb 24
3
Summarize by two-column factor, retaining original factors
I am having trouble doing the following. I have a data.frame like
this, where x and y are a variable that I want to do calculations on:
Name Year x y
ab 2001 15 3
ab 2001 10 2
ab 2002 12 8
ab 2003 7 10
dv 2002 10 15
dv 2002 3 2
dv 2003 1 15
Before I do all the other things I need to do with this data, I need
to summarize or collapse the data by name and year. I've
2019 Jan 16
2
Skipping construction/destruction of stack allocated objects
Hello,
For performance reasons, I would like to provide a way to skip
construction/destruction of objects that are stack allocated. Typically,
C-style arrays of std::complex create an initialization loops that is
almost always unnecessary.
I am thinking of providing an __attribute__((uninitialized)) that can be
applied to an object declaration:
{
std::complex<float> foo[64][64]
2009 May 10
4
Partial Derivatives in R
Quick question:
Which function do you use to calculate partial derivatives from a model
equation?
I've looked at deriv(), but think it gives derivatives, not partial
derivatives. Of course my equation isn't this simple, but as an example,
I'm looking for something that let's you control whether it's a partial or
not, such as:
somefunction(y~a+bx, with respect to x,
2008 Aug 13
1
Arguments to lm() within a function - object not found
Hi all,
I'm having some difficulty passing arguments into lm() from within a
function, and I was hoping someone wiser in the ways of R could tell me
what I'm doing wrong. I have the following:
lmwrap <- function(...) {
wts <- somefunction()
print(wts) # This works, wts has the values I expect
fit <- lm(weights=wts,...)
return(fit)
}
If I call my function lmwrap, I get
2010 Nov 04
1
removing indexing
R-help,
I was wondering how to remove indexing from an output, e.g.,
> aVector<-1:10
> aVector
[1] 1 2 3 4 5 6 7 8 9 10
> someFunction(aVector)
1 2 3 4 5 6 7 8 9 10
Thanks in advance
[[alternative HTML version deleted]]