similar to: all.names() and all.vars(): sorting order of functions' return vector

Displaying 20 results from an estimated 1000 matches similar to: "all.names() and all.vars(): sorting order of functions' return vector"

2006 Jul 18
2
I think this is a bug
Hello! I work with: R : Copyright 2006, The R Foundation for Statistical Computing Version 2.3.1 (2006-06-01) On Windows XP Professional (Version 2002) SP2 I think there is a bug in the conditional execution if (expr1) {expr2} else {expr3} If I try: "if (expr1) expr2 else expr3" it works well but when I put the expression expr2 and expr3 between {} I receive an error message
2023 Jan 11
1
return value of {....}
I am more than a little puzzled by your question. In the construct {expr1; expr2; expr3} all of the expressions expr1, expr2, and expr3 are evaluated, in that order. That's what curly braces are FOR. When you want some expressions evaluated in a specific order, that's why and when you use curly braces. If that's not what you want, don't use them. Complaining about it is like
2023 Jan 13
1
return value of {....}
R's { expr1; expr2; expr3} acts much like C's ( expr1, expr2, expr3) E.g., $ cat a.c #include <stdio.h> int main(int argc, char* argv[]) { double y = 10 ; double x = (printf("Starting... "), y = y + 100, y * 20); printf("Done: x=%g, y=%g\n", x, y); return 0; } $ gcc -Wall a.c $ ./a.out Starting... Done: x=2200, y=110 I don't like that
2011 Apr 21
3
R CMD Sweave versus Sweave() on Windows
Dear list subscriber, I am quite puzzled by the behaviour of processing Sweave files within an R session, i.e. Sweave("foo.Rnw") versus R CMD Sweave foo.Rnw In the former the environmental variable 'SWEAVE_STYLEPATH_DEFAULT = TRUE' is obeyed (this is set in etc/Renviron.site as well as under the users home directory in .Renviron). That is the hard-coded path to Sweave.sty is
2009 Jan 30
1
Methods not loaded in R-Devel vs 2.8.1
Dear list-member, I am currently developing a package with S4 classes. The NAMESPACE and DESCRIPTION is printed below. Within this package I have set a method "residuals" for two classes. In version 2.8.1 these two are reported whereas in R-Devel (2009-01-28 r47766). What have I missed? What has changed and how can I rectify the issue? Your help and pointers are welcome. For 2.8.1:
2006 Nov 03
2
WG: Formal methods are not loaded from NAMESPACE inreloadedworkspace image
Sorry, to bother the list one more time: but the following worked at least for 'urca': in NAMESPACE I now included explicitly: import(methods) a fix of the 'urca'-package will be uploaded to CRAN on the weekend. Fritz, will this work for ypur package 'flexclust' too? I have in my DESCRIPTION imports: methods and in flexclust it is in depends: methods. However, both
2009 Nov 11
1
Sweave() within a function: objects not found
Dear list subscriber, suppose, I do have a minimal Sweave file 'test.Rnw': \documentclass{article} \begin{document} <<printx>>= x @ \end{document} Within R, I define the following function: f <- function(x){ Sweave("test.Rnw") } The call: f(x = 1:10) results in the following error message: > f(x = 1:10) Writing to file test.tex Processing code chunks
2005 Jun 03
2
Everyone-- the scoop on Bison/Flex --
Hey, everybody--- Ignorance CAN be bliss, at least for a while, but, .... Just so you know... A week or two ago, some upgrades to the expression parser (you know, the expressions you put in $[ ... ] in your extensions.conf file) that I submitted, have been merged into the CVS HEAD of the source. Hopefully, for around 99.9% of you, it won't make any difference to you. The Makefile has also
1997 Apr 30
2
R-beta: Small problems with R0.49
A non-text attachment was scrubbed... Name: not available Type: text Size: 1856 bytes Desc: not available Url : https://stat.ethz.ch/pipermail/r-help/attachments/19970430/db1498ee/attachment.pl
2001 May 30
2
environments
I would like to be able, inside a function, to create a new function, and use it as part of a formula as an argument to, say, gnls or nlme. for example: MyTop <- function(data=dta) { Cexp <- function(dose,A,B,m){...} Model <- as.formula(paste("y","~ Cexp(",paste(formals(Cexp),collapse =", "),")")) MyCall <-
2013 Feb 04
2
Modifying a function programmatically
Dear list # I have a function ff <- function(a,b=2,c=4){a+b+c} # which I programmatically want to modify to a more specialized function in which a is replaced by 1 ff1 <- function(b=2,c=4){1+b+c} # I do as follows: vals <- list(a=1) (expr1 <- as.expression(body(ff))) expression({ a + b + c }) (expr2 <- do.call("substitute", list(expr1[[1]], vals))) { 1 +
2014 May 01
3
How to test if an object/argument is "parse tree" - without evaluating it?
This may have been asked before, but is there an elegant way to check whether an variable/argument passed to a function is a "parse tree" for an (unevaluated) expression or not, *without* evaluating it if not? Currently, I do various rather ad hoc eval()+substitute() tricks for this that most likely only work under certain circumstances. Ideally, I'm looking for a isParseTree()
2009 Dec 09
4
equivalent of ifelse
Hi, Is there any equivalent for ifelse (except if (cond) expr1 else expr2) which takes an atomic element as argument but returns vector since ifelse returns an object of the same length as its argument? x = c(1,2,3) y = c(4,5,6,7) z = 3 ifelse(z <= 3,x,y) would return x and not 1 thanks
2011 Aug 28
1
read.table: deciding automatically between two colClasses values
Hello, I have a function for reading a data-frame from a file, which contains E = read.table(file = filename, header = T, colClasses = c(rep("integer",6),"numeric","integer",rep("numeric",8)), ...) Now a small variation arose, where colClasses =
2023 Jan 09
5
return value of {....}
Dear members, I have the following code: > TB <- {x <- 3;y <- 5} > TB [1] 5 It is consistent with the documentation: For {, the result of the last expression evaluated. This has the visibility of the last evaluation. But both x AND y are created, but the "return value" is y. How can this be advantageous for solving practical problems?
2002 Aug 07
2
Constructing titles from list of expressions
Hello! I have the following problem: I have a function to construct three surfaceplots with a marker for an optimum, each of the plots has as title paste("Estimated ",pred.var.lab," for ",var.lab[1]," vs. ",var.lab[2],sep="") with different var.lab[1,2] each time. My problem is now that I need to allow for plotmath expressions in the variables pred.var.lab
2014 Sep 19
2
[LLVMdev] poison and select
Today I ran into another aspect of the poison problem... Basically, SimplifyCFG wants to take expr1 && expr2 and flatten it into x = expr1 y = expr2 x&y This isn't safe when expr2 might execute UB. The consequence is that no LLVM shift instruction is safe to speculatively execute, nor is any nsw/nuw/exact variant, unless the operands can be proven to be in
2015 May 20
2
[LLVMdev] RFC: New EH representation for MSVC compatibility
This example is pretty compelling, but I still think I want to limit the scope of this change to not include this feature. It's probably reasonable to hold onto the idea as future work, though. In the meantime, frontends can decide for themselves whether they want code size or stronger optimization of cleanups by doing early outlining or not. The only way we can hit the quadratic growth from
2012 Aug 07
4
Execution of a function
Hi >i have aproblem withe execution of my function >first, i wrote my function in the script of R >nom_fonction <- function(arg1[=expr1], arg2[=expr2], ...){ bloc d'instructions } > when i want to have the result i mean the laste instruction in the bloc of > instruction , i try to >wrote the name of function >source(aj.fun) Error in readLines(file, warn =
2006 Nov 03
1
Formal methods are not loaded from NAMESPACE in reloadedworkspace image
Dear R-Devel subscriber, as a follow up to my yesterday's email: I tested an analogous example with the S4-package "flexclust" by executing the following code: library(flexclust) example(cclust) cl After saving the work space and starting a new R process with the restored work space, the same behaviour (i.e., the methods pertinent to "flexclust" are not used, even after