R/rstudent.loopsummarylist.R

Defines functions rstudent.loopsummarylist2r rstudent.loopsummarylist

Documented in rstudent.loopsummarylist rstudent.loopsummarylist2r

rstudent.loopsummarylist <- function(model,...){
  g <- model
  thenames <- g$Boot.Estimates[,1:(which(colnames(g$Boot.Estimates)=="n")-1)]
  thelengths <- lapply(g$models, function(x) length(x$pred.x))
  rowvec <- mapply(function(x,y) rep(x,each=y),1:length(thelengths),y=thelengths)
  thenames <- thenames[rowvec,]
  
  thefittedx<-lapply(g$models,function (x) rstudent.loopsummary(x)[,"input"])
  thefittedx <- unlist(thefittedx)
  thefittedy<-lapply(g$models,function (x) rstudent.loopsummary(x)[,"output"])
  thefittedy <- unlist(thefittedy)
  data.frame(thenames,"input"=thefittedx,"output"=thefittedy)
}

rstudent.loopsummarylist2r <- function(model,...){
  g <- model
  thenames <- g$Boot.Estimates[,1:(which(colnames(g$Boot.Estimates)=="n")-1)]
  thelengths <- lapply(g$models, function(x) length(x$pred.x))
  rowvec <- mapply(function(x,y) rep(x,each=y),1:length(thelengths),y=thelengths)
  thenames <- thenames[rowvec,]
  
  thefittedx<-lapply(g$models,function (x) rstudent.loop2rsummary(x)[,"input"])
  thefittedx <- unlist(thefittedx)
  thefittedy<-lapply(g$models,function (x) rstudent.loop2rsummary(x)[,"output"])
  thefittedy <- unlist(thefittedy)
  data.frame(thenames,"input"=thefittedx,"output"=thefittedy)
}

Try the hysteresis package in your browser

Any scripts or data that you put into this service are public.

hysteresis documentation built on May 15, 2021, 1:09 a.m.