similar to: Locating code that is outside of functions in R scripts

Displaying 20 results from an estimated 4000 matches similar to: "Locating code that is outside of functions in R scripts"

2009 Aug 13
1
prop.test() - need algorithm or reference
Preparing a paper for a medical journal. Using the prop.test() function in R (v2.4.0) to compare two groups' response to data like the following. A sample of 100 individuals from Population I, 18 with positive readings from a certain test, vs. A sample of 148 individuals from Population II, 61 with positive readings. Results look like this: R version 2.4.0 Patched (2006-11-25
2011 Sep 06
2
Generalizing call to function
Hello guys, I would like to ask for help to understand what is going on in "func2". My plan is to generalize "func1", so that are expected same results in "func2" as in "func1". Executing "func1" returns... 0.25 with absolute error < 8.4e-05 But for "func2" I get... Error in dpois(1, 0.1, 23.3065168689948, 0.000429064542600244,
2013 Oct 29
1
[LLVMdev] JIT'ing 2 functions with inter-dependencies
I am having problems JIT'ing 2 functions where one of them calls the other. (I am using the old JIT interface). Here is the setup: define void @func1() { entrypoint: call void @func2(void) ret void } define void @func2(void) { entrypoint: ret void } (I omit the arguments and function bodies for simplicity.) It's 'func1' that would be called from host code,
2007 Nov 26
3
Communicating from one function to another
My question is a seemingly simple one. I have a bunch of user-defined functions which compute such-and-such objects. I want to be able to define a variable in a particular function, then make use of it later, perhaps in a different function, without necessarily having to move it around in argument lists. In the C community, it would be called a "global" variable. Question 1: Is this
2015 Apr 19
2
[LLVMdev] LLVM IR for inline functions
Hi, I have a naive question on how to generate LLVM IR for inline functions. I have compiled this C code: *inline void func1()* * {* * int x=3;* * }* * void func2()* * {* * func1();* * int y = 4;* * }* into LLVM IR, using clang -emit-llvm -S -c <filename> But the generated LLVM IR file does *not* have func1() expanded (see below for the relevant parts). *; Function Attrs: nounwind
2009 Sep 14
1
[LLVMdev] How to split module?
Hi, all. My question is about how to split one module into N modules(N >= 2)? For example, given the following code: #src.c# int main() { //......// func1(); func2(); //......// return 0; } void func1() { //......// } void func2() { //......// } func1() has no dependence with func2(), so they can perform parallel execution. And I have to split src.c into src1.c
2000 Sep 06
2
reusing external functions across libs
Hi, I am searching for a way to solve the following problem: I want to use an external function, defined in a dyn.load()ed shared object, in another dyn.load()ed shared object. Currently I have to take the sources (Fortran) from one libraries src/ directory and copy them into the src/ dir of the other library, resulting in two copies of this function. This is bad for maintanance and maybe also
2011 Feb 17
1
Integrate with an indicator function
Hi all, I have some some problem with regard to finding the integral of a function containing an indicator function. please see the code below: func1 <- function(x, mu){ (mu^2)*dnorm(x, mean = mu, sd = 1)*dgamma(x, shape=2)} m1star <- function(x){ integrate(func1, lower = 0, upper = Inf,x)$val} T <- function(x){ 0.3*dnorm(x)/(0.3*dnorm(x)+0.7*m1star(x))} func2 <-
2003 Jun 09
1
Questions for package ts prediction
Dear helpers, I am trying to write a function to return prediction values using package ts. I have written three different versions since I am not sure what's wrong with my func2. func and func1 return the same results.But func1 and func2 don't. In particular, the only difference between "func1" and "func2" is the function variable name being y and data, respectively.
2011 Feb 17
1
Integration with an Indicator Function in R
Hi all, I have some some problem with regard to finding the integral of a function containing an indicator function. please see the code below: func1 <- function(x, mu){ (mu^2)*dnorm(x, mean = mu, sd = 1)*dgamma(x, shape=2)} m1star <- function(x){ integrate(func1, lower = 0, upper = Inf,x)$val} T <- function(x){ 0.3*dnorm(x)/(0.3*dnorm(x)+0.7*m1star(x))} func2 <-
2007 Jun 01
2
Getting names of objects passed with "..."
Is there a tidy way to get the names of objects passed to a function via the "..." argument? rbind/cbind does what I want: test.func1 <- function(...) { nms <- rownames(rbind(..., deparse.level=1)) print(nms) } x <- "some stuff" second <- "more stuff" test.func1(first=x, second) [1] "first" "second" The usual
2012 Sep 27
1
Is there a way to source from a specific Git repository without hardcoding the location everywhere?
Folks, A small group of us are working together to develop a set of R functions to support data management and analysis using Eclipse/StatET in a Windows environment. We are using Git/EGit for version control. We work within our own repository and occasionally push to a common remote location. I'd like to have the code source files from the 'local' git repository without
2010 Jun 16
3
[LLVMdev] Strange pointer aliasing behaviour
I'm hitting a strange pointer aliasing "bug". Here is a test case : /* SOURCE CODE */ #define little_list_size 8 class LittleList1 { public: int _length; double _data[ little_list_size ]; LittleList1( int length ) { _length = length; for( int i=0; i<length; i++ ) _data[i] = 0; } }; class LittleList2 { public: int _length; double _data[ little_list_size ];
2008 Jul 26
4
parametric bootstrap
Hi I am trying to find a parametric bootstrap confidence interval and when I used the boot function I get zero bias and zero st.error? What could be my mistake? Thank you and take care. Laila [[alternative HTML version deleted]]
2003 Dec 09
2
: global and local variables
Hi all I have a problem pertaining to local and global variables. Say I have a function defined as follows: a<-function(x) {y<x^2} i.e a(2) [1] 4 function b is now defined to take the value of y and do some manipulation with it. As it stands I dont know how to store the variable y such that other functions are able to reference its value. I know that I
2011 Oct 11
3
Chi-Square test and survey results
An organization has asked me to comment on the validity of their recent all-employee survey. Survey responses, by geographic region, compared with the total number of employees in each region, were as follows: > ByRegion All.Employees Survey.Respondents Region_1 735 142 Region_2 500 83 Region_3 897 78
2009 Mar 30
1
[LLVMdev] Determining the base offset of the stack for a function.
I am running into an issue where if I have multiple functions compiled in the same compilation unit the stack offset is not starting at zero. For example: func1(...) { ... } func2(...) { ... } Say the first function uses 64 bytes of the stack and an assumed offset of 0 and the second function uses 32 bytes of the stack but an assumed offset of 64. I've found out how to get the
2018 Jul 22
2
Finding scratch register after function call
Thanks Bruce, and elaborately as ever. Again, I'm surprised about your very thorough Z80 knowledge when you said you only did little on the ZX81 in the eighties :D OK, understood. I was first thinking about doing something like this for small frames: 1. push bc # 1 byte; 11 cycles - part of call frame-cleanup: save scratch register +-----begin call-related 2. ld
2018 Jan 11
1
LLVM EH tables much larger than GCC's
On Wed, Jan 10, 2018 at 5:21 AM, James Y Knight <jyknight at google.com> wrote: > > On Fri, Jan 5, 2018 at 9:58 PM, Ryan Prichard via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> 2. *Termination landing pads.* >> >> Clang sometimes uses a landing pad that calls __clang_call_terminate to >> terminate the program. GCC instead leaves a gap in
2011 Nov 21
2
[LLVMdev] Optimization of array access
Dead Code Elimination. I’m going to try re-working it following some of the insights Don Quixote provided. From: Cameron Zwarich [mailto:zwarich at apple.com] Sent: Monday, November 21, 2011 12:17 PM To: Michael Smith Cc: llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] Optimization of array access Where does the -time-passes option say the time is going? Sent from my iPhone On Nov 21, 2011, at