Skip to content

Instantly share code, notes, and snippets.

@gufodotto
Created July 8, 2012 08:02
Show Gist options
  • Save gufodotto/3069888 to your computer and use it in GitHub Desktop.
Save gufodotto/3069888 to your computer and use it in GitHub Desktop.
require(reshape)
# select only the columns relative to parameter on/off, and the collinearity value
Coll_m<-melt(t(Coll[,c(1:length(guess_pars),ncol(Coll))]));
# split them in two different frames for easier handling
Coll_f<-Coll_m[Coll_m$X1=='collinearity',];
Coll_m<-Coll_m[Coll_m$X1!='collinearity',];
# add a categorical label
Coll_f$label[Coll_f$value<20]<- sprintf("%3.2g", Coll_f$value[Coll_f$value<20]); Coll_f$label[Coll_f$value>=20] <- ">= 20"; Coll_f$label[Coll_f$value>=100] <- "> 100";
Coll_f$flag<-'ID OK'; Coll_f$flag[Coll_f$value>=20] <- "ID KO";
Coll_f$flag <- factor(Coll_f$flag, levels=c('ID OK', 'ID KO'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment