TABLE OF CONTENTS


CcurveUpdate/PopulateLocalHistory [ Functions ]

NAME

    PopulateLocalHistory --- populate a local CHistory curve

FUNCTION

Given an RHistory, populate a CHistory structure with pointers to the memory allocated by R.

SYNOPSIS

916 void PopulateLocalHistory( historyP theHist, SEXP Rhistory)

INPUTS

OUTPUTS

SOURCE

920 {
921     SEXP elmt;
922     // frailties
923     elmt = getListElement(Rhistory, "frailty");
924     theHist->ny = INTEGER(getAttrib(elmt, R_DimSymbol))[0];
925     theHist->frailty = REAL(elmt);
926     // regression coefficients
927     theHist->coefficients = REAL(getListElement(Rhistory, "coefficients"));
928     // Only populate history components if there is a spline/parametric component
929     // hazard spline
930     elmt = getListElement(Rhistory, "hazard.spline.par");
931     if(elmt != R_NilValue ) theHist->HazardSplinePar = REAL(elmt);
932     elmt = getListElement(Rhistory, "hazard.spline.knots");
933     if(elmt != R_NilValue ) theHist->HazardSplineKnots = REAL(elmt);
934     // hazard parametric
935     elmt = getListElement(Rhistory, "hazard.param.par");
936     if(elmt != R_NilValue ) theHist->HazardParamPar = REAL(elmt);
937     // hazard weight
938     elmt = getListElement(Rhistory, "hazard.weight");
939     if(elmt != R_NilValue ) theHist->HazardWeight = REAL(elmt);
940     // frailty spline
941     elmt = getListElement(Rhistory, "frailty.spline.par");
942     if(elmt != R_NilValue ) theHist->FrailtySplinePar = REAL(elmt);
943     elmt = getListElement(Rhistory, "frailty.spline.knots");
944     if(elmt != R_NilValue ) theHist->FrailtySplineKnots = REAL(elmt);
945     elmt = getListElement(Rhistory, "frailty.spline.fvar");
946     if(elmt != R_NilValue ) theHist->FrailtySplineFvar = REAL(elmt);
947     // frailty parametric 
948     elmt = getListElement(Rhistory, "frailty.param.par");
949     if(elmt != R_NilValue ) theHist->FrailtyParamPar = REAL(elmt);
950     elmt = getListElement(Rhistory, "frailty.weight");
951     if(elmt != R_NilValue ) theHist->FrailtyWeight = REAL(elmt);
952     theHist->priorvar = REAL(getListElement(Rhistory, "priorvar"));
953     theHist->accept = REAL(getListElement(Rhistory, "accept"));
954 }