Displaying 20 results from an estimated 10000 matches similar to: "possible bug: NULL equality in lists."
2005 Feb 28
2
Changing function arguments to NULL
I'm trying to build a recursive set of functions that take a set of
arguments, change some of the arguments and recursively call the same
(or different) function.
For example here's a stupid recursive counting function that prints back
all integers from x to 0 (and ignores arguments y and z)
cnt <- function(x, y, z) {
stopifnot(is.numeric(x))
print (x)
recursionFUN <-
2005 Nov 22
1
failure in `setClass' examples
Hello,
Below is what I got running the examples from `setClass'. Could somebody
please help explain why the last `setIs' call is returning the warning and
whether this is expected?
R> setClass("track",
+ representation(x="numeric", y="numeric"))
[1] "track"
R> setClass("trackCurve",
+
2004 Jan 15
3
Extracting multiple elements from a list
For a long time I've wanted a way to conveniently extract multiple elements
from a list, which [[ doesn't allow. Can anyone suggest an efficient
function to do this? Wouldn't it be a sensible addition to R?
For example,
alist <- list()
alist[[1]] <- list()
alist[[1]]$name <- "first"
alist[[1]]$vec <- 1:4
alist[[2]] <- list()
alist[[2]]$name <-
2003 Nov 13
1
Can't get Sweave syntax highlighting with Emacs
I can't get Emacs to automatically do syntax highlighting of
Sweave files. I have followed Friedrich's suggestion for code
to insert into my .emacs file. The complete section from my .emacs
file is given below. When I load a *.Snw file, font is white until I press
M-x, then the first code and document chunks get highlighted, but not
the rest of the file. Latex and Noweb menus are
2009 Dec 30
1
What am I doing wrong in my loops?
Dear kind list people:
I have the following code:
>hours
[1] "0" "1" "2" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13"
"14" "15"
[16] "16" "17" "18" "19" "20" "21" "22"
2008 Sep 03
1
problem with Hmisc
Dear All,
I'm reading Frank Harrell's wonderful Regression
Modeling Strategies book and ran into a problem
following the example in Chapter 8. I'm working
on
platform: Ubuntu 8.04 (i486-pc-linux-gnu)
R version: 2.7.2 (2008-08-25)
and my command sequence was:
library(chron)
library(Hmisc)
load("prostate.sav")
describe(prostate)
The last command returned the error
2008 Oct 01
2
Bug or feature with finding a list element?
This seems odd. When I try to look up a list element which has a space in
the name using just the first word (i.e. no spaces), it will sometimes
return the element with a space in the name and sometimes it will return
NULL.
Try this:
alist <- list( 'hello'=10, bye=20, 'hello world'=30, 'goodbye world'=40, 'hi
world'=50, 'goodbye foo'=60, 'goodbye
2013 Mar 28
2
how to search a list that contains multiple dissimilar vectors?
Dear All,
This is a simple question, but I'm stumped about the simplest way to search a list object such as the following:
This randomish snippet:
n <- c(round(runif(round(runif(1,1,10),0),1,10),0))
alist <- new("list")
for (i in seq_along(n)) {
alist[[i]] <- c(round(runif(round(runif(1,1,10),0),1,10),0))
}
names(alist) <- sample(letters[1:length(n)])
rm(n);c(alist)
2006 Nov 06
5
alist()
In trying to get NULL members into a list, I found out about alist().
x<-alist()
x$one<-1
x$two<-NULL
but x$two doesn't exist.
It seems, though, that an alist is just a list.
How can one put NULL members into a list?
2006 Mar 06
1
Sort problem in merge()
Hello!
I am merging two datasets and I have encountered a problem with sort.
Can someone please point me to my error. Here is the example.
## I have dataframes, first one with factor and second one with factor
## and integer
> tmp1 <- data.frame(col1 = factor(c("A", "A", "C", "C", "0", "0")))
> tmp2 <- data.frame(col1 =
2009 Nov 19
4
Is there an variant of apply() that does not return anything?
There are a few version of apply() (e.g., lapply(), sapply()). I'm
wondering if there is one that does not return anything but just
silently apply a function to the list argument.
For example, the plot function is applied to each element in 'alist'.
It is redundant to return anything from apply.
apply(alist,function(x){ plot each element of alist})
2015 Jun 22
2
Samba 3 AD Member Server Strangeness
On Monday, June 22, 2015 9:15 AM ,Rowland Penny wrote:
> On 22/06/15 13:55, Brian.Huffman at dupont.com wrote:
> > On , June 20, 2015 5:10 AM, Rowland Penny wrote:
> >> On 19/06/15 21:39, Brian.Huffman at dupont.com wrote:
> >>> All,
> >>>
> >>> I'm trying to configure a Samba 3 AD member server including
> >>> winbind. I'm
2009 Oct 01
1
inverse currying
Dear list,
I have the following function,
sugar = function(fun, id = "id"){
ff <- formals(fun)
if( id %in% names(ff))
stop("id is part of args(fun)")
formals(fun) <- c(unlist(ff), alist(id=))
fun
}
which one may use on a function foo,
foo = function(x){
x
}
sugar(foo) # results in the extended closure,
function (x, id)
{
x
}
Its limitation (other
2016 Mar 07
2
body(NULL) <- something; ditto formals() -- should not work
I'm proposing to signal an error (from R >= 3.3.0) in such
examples -- which do "work" in R 3.2.x and earlier :
> f <- NULL; body(f) <- quote(sin(a+1)); f
function ()
sin(a + 1)
<environment: 0x48f9798>
> g <- NULL; formals(g) <- alist(x = pi, y=); g
function (x = pi, y)
NULL
<environment: 0x4e6dfe8>
>
The proposal is that the underlying C
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
> >
2015 Jun 22
2
Samba 3 AD Member Server Strangeness
On , June 20, 2015 5:10 AM, Rowland Penny wrote:
>
> On 19/06/15 21:39, Brian.Huffman at dupont.com wrote:
> > All,
> >
> > I'm trying to configure a Samba 3 AD member server including winbind. I'm
> on RHEL 6.6, so I'm using Samba version 3.6.23.
> >
> > Here's my configuration:
> > [global]
> > log level = 3 winbind:10
2001 Oct 16
4
Assignment of structures on a given environment
Hi,
In order to avoid deep copies by passing large arguments to functions or
returning values, I'm trying to do the assignment of variables in a
given environment. The problem is when I try to assign a structure: a
list for example.
If I have:
ind <- c("a","b")
my idea is doing something like
l <- alist()
l[ind] <- as.list(c(20,40))
in a given
2015 Jun 19
2
Samba 3 AD Member Server Strangeness
All,
I'm trying to configure a Samba 3 AD member server including winbind. I'm on RHEL 6.6, so I'm using Samba version 3.6.23.
Here's my configuration:
[global]
log level = 3 winbind:10
workgroup = ABC
server string = LV37
netbios name = LV37
idmap config *:backend = tdb
idmap config *:range = 2000-9999
idmap config
2006 Apr 17
1
strsplit does not return correct value when spliting "" (PR#8777)
Full_Name: Charles Dupont
Version: 2.2.0
OS: linux
Submission from: (NULL) (160.129.129.136)
when
strsplit("", " ")
returns character(0)
where as
strsplit("a", " ")
returns "a".
these return values are not constiant with each other.
Charles Dupont
2005 Jul 08
4
Mtu/802.1Q limits on vif ??
Hello. I''m new to the list and I hope this is not a FAQ. I searched the
archives and didn''t find an answer...
Quick question :
Is there a limitation if the vif code cutting at 1500 bytes ??
I''m trying to implement an IPv6 router/Firewall (2 XenU)
Xen 2.0.6,
Linux 2.6 is used on xen0 and XenU.
The physical machine has 2 interfaces, eth0 (which is connected to an