similar to: Problem using outer()

Displaying 20 results from an estimated 20000 matches similar to: "Problem using outer()"

2004 Oct 28
1
Problem with "outer" function
Hello, I am having a problem with the "outer" function. I am using R 1.9.1 on Windows 2000. My problem may be described as follows: I have a function f of 3 variables and 3 vectors, aa, bb and cc. I would like to evaluate this function in a 3-dimensional grid of points corresponding to all combinations of the elements of the 3 vectors. For example, if aa<-c(1,2) bb<-c(3,4)
2004 Apr 21
1
Can't install new packages
I am using R 1.7.0 under unix, installed on Mac OS X via fink. I wanted to install the date package, and used the following command: install.packages(date) It sure looked like it was going to work: trying URL `http://cran.r-project.org/src/contrib/PACKAGES' Content type `text/plain; charset=iso-8859-1' length 180100 bytes opened URL .......... .......... .......... .......... ..........
2002 Sep 11
1
R 1.5.0 on Jaguar?
It seems that someone was having trouble compiling R under Mac OS X 10.2, but I'm wondering if anyone is running the version available from http://www.apple.com/downloads/macosx/math_science/rformacintosh.html under OS X 10.2. This is important because I'm about to take delivery of a new Power Mac running 10.2! John Shonder Oak Ridge National Laboratory
2008 Jul 18
1
problem with putting text in outer margins (mtext outer=TRUE)
Hi there, I'm trying to get some text in the outer margins of my plots and am having trouble - the margin text is overlapping my plots, even though the outer margin I'm trying to put it in is very big. I've simplified my problem down to this: ------------------------- X11(width=7.5,height=10) par(mfrow=c(6,1),oma=c(20,0,20,0), mar=c(0,3.1,1,2.1)) for (i in 1:6) {
2006 Dec 07
2
groupedData Error Using outer=TRUE
I'm using groupedData from nlme. I set up a groupedData data.frame with outer=~group1. When I try to plot with outer=TRUE, I get "subscript out of bounds." This happens most of the time. When it works, I get spaghetti-type plots for comparing groups. But I don't understand why it doesn't usually work. > longa.mod.1.gd <- groupedData(mod1.logit~time|
2017 Mar 19
2
outer not applying a constant function
Hi, the function outer can not apply a constant function as in the last line of the following example: > xg <- 1:4 > yg <- 1:4 > fxyg <- outer(xg, yg, function(x,y) x*y) > fconstg <- outer(xg, yg, function(x,y) 1.0) Error in outer(xg, yg, function(x, y) 1) : dims [product 16] do not match the length of object [1] Of course there are simpler ways to construct a constant
2003 Jul 09
2
A problem with using the "outer" function
Hi: I am using R 1.7.0 on Windows. I am having trouble getting "outer" to work on one of my functions. Here is a simple example illustrating my problem: > b1 <- c(1.2,2.3) > b2 <- c(0.5,0.6) > x <- c(3e+01, 1e+02, 3e+02, 5e+02, 1e+03, 1e+04, 1e+05, 1e+06) > y <- c(2,4,2,5,2,3,1,1) > n <- c(5,8,3,6,2,3,1,1) > outer(b1,b2,FUN=bpllkd,x,y,n)
2001 Mar 15
3
outer
Dear r-plus users, i would like to use outer in the following case outer(x,y,FUN="fun") i suppose that my function fun is of the following form: fun<-function(x,y) { if(y>x) return(x+y) if(y<=x) return(0) } My problem is that the command outer(x,y,FUN="fun") return me a null matrix instead of an upper triangular matrix. Is somebody have a solution ? Thanks for your
2005 Feb 28
2
A problem about outer()
Dear all, I have something about function outer() that I can't understand. Just see the following example. The two NaNs are due to 0/0, but I can't figure out the cause of the last two errors. I wonder if some one can explain this for me. ___________________________________________________________________ > sx=rbinom(10,1,0.5);ot=rbinom(10,1,0.5);ag <- rbinom(10,100,0.3);ho <-
2017 Mar 20
1
outer not applying a constant function
> Or is this a bad idea? I don't like the proposal. I have seen code like the following (in fact, I have written such code, where I had forgotten a function was not vectorized) where the error would have been discovered much later if outer() didn't catch it. > outer(1:3, 11:13, sum) Error in outer(1:3, 11:13, sum) : dims [product 9] do not match the length of object [1]
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 =
2007 Dec 04
2
Wishlist: mention Vectorize in 'outer' man page (PR#10490)
Full_Name: Antonio, Fabio Di Narzo Version: 2.6.1 OS: linux Submission from: (NULL) (213.140.16.187) In 'outer' man page, there is no mention of the Vectorize function. Moreover, I think it isn't underlined enough that the FUN argument to 'outer' must be a vectorized function (doc speaks about a function which has to 'operate elementwise'). A cross-reference from
2006 Mar 23
3
outer() function
Greetings R-help community, I am relatively new to R, which may be why I am having trouble understanding this problem. I am trying to use outer() to generate a graphable surface of a function. If there is a better way to do this, I would appreciate the insight. Otherwise, could someone suggest a method to get the outer() function to work here? Below is my simplified R program. Further down
2011 Dec 16
1
main title in plot; outer=TRUE (cut off)
Hello, I'm trying to position a plot title "1 a)" in the top left corner of a graph; i've set outer=TRUE for it to be in the outer margin unfortunately this is cut off. Is there a way either to make it so that it is not cut off or increase the number of margins and then place it in margin below the outer? Heres what I have so far windows(width=7,height=7)
2001 May 10
1
outer
I've just begun playing around with defining functions in R and I'm not really sure what's going on in the following situation. I've defined the following function: gcd <- function(x,y) { x <- as.integer(x); y <- as.integer(y) q <- as.integer(x / y) r <- x - q * y if (r==0) y else gcd(y,r) } As expected, it gives the following results: > gcd(3,2) [1] 1
2013 Feb 19
4
[LLVMdev] Pointer Context Metadata (was: Parallel Loop Metadata)
----- Original Message ----- > From: "Pekka Jääskeläinen" <pekka.jaaskelainen at tut.fi> > To: "Nadav Rotem" <nrotem at apple.com> > Cc: "Hal Finkel" <hfinkel at anl.gov>, "Tobias Grosser" <tobias at grosser.es>, "llvmdev at cs.uiuc.edu Dev" > <llvmdev at cs.uiuc.edu> > Sent: Tuesday, February 19, 2013
2000 Jan 10
1
'at' parameter in mtext(.., adj=0, outer=T) (PR#396)
Depending on the setting of par()$usr, the 'at' setting in mtext(.., adj=0, outer=T) may cause the text to appear in an anomalous position (e. g. in the first instance below, at the left of the plot region rather than at 'at=0' in the figure region), or the text may not appear at all. If one does not set the 'at' parameter the text appears (with 'adj=0') on the
1999 Nov 23
1
"outer" argument in mtext (PR#340)
mtext(..., outer = TRUE) does not seem to center the text in the outer margins as it did previously. Reproduce with example(plot.profile.nls, package = "nls") On versions of the development sources before November 17 this produced main and subtitles that were centered horizontally on the page. After that the main title (from mtext("..", side = 3, outer = TRUE)) is centered
2001 Sep 23
1
outer
i cannot cajole outer in doing what i want it to do. i hav a function only defined for scalars fun(n,k) and i want to do outer(1:5,1:5,function(x,y) fun(x,y)) (i know this is written somewhat clumsy) to get an array with the values of fun to use it as an input for image this does not work since outer assumes then fun works on arrays elementwise. what is the easiest way of getting what i
2010 Jan 08
1
Using outer with function predict
Hey everybody, I have a problem with the combination of the commands outer() and predict(). I want to visualize the solutions of a regression modell in a matrix. Therefore I want to use the command predict for a linear modell as the function inside the command outer. I've made a small example: x = 1:10 y = 11:20 z = rnorm(10) lm.1 = lm(z ~ x*y)