similar to: odd behaviour of identical

Displaying 20 results from an estimated 1000 matches similar to: "odd behaviour of identical"

2009 Mar 30
1
duplicated fails to rise correct errors (PR#13632)
Full_Name: Wacek Kusnierczyk Version: 2.8.0 and 2.10.0 r48242 OS: Ubuntu 8.04 Linux 32 bit Submission from: (NULL) (129.241.110.161) In the following code: duplicated(data.frame(), incomparables=NA) # Error in if (!is.logical(incomparables) || incomparables) .NotYetUsed("incomparables != FALSE") : # missing value where TRUE/FALSE needed the raised error is clearly not the
2009 Mar 23
2
dput(as.list(function...)...) bug
Tested in R 2.8.1 Windows > ff <- formals(function(x)1) > ff1 <- as.list(function(x)1)[1] # ff1 acts the same as ff in the examples below, but is a list rather than a pairlist > dput( ff , control=c("warnIncomplete")) list(x = ) This string is not parsable, but dput does not give a warning as specified. > dput( ff ,
2008 Nov 10
6
Variable passed to function not used in function in select=... in subset
Hello! I have the problem that in my function the passed variable is not used, but the variable name of the dataframe itself?- difficult to explain, but an easy example: TestFunc<-function(df, group) { ??? print(names(subset(df, select=group))) } df1<-data.frame(group="G1", visit="V1", value=0.9) TestFunc(df1, c("group", "visit")) Result: [1]
2008 Jul 01
5
trivial list question
Dear experts, For the makeGenotype function I need a list as in the example. However, since my list needs to be 184 long there must be an easy way to make it. >list(1:2,3:4,5:6,7:8) [[1]] [1] 1 2 [[2]] [1] 3 4 [[3]] [1] 5 6 [[4]] [1] 7 8 I have tried lis<-1:184 dim(lis)=c(92,2,1) as.list(lis) and several other options. Any suggestions? many thanks Marco [[alternative
2008 Jun 18
1
strsplit and the empty string
Hello, I am wondering about the behaviour of strsplit. When the pattern matches the beginning of the search string, the mepty string is added to the result, but that's not the case when the pattern matches the end of the search string: strsplit(" hello dolly ") [1] "" "hello" "dolly" The man for strsplit explains the algorithm: " The algorithm
2009 Jan 21
0
patch for src/main/character.c
Attached is a suggested patch for src/main/character.c. It does not fix a bug, but rather provides an improvement on the recent extension of do_grep. In essence, instead of four occurences of 'invert ^ LOGICAL(ind)[i]' that accommodate for the option 'invert' added to grep, there is one occurence of 'LOGICAL(ind)[i] ^= invert' that modifies in-place the logical vector of
2009 Feb 12
0
Patch for src/main/character.c, systematizing recent fix to do_grep
The attached patch provides a modification to the recent fix/improvement to do_grep already included in the most recent development version. The original fix added new functionality to the grep function by adding a new parameter, 'invert'. In the source code for the underlying do_grep, the value of the parameter is used to invert the logical match-no match flag vector ind. The
2009 Apr 02
2
actual argument matching does not conform to the definition (PR#13634)
Full_Name: Wacek Kusnierczyk Version: 2.10.0 r48269 OS: Ubuntu 8.04 Linux 32 bit Submission from: (NULL) (129.241.199.164) In the following example (and many other cases): quote(a=1) # 1 the argument matching is apparently incorrect wrt. the documentation (The R Language Definition, v 2.8.1, sec. 4.3.2, p. 23), which specifies the following algorithm for argument matching: 1. Attempt to
2009 Mar 29
2
if does not covert raw to logical (PR#13630)
Full_Name: Wacek Kusnierczyk Version: 2.8.0 and 2.10.0 r48242 OS: Ubuntu 8.04 Linux 32 bit Submission from: (NULL) (80.202.30.36) The following raises an error: if (as.raw(1)) 1 # error: unimplemented type 'raw' in 'asLogical' However, ?'if' says: " Arguments: cond: A length-one logical vector that is not 'NA'. Conditions of length
2009 Apr 21
8
incorrect output and segfaults from sprintf with %*d (PR#13667)
Full_Name: Wacek Kusnierczyk Version: 2.10.0 r48365 OS: Ubuntu 8.04 Linux 32bit Submission from: (NULL) (129.241.110.141) sprintf has a documented limit on strings included in the output using the format '%s'. It appears that there is a limit on the length of strings included with, e.g., the format '%d' beyond which surprising things happen (output modified for conciseness):
2009 Jan 02
1
[Fwd: Re: [R] Randomly remove condition-selected rows from a matrix]
Following Duncan's suggestion, I forward the below to R-devel. vQ -------- Original Message -------- Subject: Re: [R] Randomly remove condition-selected rows from a matrix Date: Fri, 02 Jan 2009 10:34:52 -0500 From: Duncan Murdoch <murdoch at stats.uwo.ca> To: Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk at idi.ntnu.no> CC: R help <R-help at stat.math.ethz.ch>
2008 Nov 17
4
functional (?) programming in r
the following is a trivialized version of some functional code i tried to use in r: (funcs = lapply(1:5, function(i) function() i)) # a list of no-parameter functions, each with its own closure environment, # each supposed to return the corresponding index when applied to no arguments sapply(funcs, function(func) func()) # supposed to return c(1,2,3,4,5) there is absolutely nothing unusual in
2009 Mar 15
4
primitives again
Dear R Gurus: How do I find the functions which are primitives, please? Thanks, Edna Bell
2008 Nov 30
6
Regex: workaround for variable length negative lookbehind
Hi all I have the following regular expression problem: I want to find complete elements of a vector that end in a repeated character but where the repetition doesn't make up the whole word. That is, for the vector vec: vec<-c("aaaa", "baaa", "bbaa", "bbba", "baamm", "aa") I would like to get "baaa" "bbaa"
2009 Mar 19
8
function question
Dear R Gurus: I read somewhere that functions are considered vectors. Is this true, please? thanks Edna Bell
2009 May 13
3
where does the null come from?
m = matrix(1:4, 2) apply(m, 1, cat, '\n') # 1 2 # 3 4 # NULL why the null? vQ
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 Jan 18
8
regex -> negate a word
Dear all, let's assume I have a vector of character strings: x <- c("abcdef", "defabc", "qwerty") What I would like to find is the following: all elements where the word 'abc' does not appear (i.e. 3 in this case of 'x'). Since I am not really experienced with regular expressions, I started slowly and thought I find all word were
2009 Feb 04
1
reference for ginv
?ginv provides 'Modern Applied Statistics with S' (MASS), 3rd, by Venables and Ripley as the sole reference. I happen to have this book (4th ed) on loan from our library, and as far as I can see, ginv is mentioned there twice, and it is *used*, not *explained* in any way. (It is used on p. 148 in the 4th edition.) ginv does not appear in the index of MASS. ginv is an implementation of
2009 Feb 23
1
are arithmetic comparison operators binary?
the man page for relational operators (see, e.g., ?'<') says: " Binary operators which allow the comparison of values in atomic vectors. Arguments: x, y: atomic vectors, symbols, calls, or other objects for which methods have been written. " it is somewhat surprizing that the following works: '<'(1) # logical(0) '<'() #