i'm in the midst of using R for a PVA/matrix project. my math skills are lousy and programming skills are worse. to deal with an error that i couldn't solve, i changed a parameter that used a new part of a routine in our PVA package's code: else if (ES == "ParDraw") { require(MASS) (previously, ES was "MatrixDraw" and MASS wasn't called for) now, i get the following error: Error in apply(parmat, 1, mean) : dim(X) must have a positive length there is no code in the PVA package routines that has a line that says "apply(parmat, 1, mean)" or parmat or the format "(____, 1, mean)". that's why i think the error has something to do with MASS. i tried to update MASS, but had problems with that. i've searched for parmat. i looked through the MASS documentation for parmat. i don't know what it is or how to change whatever is affecting parmat. i'm using RGui from version 2.6.0 on an XP machine. sincerely, john
Prof Brian Ripley
2008-Mar-11 07:18 UTC
[R] Your unfair assignment of blame (was parmat error from MASS?)
There is no such code in MASS, so please don't make random assignments of blame. A competent R author would have used rowMeans(parmat). R has debugging tools (see 'Writing R Extensions') and you should use them to locate in which function the error is occurring. E.g. traceback() would tell you. Even then, the error is almost certainly in the data passed to the function and not in the function itself. We don't know what the PVA package/project is, or who 'our' refers to -- despite the posting guide you have not given a signature block. On Mon, 10 Mar 2008, john polo wrote:> i'm in the midst of using R for a PVA/matrix project. my math skills are > lousy and programming skills are worse. to deal with an error that i > couldn't solve, i changed a parameter that used a new part of a routine > in our PVA package's code: > > else if (ES == "ParDraw") { > > require(MASS) > > > (previously, ES was "MatrixDraw" and MASS wasn't called for) > now, i get the following error: > > Error in apply(parmat, 1, mean) : dim(X) must have a positive length > > > there is no code in the PVA package routines that has a line that says > "apply(parmat, 1, mean)" or parmat or the format "(____, 1, mean)". > that's why i think the error has something to do with MASS. i tried to > update MASS, but had problems with that. i've searched for parmat. i > looked through the MASS documentation for parmat. i don't know what it > is or how to change whatever is affecting parmat. > > i'm using RGui from version 2.6.0 on an XP machine. > > sincerely, > john > > ______________________________________________ > 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. >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Rerun your code and as soon as the error occurs type:> traceback()This will show more information on where the error is actually occuring. If this does not clear it up for you, then send more of an example of what you are doing along with the output of traceback (see the link at the bottom of all r-help messages for more information on heow to get good answers from the group) and we may be better able to help. ________________________________ From: r-help-bounces@r-project.org on behalf of john polo Sent: Mon 3/10/2008 5:25 PM To: r-help@r-project.org Subject: [R] parmat error from MASS? i'm in the midst of using R for a PVA/matrix project. my math skills are lousy and programming skills are worse. to deal with an error that i couldn't solve, i changed a parameter that used a new part of a routine in our PVA package's code: else if (ES == "ParDraw") { require(MASS) (previously, ES was "MatrixDraw" and MASS wasn't called for) now, i get the following error: Error in apply(parmat, 1, mean) : dim(X) must have a positive length there is no code in the PVA package routines that has a line that says "apply(parmat, 1, mean)" or parmat or the format "(____, 1, mean)". that's why i think the error has something to do with MASS. i tried to update MASS, but had problems with that. i've searched for parmat. i looked through the MASS documentation for parmat. i don't know what it is or how to change whatever is affecting parmat. i'm using RGui from version 2.6.0 on an XP machine. sincerely, john ______________________________________________ R-help@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. [[alternative HTML version deleted]]