you should first transform them to matrices using data.matrix() and then
do a matrix multiplication using %*%.
This will create a matrix, which you can then convert to a data frame,
if you want, using as.data.frame(). For instance, check the following:
d1 <- data.frame(x = rnorm(10), y = rnorm(10))
d2 <- data.frame(x = rnorm(10), y = rnorm(10))
res <- data.matrix(d1) %*% t(data.matrix(d2))
res
as.data.frame(res)
I hope it helps.
Best,
Dimitris
glenn wrote:> If I have 2 data frames;
> df1: dim(df1) = (1,10)
> df2: dim(df2) = (2000,10)
>
> Both with column header names, how do I multiply them together please. I.e
> create a dateframe dim() = (2000,1)
>
> Many Thanks in advance
>
> Glenn
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Dimitris Rizopoulos
Assistant Professor
Department of Biostatistics
Erasmus Medical Center
Address: PO Box 2040, 3000 CA Rotterdam, the Netherlands
Tel: +31/(0)10/7043478
Fax: +31/(0)10/7043014