similar to: outer(-x, x, pmin) cannot allocate

Displaying 20 results from an estimated 10000 matches similar to: "outer(-x, x, pmin) cannot allocate"

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
2002 Aug 01
4
What does persp() return?
I want to plot some 3D points on top of the grid produced by persp(). On 2/22/01, Paul Murrell <paul at stat.auckland.ac.nz> wrote in R-help: > In S-Plus, persp() returns a value that can be used to transform 3D > locations to 2D, but this sort of thing is not (yet) available in R. But persp() does return something (in R-1.5.1): a 4x4 matrix which in the C code is called the
2015 Dec 24
2
override pmin/pmax for my own matrix
Hello, I'm trying to override pmin and pmax for my own matrix. These two functions have ... as an argument. I tried to override them as follows: setMethod("pmax", class_name, function(x, ..., na.rm) { ... }) I use this way to override primitive functions such as min/max and it works fine. But it doesn't work for pmin and pmax. I guess because they are regular functions? How
2012 Oct 30
4
There is pmin and pmax each taking na.rm, how about psum?
Hi, Please consider the following : x = c(1,3,NA,5) y = c(2,NA,4,1) min(x,y,na.rm=TRUE) # ok [1] 1 max(x,y,na.rm=TRUE) # ok [1] 5 sum(x,y,na.rm=TRUE) # ok [1] 16 pmin(x,y,na.rm=TRUE) # ok [1] 1 3 4 1 pmax(x,y,na.rm=TRUE) # ok [1] 2 3 4 5 psum(x,y,na.rm=TRUE) [1] 3 3 4 6 # expected result Error: could not find function "psum" # actual result
2003 Dec 25
6
Plot a sphere
Hi, I'm new to R (and math ;) Would somebody please be so kind as to direct me in plotting a 3D sphere? I tried something in the lines of: #### y <- x <- seq(-pi, pi, length=pi*10) f <- function(x,y) { z <- sqrt(pi - x^2 - y^2) #z[is.na(z)] <- 0 z } z <- outer(x, y, f) persp(x, y, z, theta = 120, phi = 30) #### I've also tried: .... make.surface.grid(...) ..
2003 Jul 11
1
Title obscured when using par(mfrow) (PR#3463)
I want to put multiple plots on a page using par(mfrow), then a single title at the top. This should work, but doesn't: R> par(oma=c(0,0,4,0), mfrow=c(3,4)) R> for (i in 1:12) {plot(1); title(i)} R> ## text(10,10, ".") R> par(mfrow=c(1,1), oma=c(0,0,1,0)) R> title("Main Title") The main title does not appear. However, uncommenting the third line
2005 Jan 21
4
which.pmin?
I have two vectors (k.floor and k.ceiling) of integers of the same length, and a function (fpr). b <- 10:40 k.floor <- floor(log(2) * b) k.ceiling <- ceiling(log(2) * b) fpr.floor <- fpr(b, k.floor) fpr.ceiling <- fpr(b, k.ceiling) If R had a element-wise ternary function, I'd like to do something like this: (fpr.floor < fpr.ceiling) ? k.floor :
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) <-
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)
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
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
2001 Dec 10
1
Documentation of .Last.lib in library() (PR#1209)
help(library) says: "`.Last.lib' is called when a package is loaded." Probably should be "...is detached." -- David Brahm (brahm@alum.mit.edu) --please do not edit the information below-- Version: platform = sparc-sun-solaris2.6 arch = sparc os = solaris2.6 system = sparc, solaris2.6 status = major = 1 minor = 3.1 year = 2001
2003 Aug 13
2
rowsum() may return a vector instead of a matrix (PR#3737)
If all rows are in the same "group", rowsum() returns a vector instead of a (1xN) matrix, contrary to documentation: R> print(z <- rowsum(matrix(1:12, 3,4), rep("x",3))) [1] 6 15 24 33 R> dim(z) NULL It worked correctly in version 1.4.0 but was broken by version 1.6.1. I'm currently using 1.7.1 under Solaris 2.8. --please do not edit the information
2002 Apr 03
1
predict.Arima fails when x is not a time-series
I'm playing with predict.Arima in the 3/19/02 development snapshot of R-devel. The following produces an error message because x is not of class "ts": R> x <- rnorm(20) R> obj <- arima(x, c(2,0,0)) R> predict(obj) Error in round(x, digits) : Non-numeric argument to mathematical function Granted the documentation for arima says x should be a time-series, but