similar to: scope (was URGENT Help required)

Displaying 20 results from an estimated 6000 matches similar to: "scope (was URGENT Help required)"

2002 Nov 26
2
URGENT Help required
I've the following problem: The below function runs a loop with regression analysis and stores F-Stat in a matrix. When I call the matrix elements (models[i,j]) in the function I get proper results, but when I try to call the same elements outside the function the matrix appears to be empty e.g when I call compt inside the function I get: 5 but when I call it outside I get: 1. This is the
2003 Nov 24
3
Bollinger Bands
Is there a way to create Bollinger Bands without having to loop on the observations of a time serie? Any help appreciated Thanks
2003 Apr 09
3
How to count the number of parameters in a function
I have the following function: Myfunc <- function(var1,var2,.....,varN) { ..... } In the above function I have a variable number of parameters (N>2). How can I count how many parameters have been entered? Any help appreciated Thanks Arno
2003 Dec 11
4
Probelm with read.table
Hi All, I have the following text file (mytextfile.txt) 738307 527178 714456 557955 #N/A 17.42 6.22 4.73 #N/A 17.3 6.23 4.75 #N/A 17.29 6.17 4.7 #N/A 17.07 6.12 4.6 #N/A 17.27 6.19 4.7 #N/A 17.72 6.4 4.78 #N/A 17.12 6.19 4.75 #N/A 17.07 6.15 4.65 #N/A 17.03 6.07 4.64 #N/A 17.38 6.13 4.7 #N/A 17.38 6.13 4.7 #N/A 17.38 6.13 4.7 #N/A 17.38 6.13 4.7 #N/A
2011 Aug 12
0
Mixed Logit model mlogit error
I am new to R but I have managed to use mlogit to run multivariate logit models successfully. My data violates the Independence of Irrelevant Alternatives assumption and now I would like to run a mixed logit model. It is a "wide" data set with 9 independent (individual) variables and three choices (variable Y). The database is in a cvs file called CAU. This is the code I have run
2009 Oct 26
2
R CMD check: Error in .C
Function/file names are hypothetical. Say I have written myfunction.R, which calls myfunction.c via .C("myfunction", ...). I've compiled successfully myfunction.c via R CMD SHLIB myfunction.c in the terminal. Then, in the R console: dyn.load("myfunction.so") source("myfunction.R") test <- myfunction() # works fine So everything is in order, myfunction works
2008 Jan 29
1
Compiling R code
Hi all, I am struggling to compile a massive R code that I have written through some years, aiming to provide automated investment strategies to my Portfolio Managers. You may ask me why do I not rewrite the code in C or C++; the answer is it is really massive and that will take me lots of time. The pb is I will be moving from one team to another therefore I want to make it an exec program that
2012 Nov 23
1
Adding a function with default parameters into the Rcmdr menu
Hi everyone, I made some tests with Rcmdr, to add a function with default parameters : For example (very simple): myfunction<-function(var="314"){ print("hello") print(var) } if I run myfunction() directly i see : > myfunction() [1] "hello" [1] "314" it's ok. But if i edit de Rcmdr-menu.txt (in
2009 Jun 03
1
Using constrOptim() function
I have a function myFunction(beta,x) where beta is a vector of coefficients and x is a data frame (think of it as a matrix). I want to optimize the function myFunction() by ONLY changing beta, i.e. x stays constant, with 4 constraints. I have the following code (with a separate source file for the function): rm(list=ls()) source('mySourceFile')
2013 Apr 24
0
help with execution of 'embarrassingly parallel' problem using foreach, doParallel on a windows system
Dear R helpers, I have what another member on this forum described as an embarrassingly parallel problem. I am trying to fit models on subsets of some data based on unique combinations of two id factors in the dataset. Total number of combinations is 30^5, and this takes a long time. So, I would like fit models for each of the datasets produced by subsetting on the unique combinations, splitting
2010 Apr 25
0
S4 generic and method arguments -- "expanded signature"
Hello R-List, ** This e-mail was initially bounced. Please forgive any duplicates.** I'm creating a new generic function and 3 associated methods, in which each of the methods only needs a subset of the arguments specified in the generic. So, I create the generic like so (with the signature defaulting to all of the args) ... setGeneric( name="myFunction", def =
2004 Nov 04
1
problems with seq.dates
There seem to be a bug in the seq.dates function in the chron package for R 2.0. Please see below: when the specified frequency is "months", seq.dates does not return the end of the specified interval all the time: > seq.dates(from = "05/31/04", to = "12/31/04", by = "months") [1] 05/31/04 06/30/04 07/31/04 08/31/04 09/30/04 10/31/04 11/30/04 Ciprian
2010 Dec 17
0
How to use the RUnit tracker in unit tests?
R-developers Does anybody know how I incorporate the use of the tracker in RUnit in the unit tests? I have read the RUnit Vignette, help pages and searched around, but I could find no examples of using 'inspect' in the unit test functions. Moreover, doing so, I tried something like library(RUnit) myFunction <- function(x) { return(x) } track <- tracker() track$init()
2003 Jun 12
1
Problème en R
Bonjour, Je suis ?tudiant stagiaire ? Paris et je rencontre quelques difficult?s en programmation R. J'ai une data frame compos?e de 4 colonnes et 250 lignes et dont chaque ligne est une famille. J'ai fait un tirage al?atoire avec remise des familles 250 fois ce qui m'am?ne ? une nouvelle dataframe. A cette nouvelle dataframe, j'applique un programme qui calcule 2 param?tre X1
2017 Jul 12
2
A strange problem about type i64 for LLVM
Hello, everyone, I encounter a strange problem about llvm type i64 and C++ type int64_t. I instrumented a program to call the function 'myFunction' in the C++ shared library. 'myFunction' is something like this: int64_t myFunction() { int64_t retValue; ... std::cout << "retValue: " << retValue << "\n"; return retValue; }
2008 Jul 21
1
Howto Restart A Function with Try-Error Catch
Hi all, I have a function - let's call it "myfunction". This function is based on some random number generator. Now, once in a while the function will break/crash depending on the random number it generate inside the function. To avoid the problem, what I intend to do is the following: 1. Catch the try-error using class. 2. Redo the function if it returns "try-error" 3.
2018 Aug 09
0
WishList: Remove Generic Arguments
On 09/08/2018 5:45 PM, Abs Spurdle wrote: > I apologize if this issue has been raised before. > > I really like object oriented S3 programming. > However, there's one feature of object oriented S3 programming that I don't > like. > Generic functions can have arguments other than dots. > > Lets say you have an R package with something like: > >
2008 Oct 29
0
Propagate vector attributes to data frame
Hello, I've got a function that takes a numeric vector (x), computes a transformation value (myAttr) for x, transforms x according to myAttr and then sets myAttr as an attribute of x before returning x, so I can easily know what myAttr was used (basically it's a power transformation and myAttr is the lambda). myFunction.numeric <- function(x, ...) { myAttr <- calcMyAttr(x, ...) x
2011 Sep 27
0
A very big matrix inside a function
Dear listers: As a part of a intermediate process, I need to use and modify a very big matrix (some 30000x30000) inside the body of a function. If the matrix is defined in the function, R shows a error message "Cannot allocate vector of size 6.7 Gb". But if I define the matrix before the function is called (as soon as the dimension can be calculated) R can allocate it. The problem is
2012 Mar 13
2
beginner's loop issue
Dear All, I hope you don't mind helping me with this small issue. I haven't been using R in years and I'm trying to fill in a matrix with the output of a function (I'm probably using the Matlab logic here and it's not working). Here is my code: for (i in 1:length(input)){ out[i,1:3] <- MyFunction(input[i,1],input[i,2], input[i,3]) out[i,4:6] <-