similar to: Characters subsetted with NA (was: Several R vs S-Plus issues)

Displaying 20 results from an estimated 2000 matches similar to: "Characters subsetted with NA (was: Several R vs S-Plus issues)"

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 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
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) #
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 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 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 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
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
2006 Apr 28
1
as.character.factor when the factor contains "NA"
as.character.factor contains this line (where cx=levels(x)[x]): if ("NA" %in% levels(x)) cx[is.na(x)] <- "<NA>" Is it possible that this is no longer the desired behavior? These two results don't seem very consistent: > as.character(as.factor(c("AB", "CD", NA))) [1] "AB" "CD" NA > is.na(.Last.value)[3] [1] TRUE
2005 Jul 06
2
Graphics: calling par(mar) after frame()
The following code produces 6 plots on a page, but the first is distorted and different from the others: par(mfrow=c(3,2), las=2) for (i in 1:6) { frame() par(mar=c(7, 7, 1, 1)) axis(2); box(); abline(h=seq(0,1,.5), col=2:4) } The first plot's axes are mis-aligned with the plotting area implied by the box. It seems to be a result of calling par(mar) after frame(). Is this expected
2002 Feb 20
1
Bug in "[<-.matrix"? (Was: Feature Request: "matrix[1:10,1:10, block=F] <- 1:10")
Thanks to David Meyer [david.meyer@ci.tuwien.ac.at] and David Brahm [brahm@alum.mit.edu] who suggested: m[ cbind(index.i, index.j) ] <- vals This works fine for the example I gave. Unfortunately, this approach doesn't extend to using the row and column names to make assignments: > m <- matrix("",ncol=3,nrow=3) > dimnames(m) <-
2004 Dec 22
2
outer(-x, x, pmin) cannot allocate
R> x <- 0. + 1:8000 R> y <- outer(-x, x, pmin) Error: cannot allocate vector of size 1000000 Kb Why does R need to allocate a gigabyte to create an 8000 x 8000 matrix? It doesn't have any trouble with outer(-x, x, "+"). Thanks. -- David Brahm (brahm at alum.mit.edu) Version: platform = i686-pc-linux-gnu arch = i686 os = linux-gnu system = i686, linux-gnu status =
2006 Aug 18
2
Floating point imprecision in sum() under R-2.3.1?
After upgrading to R-2.3.1 on Linux Redhat, I was suprised by this: R> x <- c(721.077, 592.291, 372.208, 381.182) R> sum(x) - 2066.758 [1] 4.547474e-13 Now I understand that floating point arithmetic is not precise, but 1) the result is exactly 0 in R-2.2.1 (patched) on the same machine, 2) .Machine$double.eps = 2.2e-16, so the error seems quite large. Also note I get the same
2002 Jan 07
1
Is r-announce alive?
I sent a message to <r-announce at stat.math.ethz.ch> last Thursday ("New package: colSums"), and still haven't seen it echoed on r-help or on the web archive (in fact there is no r-announce web archive for 2002). Is something broken? Did I need to use <r-announce at lists.R-project.org> instead? -- -- David Brahm (brahm at alum.mit.edu)
2005 Sep 02
2
Superassignment (<<-) and indexing
In a clean environment under R-2.1.0 on Linux: > x <- 1:5 > x[3] <<- 9 Error: Object "x" not found Isn't that odd? (Note x <<- 9 works just fine.) Why am I doing this? Because I'm stepping through code that normally lives inside a function, where "<<-" is appropriate. -- David Brahm (brahm at alum.mit.edu)
2002 Mar 08
4
ARMA and ARIMA modeling
I'd like to play with ARIMA models of stock prices, but I am a complete novice. Could some kind soul explain the relationship among packages "ts", "tseries", "dse", "dse2", and "fracdiff"? Are they 'competing' products or does one depend on another? Where would be the best place for a novice to begin? Thanks for any advice. PS. I
2006 Jan 06
1
Daylight Savings Time unknown in R-2.2.1
Under R-2.2.1, a POSIXlt date created with "strptime" has an unknown Daylight Savings Time flag: > strptime(20051208, "%Y%m%d")$isdst [1] -1 This is true on both Linux (details below) and Windows. It did not occur under R-2.1.0. Any ideas? TIA! > Sys.getenv("TZ") TZ "" Version: platform = i686-pc-linux-gnu arch = i686 os = linux-gnu