<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Dear Maria Paula,<br>
<br>
you are right that it is not yet possible to indicate whether a
legend needs to be plotted when running survModelComp and
growthModelComp. This functionality will be included in the next
version of IPMpack. If you can't wait: I've copied the new functions
at the bottom of this email.<br>
<br>
best wishes,<br>
Eelke<br>
<br>
<blockquote
cite="mid:1364991282.5404.YahooMailNeo@web161706.mail.bf1.yahoo.com"
type="cite">
<div><br>
</div>
<div style="font-family: 'lucida console', sans-serif; font-size:
12pt;">
<div style="font-family: 'times new roman', 'new york', times,
serif; font-size: 12pt;">
<div dir="ltr"> <font size="2" face="Arial"> ----- Mensaje
reenviado -----</font><br>
</div>
</div>
</div>
</blockquote>
<br>
<blockquote
cite="mid:1364991282.5404.YahooMailNeo@web161706.mail.bf1.yahoo.com"
type="cite">
<div style="font-family: 'lucida console', sans-serif; font-size:
12pt;">
<div style="font-family: 'times new roman', 'new york', times,
serif; font-size: 12pt;">Dear IPMpack team,
<div id="yiv820262508">
<div>
<div style="color: rgb(0, 0, 0); background-color:
rgb(255, 255, 255); font-family: 'times new roman', 'new
york', times, serif; font-size: 12pt;">
<div>
<div class="yiv820262508MsoNormal"> </div>
<div class="yiv820262508MsoNormal">First at all it is
a fantastic pack, congratulations.</div>
<div class="yiv820262508MsoNormal"> </div>
<div class="yiv820262508MsoNormal">Using the IPMpack,
I found two errors:</div>
<div class="yiv820262508MsoListParagraphCxSpFirst"
style="">1.<span style="font-size: 7pt; font-family:
'Times New Roman';">
</span>When I want to graph the <b><i>Survival and
Growth models</i></b>
using survModelComp and growthModelComp, I chose <b>legendPos
= FALS, but I still get the legend in the corner:
see figures</b></div>
<div class="yiv820262508MsoListParagraphCxSpMiddle">resultsurv
<- survModelComp(dataf = Sp,
expVars = c(surv~1, surv~size, surv~size +size2, </div>
<div class="yiv820262508MsoListParagraphCxSpMiddle">
surv~size
+size2+size3), </div>
<div class="yiv820262508MsoListParagraphCxSpMiddle">
testType=
"AIC", makePlot = TRUE, <b>legendPos = FALSE</b>,
</div>
<div class="yiv820262508MsoListParagraphCxSpLast">
ncuts= 100,
mainTitle = "Survival")</div>
<div class="yiv820262508MsoNormal"> </div>
<br>
<div class="yiv820262508MsoNormal"> </div>
<div class="yiv820262508MsoListParagraphCxSpFirst"
style="">2.<span style="font-size: 7pt; font-family:
'Times New Roman';"> ....<br>
</span></div>
<div class="yiv820262508MsoListParagraphCxSpMiddle"> </div>
<div class="yiv820262508MsoListParagraphCxSpMiddle"> </div>
<div class="yiv820262508MsoListParagraphCxSpMiddle">Thank
for your help.</div>
<div class="yiv820262508MsoListParagraphCxSpMiddle"> </div>
<div class="yiv820262508MsoListParagraphCxSpLast">Maria
Paula</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
<br>
<br>
growthModelComp <- function(dataf, <br>
expVars = c(sizeNext~1, sizeNext~size, sizeNext~size +
size2), <br>
regressionType = "constantVar",<br>
testType = "AIC",<br>
makePlot = FALSE,<br>
mainTitle = "",<br>
plotLegend = TRUE,<br>
legendPos = "topright", ...) {<br>
varN <- length(expVars)<br>
typeN <- length(regressionType)<br>
treatN <- varN * typeN<br>
summaryTable <- data.frame()<br>
grObj <- vector("list", length = treatN)<br>
i <- 1<br>
for(v in 1:varN) {<br>
for(t in 1:typeN) {<br>
grObj[[i]] <- makeGrowthObj(dataf = dataf, regType =
regressionType[t], Formula = expVars[[v]]) <br>
if
(length(grep("decline",tolower(as.character(class(grObj[[i]])))))>0)
{ <br>
summaryTable <- rbind(summaryTable,
cbind(as.character(unlist(expVars))[v], regressionType[t],
match.fun(testType)(grObj[[i]]@fit$fit)))<br>
} else { <br>
summaryTable <- rbind(summaryTable,
cbind(as.character(unlist(expVars))[v], regressionType[t],
match.fun(testType)(grObj[[i]]@fit)))<br>
} <br>
i <- i + 1<br>
}<br>
}<br>
summaryTable <- as.data.frame(summaryTable)<br>
names(summaryTable) <- c("Exp. Vars", "Reg. Type", testType)<br>
outputList <- list(summaryTable = summaryTable, growthObjects
= grObj)<br>
<br>
# PLOT SECTION #<br>
if(makePlot == TRUE) {<br>
plotGrowthModelComp(grObj = grObj, summaryTable =
summaryTable, dataf = dataf, expVars = expVars, testType = "AIC",
plotLegend = plotLegend, mainTitle = mainTitle, legendPos, ...)<br>
}<br>
return(outputList)<br>
}<br>
<br>
<br>
survModelComp <- function(dataf, <br>
expVars = c(surv~1, surv~size, surv~size + size2), <br>
testType = "AIC",<br>
makePlot = FALSE,<br>
mainTitle = "", ncuts = 20,<br>
plotLegend = TRUE, <br>
legendPos = "bottomleft", ...) {<br>
varN <- length(expVars)<br>
treatN <- varN<br>
summaryTable <- data.frame()<br>
svObj <- vector("list", length = treatN)<br>
i <- 1<br>
for(v in 1:varN) {<br>
svObj[[i]] <- makeSurvObj(dataf = dataf, Formula =
expVars[[v]]) <br>
summaryTable <- rbind(summaryTable,
cbind(as.character(unlist(expVars))[v],
match.fun(testType)(svObj[[i]]@fit)))<br>
i <- i + 1<br>
}<br>
summaryTable <- as.data.frame(summaryTable)<br>
names(summaryTable) <- c("Exp. Vars", testType)<br>
outputList <- list(summaryTable = summaryTable, survObjects =
svObj)<br>
<br>
# PLOT SECTION #<br>
if(makePlot == TRUE) {<br>
## this is the surv picture <br>
plotSurvModelComp(svObj = svObj, summaryTable =
summaryTable, dataf = dataf, expVars = expVars, testType = "AIC",
plotLegend = plotLegend, mainTitle = mainTitle, ncuts = ncuts,
legendPos = legendPos, ...)<br>
}<br>
return(outputList)<br>
} <br>
<br>
</body>
</html>