similar to: Vector multiplication

Displaying 20 results from an estimated 50000 matches similar to: "Vector multiplication"

2010 Mar 17
3
Vector multiplication
Hi, this may sound stupid (and it probably is), but I can't seem to find out how to multiply each element of a vector with each element of another vector where the result would be a matrix of dim[length(vectorOne),length(vectorTwo)] without using loops. example: if a -> c(1,2,3) b -> c(4,5,6) i'm looking for the operation that would yield: [,1] [,2] [,3] [1,] 4 8
2008 Sep 11
4
All possible pairs of two variables
I have two variables (x,y) : x : it takes all integer values from 0 to y and, y : takes all values from 0, 10 I am looking for some R code to find all possible pairs of (x,y). Can anyone please help me? New Email addresses available on Yahoo! Get the Email name you've always wanted on the new @ymail and @rocketmail. Hurry before someone else does! [[alternative HTML version
2010 Aug 01
3
Meaning of following function
Hi friends, I am aware of the function "-"() which acts as minus in ordinary computations. For example:   > "-"(3, 1) [1] 2 However what is the meaning of > "-"(3) [1] -3 I was expecting R to generate some error as it does for "*"(3). What is the logic for that calculation?   Thanks, [[alternative HTML version deleted]]
2017 Jun 08
5
Matrix multiplication
I need to have all elements of a matrix multiplied by a weight before being post-multiplied by itself, as shown in the forst block of codes below. I can also multiply the matrix by the square root of the weight and then take the outer product. Actually, what I need is this. Denote each row of the matrix by a row vector as xi and each element of the weighting vector as wi. Then, I need the
2017 Jun 08
1
Matrix multiplication
OK Thanks. Your response made me think. Here (the last line) is what I need: set.seed(76543211) w<-1:10; w a<-matrix(rpois(20,2),nrow=10); a t(w*a)%*%a On 6/8/2017 12:09 PM, Jeff Newmiller wrote: > Is this a question? You seem to have three possible calculations, have already implemented two of them (?) and it is unclear (to me) what you think the right answer for any of them is
2017 Jun 08
0
Matrix multiplication
Is this a question? You seem to have three possible calculations, have already implemented two of them (?) and it is unclear (to me) what you think the right answer for any of them is supposed to be. -- Sent from my phone. Please excuse my brevity. On June 7, 2017 8:50:55 PM PDT, Steven Yen <syen04 at gmail.com> wrote: >I need to have all elements of a matrix multiplied by a weight
2002 Apr 18
2
Data.Frame Multiplication
Have got any R-proffessional a starting point for me how i can write me a function which multiply every column with every other column in the data.frame - indenpendent from the dim's . Thanks in advance regards,Christian -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send
2010 Dec 22
3
A question to get all possible combinations
Let say, I have a matrix with 8 rows and 6 columns:  >  df1  <- matrix(NA, 8, 4)  > df1       [,1] [,2] [,3] [,4]  [1,]   NA   NA   NA   NA  [2,]   NA   NA   NA   NA  [3,]   NA   NA   NA   NA  [4,]   NA   NA   NA   NA  [5,]   NA   NA   NA   NA  [6,]   NA   NA   NA   NA  [7,]   NA   NA   NA   NA  [8,]   NA   NA   NA   NA  Now I want to get **all possible** ways to fetch 6 cells at a
2011 Feb 06
2
Multiplying elements of vectors
Hi guys: Sorry if this question is very basic. I?m learning basic matrix and vectors multiplication to develop a population matrix model for plants. I?m trying to multiply the elements of two vectors (each of the ?x? values by each of the ?y? values) to obtain a square matrix of xy values. f.e. x<-seq(5,205) y<-seq(5,20,5) stages<-c(?Sdl?, ?Juv?, ?Ad1?, ?Ad2?) If I just multiply xy as
2007 Apr 18
5
Problem with ?curve
Dear all R gurus, I have following syntax: y = c(1:10) chippy <- function(x) { y[5] = x sin(cos(t(y)%*%y)*exp(-t(y)%*%y/2)) } curve(chippy, 1, 20, n=200) But I am getting error while executing : Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ In addition: Warning message: number of items to
2010 Sep 15
3
Keyword to clear the screen
Hi all, can anyone please tell me what is the key-word to clear the screen? I am aware of the "cont+L", however I need some R-syntax, that can be typed into the console to clear the screen.   Thanks [[alternative HTML version deleted]]
2005 Mar 28
2
Generating list of vector coordinates
Hi. Can anyone suggest a simple way to obtain in R a list of vector coordinates of the following form? The code below is Mathematica. In[5]:= Flatten[Table[{i,j,k},{i,3},{j,4},{k,5}], 2] Out[5]= {{1,1,1},{1,1,2},{1,1,3},{1,1,4},{1,1,5},{1,2,1},{1,2,2},{1,2,3},{1 ,2,4},{1,2, 5},{1,3,1},{1,3,2},{1,3,3},{1,3,4},{1,3,5},{1,4,1},{1,4,2},{1,4,3}, {1,4,
2012 Dec 26
3
Working with date
Hi, Let say I have a date variable: > ?asd <- as.Date("2012-01-03") > asd [1] "2012-01-03" Now, I want to express this date like 3/1/2012. can somebody help me how to achieve that? Thanks,
2011 Jun 06
2
A Calculation on list object
Hello, I am into some calculation on a list object, therefore requesting the peers if there is any short cut way to so the same calculation. Let say I have following list object: > List <- vector('list', length = 3) > set.seed(1) > List[[1]] <- rnorm(5) > List[[2]] <- rnorm(2) > List[[3]] <- rnorm(7) > List [[1]] [1] -0.6264538 0.1836433 -0.8356286
2010 Aug 20
2
Determining the length of unique items in a vector
Dear all, let suppose I have following vector:   > dat1 <- c(rep("asd", 5), rep("xyz", 12), rep("erd", 17)) > dat1 <- dat1[sample(1:length(dat1), length(dat1), replace=F)] > dat1  [1] "erd" "xyz" "erd" "asd" "asd" "erd" "xyz" "asd" "erd" "erd"
2009 Nov 21
4
title problem
Hi, I got problem in using title function to create a title for multiple plots presented together by par. As can be seen in the attached file, the title is displayed truncated and the subtitle doesn't get displayed. Here is the code: par(mfrow = c(1,2)) plot(c(1,2,3), c(9,8,7)) plot(c(1,2,3), c(9,8,7)) title(main = "Main title", sub ="Sub title",outer = TRUE,
2009 Nov 21
2
Fw: Re: title problem
It seems that there is a problem in displaying subtitle in general, independently from multi-plot display. when I do plot (c(1,2,3), c(9,8,7), type = "l") title(main = "Main title", sub ="Sub title",cex.main=2, cex.sub = 2) subtitle doesn't get displayed > --- On Sat, 11/21/09, David Winsemius <dwinsemius at comcast.net> > wrote: >
2019 Feb 01
2
[RFC] Vector Predication
--- crowd-funded eco-conscious hardware: https://www.crowdsupply.com/eoma68 On Thu, Jan 31, 2019 at 10:22 PM Jacob Lifshay <programmerjake at gmail.com> wrote: > > We're in-progress designing a RISC-V extension (http://lists.libre-riscv.org/pipermail/libre-riscv-dev/2019-January/000433.html) that would have variable-length vectors of short vectors (1 to 4): > <VL x <4 x
2008 Jan 16
4
Different results in calculating SD of 2 numbers
Hi all, Can anyone tell me why I am getting different results in calculating SD of 2 numbers ? > (1.25-0.95)/2 [1] 0.15 > sd(c(1.25, 0.95)) [1] 0.2121320 # why it is different from 0.15? Regards, Send instant messages to your online friends http://uk.messenger.yahoo.com [[alternative HTML version deleted]]
2007 May 07
3
like apply(x,1,sum), but using multiplication?
Hi, I need to multiply all columns in a matrix so something like apply(x,2,sum), but using multiplication should do. I have tried apply(x,2,"*") I know this must be trivial, but I get: Error in FUN(newX[, i], ...) : invalid unary operator The help for apply states that unary operators must be quoted. I tried single quotes too, with the same results. Thanks, -Jose -- Jose