Displaying 20 results from an estimated 7000 matches similar to: "E`<`<rrors in recursive default argument references"
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 ,
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>
2009 Feb 22
2
Semantics of sequences in R
Inspired by the exchange between Rolf Turner and Wacek Kusnierczyk, I
thought I'd clear up for myself the exact relationship among the
various sequence concepts in R, including not only generic vectors
(lists) and atomic vectors, but also pairlists, factor sequences,
date/time sequences, and difftime sequences.
I tabulated type of sequence vs. property to see if I could make sense
of all
2009 Feb 22
2
Semantics of sequences in R
Inspired by the exchange between Rolf Turner and Wacek Kusnierczyk, I
thought I'd clear up for myself the exact relationship among the
various sequence concepts in R, including not only generic vectors
(lists) and atomic vectors, but also pairlists, factor sequences,
date/time sequences, and difftime sequences.
I tabulated type of sequence vs. property to see if I could make sense
of all
2009 Sep 02
2
Documentation for is.atomic and is.recursive
The documentation for is.atomic and is.recursive is inconsistent with
their behavior in R 2.9.1 Windows.
? is.atomic
???? 'is.atomic' returns 'TRUE' if 'x' is an atomic vector (or 'NULL')
???? and 'FALSE' otherwise.
???? ...
???? 'is.atomic' is true for the atomic vector types ('"logical"',
???? '"integer"',
2008 Nov 29
2
Using grep() to subset lines of text
I have two vectors, a and b. b is a text file. I want to find in b those
elements of a which occur at the beginning of the line in b. I have the
following code, but it only returns a value for the first value in a, but I
want both. Any ideas please.
a = c(2,3)
b = NULL
b[1] = "aaa 2 aaa"
b[2] = "2 aaa"
b[3] = "3 aaa"
b[4] = "aaa 3 aaa"
2009 Jun 23
1
Documentation/software inconsistency in `:` and seq
In 2.8.1/Windows:
According to ? :
Details:
For numeric arguments 'from:to' is equivalent to 'seq(from, to)' ...
Value:
For numeric arguments, a numeric vector. This will be of type
'integer' if 'from' and 'to' are both integers and representable
in the integer type, otherwise of type 'numeric'....
The first claim
2009 Feb 08
3
Best 64-bit Linux distro for R?
The R FAQ is very helpful about installing R on various Linuxes, but doesn't
seem to discuss the advantages of one distribution over another. I am new
to Linux (though not to Unix!), and would appreciate some guidance from
those with experience.
I plan to set up a headless Linux x86 server for the sole purpose of running
64-bit R. Are there reasons to prefer some Linux distributions over
2009 Feb 17
2
cumsum vs. sum
I recently traced a bug of mine to the fact that cumsum(s)[length(s)]
is not always exactly equal to sum(s).
For example,
x<-1/(12:14)
sum(x) - cumsum(x)[3] => 2.8e-17
Floating-point addition is of course not exact, and in particular is
not associative, so there are various possible reasons for this.
Perhaps sum uses clever summing tricks to get more accurate results?
In some
2009 Jan 26
1
Large regular expressions
Given a vector of reference strings Ref and a vector of test strings
Test, I would like to find elements of Test which do not contain
elements of Ref as \b-delimited substrings.
This can be done straightforwardly for length(Ref) < 6000 or so (R
2.8.1 Windows) by constructing a pattern like \b(a|b|c)\b, but not for
larger Refs (see below). The easy workaround for this is to split Ref
into
2009 Jul 29
3
Object equality for S4 objects
To test two environments for object equality (Lisp EQ), I can use 'identity':
> e1 <- environment(local(function()x))
> e2 <- environment(local(function()x))
> identical(e1,e2) # compares object identity
[1] FALSE
> identical(as.list(e1),as.list(e2)) # compares values as name->value mapping
[1] TRUE # (is there a
2009 May 20
2
Class for time of day?
What is the recommended class for time of day (independent of calendar
date)?
And what is the recommended way to get the time of day from a POSIXct
object? (Not a string representation, but a computable representation.)
I have looked in the man page for DateTimeClasses, in the Time Series
Analysis Task View and in Spector's Data Manipulation book but haven't found
these. Clearly I can
2009 Feb 10
1
Variable/function namespaces WAS: Bug in subsetting data frame (PR#13515)
On Tue, Feb 10, 2009 at 10:11 AM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
> Stavros Macrakis wrote:
>> On Tue, Feb 10, 2009 at 8:31 AM, Duncan Murdoch <murdoch at stats.uwo.ca>wrote:
>>> The evaluator recognizes the context of usage and will get the
>>> function for a function call....
>> Can you point me to chapter and verse in the language
2009 Jun 19
3
Floating point precision / guard digits? (PR#13771)
Full_Name: D Kreil
Version: 2.8.1 and 2.9.0
OS: Debian Linux
Submission from: (NULL) (141.244.140.179)
Group: Accuracy
I understand that most floating point numbers are approximated due to their
binary storage. On the other hand, I thought that modern math CPUs used guard
digits to protect against trivial underflows. Not true?
# integers, no problem
> 1+1+1==3
[1] TRUE
# binary floating
2009 Jun 19
3
Floating point precision / guard digits? (PR#13771)
Full_Name: D Kreil
Version: 2.8.1 and 2.9.0
OS: Debian Linux
Submission from: (NULL) (141.244.140.179)
Group: Accuracy
I understand that most floating point numbers are approximated due to their
binary storage. On the other hand, I thought that modern math CPUs used guard
digits to protect against trivial underflows. Not true?
# integers, no problem
> 1+1+1==3
[1] TRUE
# binary floating
2009 Dec 18
2
Vectorized switch
What is the 'idiomatic' way of writing a vectorized switch statement?
That is, I would like to write, e.g.,
vswitch( c('a','x','b','a'),
a= 1:4,
b=11:14,
100 )
=> c(1, 100, 13, 4 )
equivalent to
ifelse( c('a','x','b','a') ==
2011 Oct 19
2
Speed difference between df$a[1] and df[1,"a"]
I was surprised to find that df$a[1] is an order of magnitude faster than
df[1,"a"]:
> df <- data.frame(a=1:10)
> system.time(replicate(100000, df$a[3]))
user system elapsed
0.36 0.00 0.36
> system.time(replicate(100000, df[3,"a"]))
user system elapsed
4.09 0.00 4.09
A priori, I'd have thought that combining the row and column
2009 Apr 20
2
The assign(paste(...,i),...) idiom
Judging from the traffic on this mailing list, a lot of R beginners
are trying to write things like
assign( paste( "myvar", i), ...)
where they really should probably be writing
myvar[i] <- ...
Do we have any idea where this bizarre habit comes from?
-s
2009 May 27
1
R Books listing on R-Project
I was wondering what the criteria were for including books on the Books
Related to R page <http://www.r-project.org/doc/bib/R-books.html>. (There is
no maintainer listed on this page.)
In particular, I was wondering why the following two books are not listed:
* Andrew Gelman, Jennifer Hill, *Data Analysis Using Regression and
Multilevel/Hierarchical Models*. (CRAN package 'arm')
*
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