similar to: Extract the names of the arguments in an "expression"

Displaying 20 results from an estimated 10000 matches similar to: "Extract the names of the arguments in an "expression""

2006 Feb 27
1
TclTk library loading (whole version) Linux
Hello; Well, I'm afraid this is the second related problem I report in two days (I'm sorry for this) I've programmed a tcltk interface for a model and it includes a comboBox. The comboBox widget comes with the "BWidgets" library of Tcl/Tk. It works all perfectly with the windows R GUI (with the help of Prof. B. Ripley), following the advices in ?Startup, but I would like
2013 Jan 16
2
Codetools Query (repost)
Sorry for reposting, i keep forgetting this should be plain text. Will not make this mistake again Hello, The following code moo <- function(a=1){ x=1; x=x+y} funs <- new.env() enter <- function(type, v, e, w){ assign(v, TRUE, funs) } library(codetools) collectUsage(moo, enterGlobal = enter) adds + to the environment funs i.e. funs: "=" "{" "+"
2006 Apr 21
1
R graph strip in Greek Letters
Hi all, I have one question on xyplot() function. I am trying to produce a graph by this code. tmp <- data.frame(a=rnorm(20), b=rnorm(20), rho=factor(rep(1:2, c(10,10))), k=factor(rep(1:5,4))) tmp.lattice <- xyplot(a ~ b | rho*k, data=tmp, par.strip.text=list(font=5), strip=function(...) strip.default(...,
2018 Mar 13
2
Possible Improvement to sapply
FYI, in R devel (to become 3.5.0), there's isFALSE() which will cut some corners compared to identical(): > microbenchmark::microbenchmark(identical(FALSE, FALSE), isFALSE(FALSE)) Unit: nanoseconds expr min lq mean median uq max neval identical(FALSE, FALSE) 984 1138 1694.13 1218.0 1337.5 13584 100 isFALSE(FALSE) 713 761 1133.53 809.5 871.5
2015 Jul 29
2
Mapping parse tree elements to tokens
I have two use cases in mind: 1) Code indexing/searching, where the table gets me almost all of the way there, except I ask for all of the text (including the calls) and then parse that, because it's nice to get back an actual code object when you are searching code (in addition to where the code lives). The extra parsing step is just a minor inconvenience. 2) Code analysis, which I'm
2018 Mar 14
0
Possible Improvement to sapply
>>>>> Henrik Bengtsson <henrik.bengtsson at gmail.com> >>>>> on Tue, 13 Mar 2018 10:12:55 -0700 writes: > FYI, in R devel (to become 3.5.0), there's isFALSE() which will cut > some corners compared to identical(): > > microbenchmark::microbenchmark(identical(FALSE, FALSE), isFALSE(FALSE)) > Unit: nanoseconds > expr
2009 Jan 08
1
cosinor analysis
Hallo, I didnĀ“t found any facilities for Halbergs cosinor analysis in R. This analysis is well known in the Chronobiology as the least square approximation of time series using cosine function of known period (in my case of 24hours-period). I tried to write a script but crashed... Can you give me some advices, please!? Thanks Anne Berger Institute of Zoo- and Wildlife Research, Berlin, Germany
2018 Feb 15
1
RV: Problem_graphic
Hi everyone, I am beginner using R but I try to learn more. I need this graphic or similar but instead of tropical and temperate are three ontogenetic states Larva Met Juv CTMAX CTMIN SP SP SP This is my scrip: Ex = subset(Expr, Outlayer=="N") Ex2 = subset (Ex, S0 == 1) Ex3
2008 Jan 04
1
Evaluating R expressions from C
I am currently puzzled by a passage in the R Extensions manual, section 5.10: SEXP lapply(SEXP list, SEXP expr, SEXP rho) { R_len_t i, n = length(list); SEXP ans; if(!isNewList(list)) error("`list' must be a list"); if(!isEnvironment(rho)) error("`rho' should be an environment"); PROTECT(ans = allocVector(VECSXP, n));
2011 Jan 06
2
Global variables
Dear R-users, Is there a way I can prevent global variables to be visible within my functions? Sebastien
2003 Jan 13
1
Evaluating expressions from within C code
Dear R experts! I want to evaluate expressions from within C code. For instance, I want this code: /* ============ -- C code -- ============== */ #include <R.h> #include <Rinternals.h> SEXP foo(SEXP expr, SEXP rho) { SEXP x; PROTECT(x = allocVector(REALSXP, 1)); REAL(x)[0] = 1; UNPROTECT(1); return
2005 Nov 07
3
R thread safe
Dear R-dev, I would like to accelerate my R computation by using parallel OpenMP compilers (e.g from Pathscale) on a 2-processor AMD server and I would like to know whether R is a tread safe library. The main kernel of the OpenMP parallelization is a C SEXP function that performs the computational routine in parallel with: ******************* SEXP example(SEXP list, SEXP expr, SEXP rho) {
2010 Apr 16
1
R CMD check tells me 'no visible binding for globalvariable'
Henrik wrote: I think what people are also thinking about is that the policy for publishing a package on CRAN is that it have to pass R CMD check with no errors, warnings *or* notes. So, in that sense notes are no different from warnings. --------------------------------- Getting rid of these notes would be very hard in the survival package. The population survival routines (survexp, pyears)
2004 Mar 19
2
using "unstack" inside my function: that old scope problem again
I've been reading the R mail archives and I've found a lot of messages with this same kind of problem, but I can't understand the answers. Can one of you try to explain this to me? Here's my example. Given a regression model and a variable, I want to use unstack() on the vector of residuals and make some magic with the result. But unstack hates me. PCSE <- function
2013 Feb 18
2
quote() vs quote(expr=)
Hi all, I think there's a small buglet in quote: str(quote()) # Error in quote() : 0 arguments passed to 'quote' which requires 1 str(quote(expr = )) # symbol I bring this up because this seems like the most natural way of capturing the "missing" symbol with pure R code, compared to substitute() or bquote() or formals(plot)$x Hadley -- Chief Scientist, RStudio
2005 Nov 07
4
Time-measurement in milliseconds
Hi there I'm loking for a time-measurement to measure time-differences in milliseconds. On my search, I only found the following: - package "base": Sys.time() -> only second-accuracy - package "R.utils": System$currentTimeMillis() -> returns integer of milliseconds, but accuracy is only whole seconds too. At the moment I run every bit of code to measure
2010 May 19
4
R in sandbox/jail (long question)
Hello, I have a setup similar to Rweb ( http://www.math.montana.edu/Rweb/ ): I get R scripts from users and need to execute them in in a safe manner (they are executed automatically, without human inspection). I would like to limit the user's script to reading from STDIN and writing to STDOUT/ERR. Specifically, preventing any kind of interaction with the underlying operating system (files,
2006 Jun 02
2
Helping out - simple bugs to help familiarize with R design, source, etc
Hi All, Well I finally have found the time to get svn working and I have successfully built my own tuned atlas (multi-threaded version) libs and have both the r-devel and r-patched trees building daily on my box. The problem is I still do not have a good idea of the layout and design of R, and typically I "learn by doing" by trying to fix a bug that hits me. Unfortunately ;-)
2007 Nov 22
2
Clean programming with R
Hi all Is there any compiler for R ? By compiler, I mean something that check the cleanliness of the code : if we declare all the variables we use, if we don't use external variable from a function and so on... For exemple, something that will ring a bell on the following code (saying "line 4 : 'pp' undefine in function 'power' ") 1. pp <- 3 2. power <-
2023 Mar 13
1
Multiple Assignment built into the R Interpreter?
Yes, this is really a problem with the checks, not with the language. A simpler approach than your alternativeAssignment function would be simply to allow globalVariables() to be limited to a single function as the note in its help page says. This might be tedious to write by hand, but could be automated using methods like "dotify" in dotty. Duncan Murdoch On 12/03/2023 10:36