Displaying 20 results from an estimated 10000 matches similar to: "More trouble with empty subsets"
2001 Oct 03
8
Several R vs S-Plus issues
Hi, all,
I've been converting code from S-Plus ("S" for short) to R for a few weeks.
Here are some differences I've found, aside from the big well-known ones
(scoping, models, data storage) and the contents of Kurt Hornik's FAQ section
3.3.3. Let me start with the ones that seem like serious bugs or deficiencies:
1) LETTERS[c(NA,2)] in S is
2001 Oct 03
8
Several R vs S-Plus issues
Hi, all,
I've been converting code from S-Plus ("S" for short) to R for a few weeks.
Here are some differences I've found, aside from the big well-known ones
(scoping, models, data storage) and the contents of Kurt Hornik's FAQ section
3.3.3. Let me start with the ones that seem like serious bugs or deficiencies:
1) LETTERS[c(NA,2)] in S is
2001 Oct 03
0
RE: [R] Several R vs S-Plus issues (PR#1112)
Also in assign() there some arguments lacking in R such as 'frame' and
'where', though I guess that 'frame' in S may be similar to 'pos' in R.
Harvey
-----Original Message-----
From: David Brahm [SMTP:a215020@agate.fmr.com]
Sent: Wednesday, October 03, 2001 11:36 AM
To: r-help@stat.math.ethz.ch
Cc: Kurt.Hornik@ci.tuwien.ac.at; r-bugs@r-project.org
Subject:
2001 Sep 14
1
rowsum dimnames (PR#1092)
The result of rowsum() in R doesn't have the dimnames I'd expect, e.g.:
> rowsum(matrix(1:12, 3,4), c("Y","X","Y"))
[,1] [,2] [,3] [,4]
1 2 5 8 11
2 4 10 16 22
whereas S-Plus gives the more useful result:
[,1] [,2] [,3] [,4]
X 2 5 8 11
Y 4 10 16 22
This is because R's rowsum() code gives the
2001 Oct 04
2
Characters subsetted with NA (was: Several R vs S-Plus issues)
Hello, R-devel!
I posted to R-help, and (inappropriately) to R-bugs, this R/S-Plus difference:
> LETTERS[c(NA,2)] in S is c("","B"), but in R is c("NA","B")
Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> wrote:
> I think we do not want to change this. ...
> R> is.na(LETTERS[c(NA,2)])
[1] TRUE FALSE
> so we really have NA but it is
2001 Sep 27
5
Reading and writing to S-like databases
Hi,
I asked this question 2 years ago, and would like to know if the answer has
changed.
In S-Plus, I build databases of many large objects. In any given analysis,
I only need a few of those objects, but attach'ing the whole database is fine
since objects are only read as needed. How can I do the same thing in R,
without reading the entire database?
One possibility is to treat
2001 Oct 03
0
Several R vs S-Plus issues (PR#1110)
Hi, all,
I've been converting code from S-Plus ("S" for short) to R for a few weeks.
Here are some differences I've found, aside from the big well-known ones
(scoping, models, data storage) and the contents of Kurt Hornik's FAQ section
3.3.3. Let me start with the ones that seem like serious bugs or deficiencies:
1) LETTERS[c(NA,2)] in S is
2001 Sep 13
1
rowsum dimnames
Hi,
The result of rowsum() in R doesn't have the dimnames I'd expect, e.g.:
> rowsum(matrix(1:12, 3,4), c("Y","X","Y"))
[,1] [,2] [,3] [,4]
1 2 5 8 11
2 4 10 16 22
whereas S-Plus gives the more useful result:
[,1] [,2] [,3] [,4]
X 2 5 8 11
Y 4 10 16 22
This is because R's rowsum() code gives
2002 Jan 07
1
Mishandling missing "..." (PR#1247)
R> myfun <- function(x, ...) {x[...] <- 0; x}
R> myfun(3)
Error in myfun(3) : SubAssignArgs: invalid number of arguments
It fails because no ... was passed. The workaround (and desired behavior) is:
R> myfun <- function(x, ...) {if (missing(...)) x[] <- 0 else x[...] <- 0; x}
R> myfun(3)
[1] 0
Deja vu? This is the one piece of my PR#1110 (Oct 3, 2001) that I
2002 Mar 08
2
Sys.putenv environment variables disappear (PR#1371)
Environment variables set with Sys.putenv() disappear (i.e. become "")
after a while, especially after heavy-duty I/O. Example:
R> x <- matrix(1., 3000, 3000)
R> save(x, file="myx.RData")
R> Sys.putenv(HOME="/tmp")
R> while (Sys.getenv("HOME") != "") {cat("ok\n"); load("myx.RData")}
The loop prints
2001 Sep 25
2
read.table() suggestions
Hi,
I understand work is being done to improve read.table(), especially by
Prof. Brian D. Ripley. I offer below a version that I wrote, in the hope some
aspects of it may prove useful or at least inspire discussion.
Be aware that my version differs in a couple fundamental ways that reflect
my aversion to dataframes and factors. So it returns a list of vectors which
are all character,
2001 Oct 22
1
round() doesn't (PR#1139)
R> round(100000/3, -2) - 33300
[1] -7.275958e-12
I would have hoped for 0. The problem seems to be specifically for negative
"digits". This is in 1.3.1 on Solaris 2.6 (full description at bottom).
[Apologies for making everyone read this 3 times; my bug.report() burped.]
Peter Dalgaard <p.dalgaard@biostat.ku.dk> says the problem is in fround.c,
which reads in part:
2002 Aug 13
2
Misalignment of <NA> in rownames (PR#1905)
An NA in the rownames of a matrix (or dataframe) causes misalignment when the
matrix is printed:
R> x <- matrix(1:12, 3,4, dimnames=list(letters[1:3], LETTERS[1:4]))
R> rownames(x)[2] <- NA
R> x
A B C D
a 1 4 7 10
<NA> 2 5 8 11
c 3 6 9 12
The bug is in function Rstrlen, in src/main/printutils.c. MatrixRowLabel and
MatrixColumnLabel (same file) rely on Rstrlen
2001 Dec 03
1
New package: g.data
A new package "g.data" is available on CRAN, to create and maintain databases
that work more like the S-Plus model.
Here's the official Description for g.data (v1.2):
Create and maintain delayed-data packages (DDP's). Data stored in
a DDP are available on demand, but do not take up memory until requested.
You attach a DDP with g.data.attach(), then read from it and assign
2001 Dec 03
1
New package: g.data
A new package "g.data" is available on CRAN, to create and maintain databases
that work more like the S-Plus model.
Here's the official Description for g.data (v1.2):
Create and maintain delayed-data packages (DDP's). Data stored in
a DDP are available on demand, but do not take up memory until requested.
You attach a DDP with g.data.attach(), then read from it and assign
2001 Dec 14
2
colSums in C
Hi, all!
My project today is to write a speedy colSums(), which is a function
available in S-Plus to add the columns of a matrix. Here are 4 ways to do it,
with the time it took (elapsed, best of 3 trials) in both R and S-Plus:
m <- matrix(1, 400, 40000)
x1 <- apply(m, 2, sum) ## R=16.55 S=52.39
x2 <- as.vector(rep(1,nrow(m)) %*% m) ## R= 2.39 S= 8.52
x3 <-
2003 Oct 22
3
Subsetted 1-D arrays (PR#4110)
In R-patched_2003-10-20, subsetted 1-D arrays no longer get converted to
vectors. The NEWS file documents this change, as an indirect result of bug
report 4110. I just wanted to mention this can break code in some rather
obscure ways, such as this toy example:
R> x <- sort(tapply(1:8, rep(1:4,2), sum)) # Was vector, now is 1D array
R> y <- matrix(1:4, 1,4) #
2003 Jan 23
0
Summary: Warnings with no INDEX file in a package
Thanks to Henrik Bengtsson, Martin Maechler, Brian Ripley, Jeff Gentry and
David Brahm for taking the time to answer my questions about INDEX files in R
packages.
My key take-aways were:
1) All of this will be changing a lot in R 1.7.0-to-be, so don't sweat the
details.
2) Many people run R CMD build before they run R CMD check. I found this quite
surprising. I did not realize that R
2006 Jan 06
2
sudoku
Any doubts about R's big-league status should be put to rest, now that
we have a
Sudoku Puzzle Solver. Take that, SAS! See package "sudoku" on CRAN.
The package could really use a puzzle generator -- contributors are
welcome!
-- David Brahm (brahm at alum.mit.edu)
[[alternative HTML version deleted]]
_______________________________________________
R-packages mailing list
2006 Jan 06
2
sudoku
Any doubts about R's big-league status should be put to rest, now that
we have a
Sudoku Puzzle Solver. Take that, SAS! See package "sudoku" on CRAN.
The package could really use a puzzle generator -- contributors are
welcome!
-- David Brahm (brahm at alum.mit.edu)
[[alternative HTML version deleted]]
_______________________________________________
R-packages mailing list