similar to: dput(as.list(function...)...) bug

Displaying 20 results from an estimated 4000 matches similar to: "dput(as.list(function...)...) bug"

2020 Mar 17
3
new bquote feature splice does not address a common LISP @ use case?
Dear R-devel, There is a new feature in R-devel, which explicitly refers to LISP @ operator for splicing. > The backquote function bquote() has a new argument splice to enable splicing a computed list of values into an expression, like ,@ in LISP's backquote. Although the most upvoted SO question asking for exactly LISP's @ functionality in R doesn't seems to be addressed by this
2008 Dec 08
4
R and Scheme
I've read in many places that R semantics are based on Scheme semantics. As a long-time Lisp user and implementor, I've tried to make this more precise, and this is what I've found so far. I've excluded trivial things that aren't basic semantic issues: support for arbitrary-precision integers; subscripting; general style; etc. I would appreciate corrections or additions from
2007 Oct 02
2
pairlist objects
Hi, ?pairlist gives no explanation about what exactly is the difference between a pairlist and a list (except that a pairlist of length 0 is 'NULL'). So, what's a pairlist? class(.Options) [1] "pairlist" Some strange things about the "pairlist" type: > showClass("pairlist") Error in getClass(Class) : "pairlist" is not a defined class
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 +
2003 Feb 14
1
pairlists (was: data manipulation function descriptions)
> -----Original Message----- > From: Luke Tierney [mailto:luke at stat.uiowa.edu] > R does not provide a pairlist data structure. This creates a dilemma > when translating some list-based xlispstat code, or, more > importantly, when implementing an algorithm for which parilists are > the natural data structure to use. > ... > Pairlists were and still are used internally
2005 Mar 16
1
working with pairlists imported from HDF5, converting to data frames?
I've used the HDF5 library to bring some data into R. THe verbose output looks like this: > hdf5load("hdfGraphWed_Mar_16_13_33_37_2005.hdf",load=T,verbosity=1,tidy=T) Processing object: cprSeats ...... which is a Group Processing object: Seats 0 ...... its a dataset......Finished dataset Processing object: Seats 1 ...... its a dataset......Finished dataset Processing object:
2006 Mar 01
4
linear lists, creation, insertion, deletion, traversal *someone?*
Hi, In a second try I will ask this list to give me some useful pointers. Linear lists, as described e.g. by N.Wirth in "Algorithms and Data Structures", seem not to be implemented in S/R, although in lisp we have cons, car, cdr. Nevertheless I want to implement an algorithm using such linear lists, porting a trusted program to R (S). I need: (from Modula/Oberon) pSC* = POINTER TO
2001 Dec 06
1
Scheme in R
The initial authors of R said?, "...we implemented the language by first writing an interpreter for a Scheme subset and then progressively mutating it to resemble S." Further on in that article they elaborated that their strategy was to create a parser that would take expressions in S-like syntax and translate them to Scheme S-expressions. Does R still work that way? Can R be made to
2008 Jun 20
5
Programming Concepts and Philosophy
I am wondering if people on the list could recommend books that they have found helpful about programming concepts and style? I often find that students write R programs by copying existing code but could really benefit from the understanding of more general programming ideas. An example would be to avoid writing functions which attempt to modify their parameters. Another principle would be
2009 Mar 23
4
newton method
Hi R-users, Does R has a topic on newton's method? Thank you for the info.
2016 Oct 12
2
How to assign NULL value to pairlist element while keeping it a pairlist?
Thanks, this was what I expected. There is a desire to eliminate the usage of pairlist from user code, which suggests the alternative of allowing for function arguments to be stored in lists. That's a much deeper change though. On Wed, Oct 12, 2016 at 12:31 PM, Henrik Bengtsson <henrik.bengtsson at gmail.com> wrote: > Michael, thanks for this info. > > I've stumbled upon
2016 Oct 19
2
How to assign NULL value to pairlist element while keeping it a pairlist?
On Sat, Oct 15, 2016 at 2:00 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote: >>>>>> Michael Lawrence <lawrence.michael at gene.com> >>>>>> on Wed, 12 Oct 2016 15:21:13 -0700 writes: > > > Thanks, this was what I expected. There is a desire to > > eliminate the usage of pairlist from user code, which > >
2016 Oct 12
2
How to assign NULL value to pairlist element while keeping it a pairlist?
Hi Henrik, It would help to understand your use case for pairlists. Thanks, Michael On Wed, Oct 12, 2016 at 9:40 AM, Michael Lawrence <michafla at gene.com> wrote: > The coercion is probably the most viable workaround for now, as it's > consistent with what happens internally for calls. All pairlists/calls > are converted to list for subassignment, but only calls are
2016 Oct 12
2
How to assign NULL value to pairlist element while keeping it a pairlist?
Hi, I seem to not be able to assign NULL to an element of a pairlist without causing it to be coerced to a plain list. For example: > x <- pairlist(1, 2) > class(x) [1] "pairlist" > x[1] <- list(NULL) > class(x) [1] "list" This actually true for all [()<- assignments regardless of list value, e.g. > x <- pairlist(1, 2) > x[1] <- list(0) [1]
2011 Apr 14
1
Possible bug in 'relist()' and/or 'as.relistable()'
Dear list, I think I just stumbled across a bug in either 'relist()' and/or 'as.relistable()'. It seems that 'pairlists' can only be un- and relisted as long as they're not nested: Good: a <- as.relistable(as.pairlist(list(a=1, b=2))) a <- unlist(a) relist(a)# Works Bad: a <- as.relistable(as.pairlist(list(a=1, b=2, c=list(c.1=1, c.2=2)))) a <- unlist(a)
2012 Jul 26
3
rep fails on pairlist
This code which has worked for years in R but fails under R-devel: > R.version.string [1] "R Under development (unstable) (2012-07-25 r59963)" > > n <- 3 > f <- function(x) {} > formals(f) <- rep(formals(f), n) ## Error in rep(formals(f), n) : replication of pairlists is defunct The message suggests that the change was intentional. Why was this functionality
2009 Mar 29
9
budgetdedicated server (ubuntu) down?
I was trying to update my wine package because synaptic said there was an update available and I got the following message W: Failed to fetch http://wine.budgetdedicated.com/apt/pool/main/w/wine/wine_1.1.18~winehq0~ubuntu~8.04-0ubuntu1_amd64.deb Could not connect to wine.budgetdedicated.com:80 (81.171.111.184). - connect (111 Connection refused) [IP: 81.171.111.184 80] I also can not connect
2009 Mar 20
2
struggling with pairlists
I would like to create a vector of pairlist (flag, binary_value) like: (variable ="TrendOff", value = 0) (variable ="MOdwt", value = 1) (variable ? "ZeroPadding", value =1) ................................................ I tried the following syntax but the emcompassing list (that I called "flags") is not made up of pairlists. Instead it
2012 May 22
2
Creating functions with a loop.
Hi I am trying to create n functions where each function is defined in function one step before, i.e. something like ff.k(x) = ff.j(x) - sum(1:j), for j=k-1 Is it possible? If it isn't and I manually create each function then is their a way to call them through a loop? My objective is to calculate something like result.k = ff.k(x1)/ff.k(x2) for k in 2:n Thank you for your time,
2003 Jan 16
1
Calling R function from within C code
Dear R experts, I'd like to call R function from within C code. I looked through the 'R exts' manual, found examples with lang2(R_fcall, list), and tried it, but it seemed to create the call, which can accept only a single argument of 'list' type, when I need to create the call of R functions with arbitrary numbers of arguments. How can I do it? Thanks a lot. -- WBR,