# plotGraphs: Plots the ACC vs LOI graph and the LMA graph In ACCLMA: ACC & LMA Graph Plotting

## Description

This function receives a matrix containing the X,Y,Weight,FX,FY,LOI,LMA columns after the calcWeights and the reduceSameXs function has been used on it and plots the appropriate ACC vs LOI graph and the LMA graph, each in a seperate window

## Usage

 `1` ```plotGraphs(mat) ```

## Arguments

 `mat` A matrix containing the X,Y,Weight,FX,FY,LOI,LMA columns after the calcWeights and the reduceSameXs function has been used on it

none

## Author(s)

Tal Carmi, Liat Gaziel

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46``` ```d <- c(1,1,3,4) e <- c(5,6,7,8) f <- c(1,1,1,1) mydata <- data.frame(d,e,f) names(mydata) <- c("X","Y","Weight") mydata<-calcWeights(mydata) mydata<-averageSameXs(mydata) mydata<-calcFX(mydata) mydata<-calcFY(mydata) mydata<-calcLOI(mydata) mydata<-calcLMA(mydata) plotGraphs(mydata) ## The function is currently defined as function (mat) { mat[size(mat) + 1, 4] = 0 mat[size(mat) + 1, 5] = 0 mat[size(mat) + 1, 6] = 0 mat[size(mat) + 1, 7] = 0 mat <- mat[order(mat[4]), ] trans <- t(mat) originalPar <- par(no.readonly = TRUE) par(lwd = 2) par(col = "black") plot(trans[4, ], trans[5, ], type = "n", main = "ACC", xlab = "F(x)", ylab = "Accumulating Y Mean") par(col = "blue") lines(trans[4, ], trans[5, ], type = "l") par(col = "red") lines(trans[4, ], trans[6, ], type = "l") legend("bottomright", c("ACC", "LOE"), col = c("blue", "red"), lwd = 2, bty = "n", text.col = "black") par(originalPar) windows() par(lwd = 2) par(col = "black") par(xaxs = "i") plot(trans[4, ], trans[7, ], type = "n", main = "LMA", xlab = "F(x)", ylab = "LOE minus ACC") par(col = "black", lwd = 1) lines(c(0, 1), c(0, 0), type = "l") par(col = "blue", lwd = 2) lines(trans[4, ], trans[7, ], type = "l") par(originalPar) } ```

### Example output

```function (mat)
{
mat[size(mat) + 1, 4] = 0
mat[size(mat) + 1, 5] = 0
mat[size(mat) + 1, 6] = 0
mat[size(mat) + 1, 7] = 0
mat <- mat[order(mat[4]), ]
trans <- t(mat)
par(lwd = 2)
par(col = "black")
plot(trans[4, ], trans[5, ], type = "n", main = "ACC", xlab = "F(x)",
ylab = "Accumulating Y Mean")
par(col = "blue")
lines(trans[4, ], trans[5, ], type = "l")
par(col = "red")
lines(trans[4, ], trans[6, ], type = "l")
legend("bottomright", c("ACC", "LOE"), col = c("blue", "red"),
lwd = 2, bty = "n", text.col = "black")
par(originalPar)
windows()
par(lwd = 2)
par(col = "black")
par(xaxs = "i")
plot(trans[4, ], trans[7, ], type = "n", main = "LMA", xlab = "F(x)",
ylab = "LOE minus ACC")
par(col = "black", lwd = 1)
lines(c(0, 1), c(0, 0), type = "l")
par(col = "blue", lwd = 2)
lines(trans[4, ], trans[7, ], type = "l")
par(originalPar)
}
```

ACCLMA documentation built on May 2, 2019, 8:49 a.m.