similar to: restrict namespace inside functions?

Displaying 20 results from an estimated 10000 matches similar to: "restrict namespace inside functions?"

2007 Apr 11
3
Fortran coding standards
I have some comments on the Fortran code in the fseries package in file 4A-GarchModelling.f , especially the subroutine GARCHFIT and function DSNORM. I appended the code to the end of an earlier message, but it was rejected by some rule. Let me first say that I am grateful that packages for financial econometrics exist in R. Fortran 77 had PARAMETERs, and PARAMETERs equal to 99999 and 200 should
2005 Apr 12
8
removing characters from a string
Is there a simple way in R to remove all characters from a string other than those in a specified set? For example, I want to keep only the digits 0-9 in a string. In general, I have found the string handling abilities of R a bit limited. (Of course it's great for stats in general). Is there a good reference on this? Or should R programmers dump their output to a text file and use something
2005 Apr 13
3
terminate R program when trying to access out-of-bounds array element?
I want R to stop running a script (after printing an error message) when an array subscript larger than the length of the array is used, for example x = c(1) print(x[2]) rather than printing NA, since trying to access such an element may indicate an error in my program. Is there a way to get this behavior in R? Explicit testing with the is.na() function everywhere does not seem like a good
2005 Jul 16
2
topical guide to R packages
I would like to see R packages arranged by topic. CRAN Task Views are at http://lib.stat.cmu.edu/R/CRAN/src/contrib/Views/ , but I'd like something more detailed. For example, the IMSL Fortran library, version 4 is easy to navigate and has procedures arranged according to following topics: Basic Statistics Regression Correlation Analysis of Variance Categorical and Discrete
2005 Apr 11
2
static analysis tools for R code?
An R script will terminate when one tries to use an undefined variable, with a message such as Error in print(x) : Object "x" not found This run-time error might occur after the script has already been running for some time. In some cases it would be nice to get such warnings before the script is run, just as a syntax error caused by a missing parenthesis is caught. Are there any
2005 Apr 13
1
Why is 1 a double?
Based on examples in R books and the syntax of other programming languages, I expected that n <- 10 assigns the integer 10 to n, but typeof(n) is actually a double. The subscripting expression x[1] is valid, but sprintf("\n %d",1) is not, giving the error Error in sprintf("\n %d", 1) : use format %f, %e or %g for numeric objects One must use instead sprintf("\n
2003 Jan 22
1
something wrong when using pspline in clogit?
Dear R users: I am not entirely convinced that clogit gives me the correct result when I use pspline() and maybe you could help correct me here. When I add a constant to my covariate I expect only the intercept to change, but not the coefficients. This is true (in clogit) when I assume a linear in the logit model, but the same does not happen when I use pspline(). If I did something similar
2005 Apr 13
0
terminate R program when trying to access out-of-bounds a rray element?
As Bert said, redefining functions like "[" is surely inadvisable, because of possibility of breaking codes that depend on the intended behavior. This is a language _feature_. If the problem is indexing beyond array extent, just check for it: Are any values that are going to be used for indexing larger than the length of the object? E.g., if (any(idx > length(x)))
2010 Jan 26
2
tapply and more than one function, with different arguments
Dear R-users, I am working with R version 2.10.1. Say I have is a simple function like this: > my.fun <- function(x, mult) mult*sum(x) Now, I want to apply this function along with some other (say 'max') to a simple data.frame, like: > dat <- data.frame(x = 1:4, grp = c("a","a","b","b")) Ideally, the result would look something like
2005 Mar 03
3
3d plot of regression squared error
Hi. I'm trying to create a 3d plot for a teaching example of finding a least-squares estimate of the parameters to fit a line to some data. I was hoping to get a nice plot with a clear, single minima where the derivative of the surface is zero. No matter how much I tinker, I can't seem to get a simple straightforward plot. Am I doing something wrong? Thanks in anticipation, Ross-c x
2015 Apr 29
2
Formula evaluation, environments and attached packages
Hi! Some time ago, I replaced calls to library() with calls to requireNamespace() in my package logmult, in order to follow the new CRAN policies. But I just noticed it broke jackknife/bootstrap using several workers via package parallel. The reason is that I'm running model replicates on the workers, and the formula includes non-standard terms like Mult() which are provided by gnm. If gnm
2011 Jun 23
2
Rms package - problems with fit.mult.impute
Hi! Does anyone know how to do the test for goodness of fit of a logistic model (in rms package) after running fit.mult.impute? I am using the rms and Hmisc packages to do a multiple imputation followed by a logistic regression model using lrm. Everything works fine until I try to run the test for goodness of fit: residuals(type=c("gof")) One needs to specify y=T and x=T in the fit. But
2012 Oct 28
2
List of arrays - problem with dimensions
Dear all, I want to obtain the following result [[1]] , , 1, 1 [,1] [,2] [1,] 1 1 [2,] 1 1 , , 2, 1 [,1] [,2] [1,] 1 1 [2,] 1 1 ................ , , 9, 1 [,1] [,2] [1,] 1 1 [2,] 1 1 , , 10, 1 [,1] [,2] [1,] 1 1 [2,] 1 1 [[2]] , , 1, 1 [,1] [,2] [1,] 1 1 [2,] 1 1 , , 2, 1 [,1] [,2] [1,] 1
2019 Feb 02
2
[llvm-xray] llvm-xray cannot log every functions
Hi there, I have a problem using the function call tracing tools that is designed in llvm tools set. My aim is to record every function call that a program makes when it run. However, for whatever reason, a simple matrix multiply c program that I wrote cannot record all the function calls that happened when the program run. Here is the program: matrix.c #include <stdio.h> void
2013 Mar 25
0
[LLVMdev] [PATCH] RegScavenger::scavengeRegister
On Mar 25, 2013, at 2:51 PM, Akira Hatanaka <ahatanak at gmail.com> wrote: > Yes, it sounds like it will solve the problem. > > Using the following example where live ranges of accumulators $vreg_acc0 and $vreg_acc1 conflict, > > MULT $vreg_acc0, $vreg_gpr0, $vreg_gpr1 > MULT $vreg_acc1, $vreg_gpr2, $vreg_gpr3 > > (consumer of $vreg_acc1) > (consumer of
2016 Aug 03
6
[SCEV] getMulExpr could be extremely slow when creating SCEVs for a long chain of add/mul instructions
Hi, I'm working on a slow-compile problem caused by SCEV (PR28830), and I need your suggestions on how to fix it. The loop below causes ScalarEvolution::getMulExpr to hang. int get(unsigned n) { unsigned i, j, mult = 1; for (i = 0; i < 1; i++) { for (j = 0; j < 30; j++) { mult *= n++; } } return mult; } the inner loop is completed unrolled
2013 Mar 25
2
[LLVMdev] [PATCH] RegScavenger::scavengeRegister
On Mon, Mar 25, 2013 at 2:07 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote: > > On Mar 25, 2013, at 1:41 PM, Akira Hatanaka <ahatanak at gmail.com> wrote: > > > Hi Jakob, > > > > I believe Hal is trying to enable register scavenger to find two (or > more) registers that can be used as temporaries. > > > > One problem I see with this
2008 Nov 14
3
Change Confidence Limits on a plot
Hi, I am attempting to set the confidence limits on a ls means plot as follows: mult<-glht(lm(effectModel, data=statdata, na.action = na.omit), linfct=mcp(mainEffect="Means")) meanPlot <- sub(".html", "meanplot.jpg", htmlFile) jpeg(meanPlot) plot(mult, main=NA, xlab=unlist(strsplit(Args[4],"~"))[1]) This produces 95% CIs by default but I would
2015 Mar 31
2
OpenSSL vulnerability fix
just for my curiosity, How can we make sure that its not affected? Is there any script to check whether its vulnerable or not (as in bash shell shock vulnerability test)? On Tue, Mar 31, 2015 at 12:25 PM, Eero Volotinen <eero.volotinen at iki.fi> wrote: > Centos 5 is not affected by this bug, so fix is not available. > > Eero > 31.3.2015 9.48 ap. kirjoitti "Venkateswara
2012 Aug 21
2
[LLVMdev] How to uniquely remember a loop?
>On Aug 16, 2012, at 1:09 PM, "Rao, Prashantha" <Prashantha.Rao at amd.com<mailto:Prashantha.Rao at amd.com>> wrote: >Hi- >I am writing a pass to traverse loops and collect some analysis data and later on come back to transform the IR. In the analysis phase I need to >remember statistics regarding every loop in the program. What is the best way to uniquely