similar to: [R] unvectorized option for outer()

Displaying 20 results from an estimated 1000 matches similar to: "[R] unvectorized option for outer()"

2005 Oct 27
3
outer-question
Dear all, This is a rather lengthy message, but I don't know what I made wrong in my real example since the simple code works. I have two variables a, b and a function f for which I would like to calculate all possible combinations of the values of a and b. If f is multiplication, I would simply do: a <- 1:5 b <- 1:5 outer(a,b) ## A bit more complicated is this: f <-
2005 Oct 27
3
outer-question
Dear all, This is a rather lengthy message, but I don't know what I made wrong in my real example since the simple code works. I have two variables a, b and a function f for which I would like to calculate all possible combinations of the values of a and b. If f is multiplication, I would simply do: a <- 1:5 b <- 1:5 outer(a,b) ## A bit more complicated is this: f <-
2004 Feb 27
1
Outer with Three Vectors
Hello, outer() is great for avoiding things like: for (val1 in val1s) { for (val2 in val2s)) { x[i,j] <- somefunction(val1, val2) } } The same can be obtained with: outer(val1s, val2s, somefunction) But what if there are three (or more) sets of values to loop over? Any way of avoiding the loops then? Thanks, -- Wolfgang Viechtbauer
2001 Mar 21
0
Suggest new outer for R-1.3
Hi everyone, Can I suggest the following modification of outer for R-1.3, in the interests of speed and size of calculation: ******************************************************************* "outer" <- function (X, Y, FUN = "*", ...) { no.nx <- is.null(nx <- dimnames(X <- as.array(X))) dX <- dim(X) no.ny <- is.null(ny <- dimnames(Y <-
2017 Mar 20
0
outer not applying a constant function
>>>>> Gebhardt, Albrecht <Albrecht.Gebhardt at aau.at> >>>>> on Sun, 19 Mar 2017 09:14:56 +0000 writes: > 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
2005 Sep 20
1
Xgird, R, parallel computing
Hi, list, Sorry if I am bothering you. I am interested in using xgrid with R for distributed computing. I am using MacOS X and my R 2.1. 1 is already installed and running. The client computers are all of the same type and the same version of R has been installed on them. We have also set up xgrid on my system and client computers as well. I am wondering if any one can give me some clues
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]
2020 Oct 27
3
R for-loop to add layer to lattice plot
Hello, I am using e1071 to run support vector machine. I would like to plot the data with lattice and specifically show the hyperplanes created by the system. I can store the hyperplane as a contour in an object, and I can plot one object at a time. Since there will be thousands of elements to plot, I can't manually add them one by one to the plot, so I tried to loop into them, but only the
2008 Oct 08
5
ParallelR
Anyone using or has access to ParallelR? I was looking at the page and found nothing really useful! http://www.revolution-computing.com/sitegenius/topic.php?id=195 I want to see if I can run R on a cluster of workstation, and use batch systems like Grid Engine or Xgrid: http://gridengine.sunsource.net/ http://ww.apple.com/acg/xgrid/ --Chi
2020 Oct 28
0
R for-loop to add layer to lattice plot
On Tue, Oct 27, 2020 at 6:04 PM Luigi Marongiu <marongiu.luigi at gmail.com> wrote: > > Hello, > I am using e1071 to run support vector machine. I would like to plot > the data with lattice and specifically show the hyperplanes created by > the system. > I can store the hyperplane as a contour in an object, and I can plot > one object at a time. Since there will be
2011 Jun 13
4
How to calculate the product of every two elements in two lists?
u<-c(0.1,0.2,0.3) v<-c(0.2,0.3,0.5) outer1<-outer(u,u,">=") outer2<-outer(v,v,">=") m<-nrow(outer1) j<-nrow(outer2) zz<-lapply(1:m, function(m) as.numeric(outer1[m,])) tt<-lapply(1:m, function(m) as.numeric(outer2[m,])) zz[[1]]*tt[[3]], e.g., is possible, but I want every products between two lists. Is there a way to do that? -- View this
2015 Mar 03
2
Asssistance
Hi to All, I am building a package in R and whenever I run command "R CMD build OAR" in the terminal, I get the following error: * checking for file ?OAR/DESCRIPTION? ... OK * preparing ?OAR?: * checking DESCRIPTION meta-information ... ERROR Malformed Depends or Suggests or Imports or Enhances field. Offending entries: R (>=3.0.2) Entries must be names of packages optionally
2010 Mar 02
1
Output to sequentially numbered files... also, ideas for running R on Xgrid
Hello, I have some code to run on an XGrid cluster. Currently the code is written as a single, large job... this is no good for trying to run in parallel. To break it up I have basically taken out the highest level for-loop and am planning on batch-running many jobs, each one representing an instance of the removed loop. However, when it comes to output I am stuck. Previously the output was
2007 Mar 05
1
error message when using outer function
Dear R-users, I have two sets of code that appear to me to be equivalent, shown below, and yet I get the error message "Error in dim(robj) <- c(dX, dY) : dim<- : dims [product 4] do not match the length of object [1]" after executing the assignment to logdens2. Both functions post.a1 and post.a2 return the same values when run alone and not embedded in the function outer. I
2008 Feb 26
2
Multiple lines with a different color assigned to each line (corrected code)
Sorry, I just realized I didn't type in the correct names of the variables I am working with, this is how it should be: plot(1,1,type="n") for (i in summ$tx) { points(summ$timep[summ$tx==i],summ$mn[summ$tx==i]) lines(summ$timep[summ$tx==i],summ$mn[summ$tx==i]) } Thank you, Judith ____________________________________________________________________________________
2000 Mar 16
0
Compilation and solving problem on mips-sony-bsd.
Hello, I'm trying samba-2.0.6 on my Sony NEWS-OS 4.2.1aRD which is based on 4.3BSD, having trouble with compilation. Also I have question and want be helped to solve the problem. Yes, I can compile it with dirty hack which is found at ftp://ftp.tutrp.tut.ac.jp/pub/sony-news/samba/samba-news4.diff There are some problems about this old and specific system. 1. It does not have setvbuf(). 2.
2009 Nov 22
2
scatter plot & equation
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091122/ca17457e/attachment-0001.pl>
2014 May 14
0
[RFC PATCH v1 14/16] drm/radeon: use rcu waits in some ioctls
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com> --- drivers/gpu/drm/radeon/radeon_gem.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index d09650c1d720..7ba883843668 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++
2009 Mar 25
0
Rmpi - send/receive multiple objects to slaves
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've written a function that uses Rmpi to perform a calculation in parallel. It works fine, but I'm trying to improve efficiency in terms of memory usage and the amount of data being passed back and forth between mater and slaves. Calculations are performed on a symmetrical matrix in order to zero-out some of the cells. In the parallel
2000 Sep 28
1
[PATCH] Next cleanup part 4 or 5 by now.=)
Changes: * Removed utimes() posix hack since scp.c moved to utimes() * Fixed waitpid() to be more proper. It was driving me nuts. * Made setsid() a #define in next-posix.h * Removed WCOREDUMP() from next-posix.h since we really don't support it and now #ifdef .. #else .. #endif around the single place it was used. * Fixed typecasting issue in sshd.c with sizeof() returning "long