[R] Error during matrix multiplication

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Thu Sep 13 07:37:58 CEST 2012


You need to learn to use the str() function to debug these kinds of problems. And you need to learn to provide data with your code (perhaps with the dput function) so others can reproduce your problem if you want help.

I would guess that you have non-numeric data in your files.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

"s.s.m. fauzi" <ssmfone at gmail.com> wrote:

>Hi,
>I have two matrix from two different .csv files.
>
>#load .csv files
>a <- as.matrix(read.table("Whirr_127.csv", header=T, sep=",",
>row.names=1))
>b <- as.matrix(read.table("Files_Whirr_127.csv", header=T, sep=",",
>row.names=1))
>a
>b
>
>I managed to do transpose to 'b' without any error.
>
>transpose_task <- t(b)
>transpose_task
>
>But, when I tried to do multiplication (a%*%transpose_task), an error
>occured.
>
>td <- (a%*%transpose_task)
>td
>
>Here is the error:
>ERROR:  requires numeric/complex matrix/vector arguments
>ERROR:  object 'td' not found
>
>Anybody can help me to solve this?
>
>Thank you
>
>	[[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.




More information about the R-help mailing list