FLR

Tasklist |

FS#17 - Two sets of code for plot(FLIndex)

Attached to Project: FLR
Opened by Mark Payne (mpayne) - Thursday, 02 April 2009, 12:02 GMT+2
Last edited by Iago Mosqueira (imosqueira) - Sunday, 05 April 2009, 14:00 GMT+2
Task Type Bug Report
Package FLCore
Status New
Assigned To No-one
Operating System Linux
Severity Low
Priority Normal
Reported Version 2.0
Due in Version Undecided
Due Date Undecided
Percent Complete 50%
Votes 0
Private No

Details

While its not strictly a bug, I note that there are two sets of code for the plot() method for an FLIndex object in FLIndex.r.

The first instance is on line 242...

## plot::FLIndex {{{
setMethod("plot", signature(x="FLIndex",y="missing"),
function(x, type=c("splom"), ...) {

plotinternal <- function(x, ... ) {
pfun <- function(x,y,...){
panel.xyplot(x,y, ...)
if (length(x) > 1) panel.lmline(x,y, lty=1)
}

The second on line 379...

# plot (FLIndex) {{{
# Author: Mark Payne, DIFRES
setMethod("plot", signature(x="FLIndex",y="missing"),
function(x, type=c("splom"), ...)
{
# The body of the plot method
validObject(x)
type <- type[1]

res <- switch(type,
"splom" = plotinternal(x=x, ... ),
"ts" = plotts(x=x, ... ),
"pairwise"=pairwiseConsistency(idx=x,...),
"internal"=plotInternalConsistency(idx=x,...),
cat("type must be 'splom', 'ts', 'pairwise' or 'internal'!\n"))
# Return result invisibly
invisible(res)
}
) # }}}

The first instance is probably overriden by the second, and therefore is probably redundant (???).

The structuring (and documentation) of these plotting functions could also probably be improved.
This task depends upon

Comment by Iago Mosqueira (imosqueira) - Sunday, 05 April 2009, 14:00 GMT+2
Extra code already non-functional has been removed. Now the issue is to decide if current plot needs any work. I like it in general, and feel the complexity of the class deserves having a plot four possible choices

Loading...