similar to: recursive functions and global variables

Displaying 20 results from an estimated 10000 matches similar to: "recursive functions and global variables"

2001 Oct 30
2
extracting object names as strings
Hi, I'm looking for a function which returns the name of the argument object as a string: >vect <- 1:3 >function(vect) "vect" I've looked at 'name', 'names', 'objects', none seem to do exactly what I want. ls/objects comes close, but I can't figure out how to force it to give me only one object name. daver
2001 Sep 28
3
evaluating the contents of a string
Hi, suppose I do: b <- matrix(1:9,3,3) bname <- "b" now dim(b) returns [1] 3 3 and dim(bname) returns NULL is there a function to pass bname to such that dim returns the dimensions of b? like dim(somefunc(bname)) returns [1] 3 3 does 'somefunc' exist? daver +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |David Richmond It
2001 Oct 09
3
find indices of nonzero elements
Hi, Is there a function func(x) where x is an array such that it returns a list of the indices of all non-zero elements of the array? for example: a: 1 0 0 0 0 1 0 1 0 func(a) returns two vectors r and c: r c 1 1 2 3 3 2 daver +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |David Richmond It works on a | + Dept. of Sociology complex scientific
2001 Nov 29
3
pause/get input
Hi, Is there a simple command to pause a script until the user hits return? Alternatively, is there a command which prompts the user for some input and assigns the input into a variable? dave +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |David Richmond It works on a | + Dept. of Sociology complex scientific + |Saint Mary's College
2001 Sep 29
1
how much memory does one need...
to allocate 7.8 MB to a vector? (on R running on MacOS 8.6 with a 100MB partition) I get this error from a function which is trying to create a 1000x1000 matrix: Error: cannot allocate vector of size 7812 Kb the error occurs here: dist <- as.single((t(pos)-pos)/n) where pos is a matrix of integers, and n is the size of the first dimension. It appears to first create a double with
2002 Feb 28
1
postscript output sideways
Hi, My plots are all coming out sideways! If I do the following: > postscript("plot1.ps",horizontal=TRUE,paper="letter") > plot(ns,meanpl/maxvec) > dev.off(2) The output file has "ns" on the left and the "meanpl/maxvec" on the top! It doesn't matter if I change the horizontal flag to FALSE. I have noticed, however that If I create my own
2001 Sep 14
3
stuff I used to do in Matlab
Hi, I'm new to R, and trying to map stuff I knew how to do in Matlab to R. For instances, in matlab, sum(x) gave the column sums of matrix(/vector) x. In R it just gives the sum of all the elements, regardless of their form (vector or matrix). Is there a simple way to return a vector of column sums for a matrix? Also, in Matlab binary operators exist for concatenating a matrix onto the end or
2001 Dec 14
0
polylog
Hi, Does R do the "PolyLog" function, also know as Jonquiere's function: Li-n(z) = sum over k= 1 to inf. of (z^k)/(k^n) ? dave +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |David Richmond It works on a | + Dept. of Sociology complex scientific + |Saint Mary's College principle, known as | + Notre Dame, IN
2002 Mar 20
7
how does while work
i am having some problems with a program that i am writing and i think that knowing how the while command works will help me to figure out where i am going wrong *when do you get kicked out of a while loop?* (i.e., in the following example what would the final value of 'a' be?) i thought it would be 99 but running it in R i get 101 (and 101 for x too!) while (x <100) { for (i in
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 ];
2005 May 07
1
Incorrect libxml2.2.dylib version on Tiger install
Hi all, I have just installed OSX Server 10.4 and R comes up with the incompatible libxml library message reported by Dan Kelley a few messages ago. Xcode 2 does not ship with Tiger Server. I installed the X-Windows code. I can report that the version of libxml2.2 that is installed in this case is the version 8.0.0 dylib. [6]sboker at munimula:/usr/lib % ls -l libxml2.2* -rwxr-xr-x 1
2004 Nov 25
2
logistic regression and 3PL model
Hello colleagues, I am a novice with R and am stuck with an analysis I am trying to conduct. Any suggestions or feedback would be very much appreciated. I am analyzing a data set of psi (ESP) ganzfeld trials. The response variable is binary (correct/incorrect), with a 25% base rate. I've looked around the documentation and other online resources and cannot find how I can correct for
2005 Jul 22
1
multiplicate 2 functions
Thks for your answer, here is an exemple of what i do with the errors in french... > tmp [1] 200 150 245 125 134 345 320 450 678 > beta18 Erreur : Objet "beta18" not found //NORMAL just to show it > eta [1] 500 > func1<-function(beta18) dweibull(tmp[1],beta18,eta) > func1<-func1(beta18) * function(beta18) dweibull(tmp[2],beta18,eta) Erreur dans dweibull(tmp[1],
1998 Jul 28
4
problems with samba 1.9.18p8
I recently installed samba 1.9.18p8. Since then, we get the following error: "No domain server was available to validate your password. You may not be able to gain access to some network resources." after the server has been running for >48 hours. If I stop and restart the server, everything is ok again. Our samba server is a Sun Ultra 2170 running Solaris 2.5.1. Any help will
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
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,
1997 Oct 09
0
R-alpha: [sboker@calliope.psych.nd.edu: Re: S-PLUS on UNIX plans]
--Multipart_Thu_Oct__9_10:41:03_1997-1 Content-Type: text/plain; charset=US-ASCII In case you did not realize how much this is related to R : --Multipart_Thu_Oct__9_10:41:03_1997-1 Content-Type: message/rfc822 Return-Path: s-sender@utstat.toronto.edu From: "Steven M. Boker" <sboker@calliope.psych.nd.edu> Date: Wed, 8 Oct 97 16:37:05 -0500 To: s-news@utstat.toronto.edu Subject:
2003 May 13
0
bug in promax?
I was wondering whether the following inconsistency of the promax rotation function with the results of a promax rotation using SAS should be considered a bug in the promax function of R. Any comments will be highly appreciated. The following is a loading matrix obtained from a varimax rotation in SAS: # Factor loadings after varimax rotation x <- t(array(c(0.78107, 0.35573,
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,
2005 Feb 20
1
logistic regression and 3PL model
Hello colleagues, This is a follow up to a question I posed in November regarding an analysis I was working on. Thank you to Dr. Brian Ripley and Dr. John Fox for helping me out during that time. I am conducting logistic regression on data set on psi (ESP) ganzfeld trials. The response variable is binary (correct/incorrect), with a 25% guessing base rate. Dr. Ripley suggested that I