src/IndivData.cpp
void GrowthData::writeToR(ostream& os, std::string nm, int indent) {
    if (debug) cout<<"GrowthData::writing to R"<<std::endl;
    for (int n=0;n<indent;n++) os<<tb;
        os<<"`"<<name<<"`"<<"=list("<<std::endl;
        indent++; 
            for (int n=0;n<indent;n++) os<<tb;
            os<<"name="<<qt<<name<<qt<<cc;
            os<<"llType="<<qt<<tcsam::getLikelihoodType(llType)<<qt<<cc;
            os<<"llWgt="<<llWgt<<cc<<std::endl;
            adstring colnames="'y','z','zp'";
            for (int x=1;x<=tcsam::nSXs;x++){
                if (nObs_x(x)>0){
                    for (int n=0;n<indent;n++) os<<tb;
                    os<<tcsam::getSexType(x)<<"="; wts::writeToR(os,trans(inpData_xcn(x)),colnames); os<<cc<<std::endl;
                }
            }//x
            os<<"NULL"<<std::endl;
        indent--;
    for (int n=0;n<indent;n++) os<<tb; os<<")"<<std::endl;
    if (debug) cout<<"GrowthData::done writing to R"<<std::endl;
}
/**
 * Write to an output stream as an R list with name given by name variable. 
 * 
 * @param os - the output stream
 * @param nm - the name of the list (ignored)
 * @param indent - the number of tabs to indent, initially
 */
Write to an output stream as an R list with name given by name variable.

@param os - the output stream
@param nm - the name of the list (ignored)
@param indent - the number of tabs to indent, initially
Write to an output stream as an R list with name given by name variable . @param os - the output stream @param nm - the name of the list ( ignored ) @param indent - the number of tabs to indent initially
void GrowthData::writeToR(ostream& os, std::string nm, int indent) {
    if (debug) cout<<"GrowthData::writing to R"<<std::endl;
    for (int n=0;n<indent;n++) os<<tb;
        os<<"`"<<name<<"`"<<"=list("<<std::endl;
        indent++; 
            for (int n=0;n<indent;n++) os<<tb;
            os<<"name="<<qt<<name<<qt<<cc;
            os<<"llType="<<qt<<tcsam::getLikelihoodType(llType)<<qt<<cc;
            os<<"llWgt="<<llWgt<<cc<<std::endl;
            adstring colnames="'y','z','zp'";
            for (int x=1;x<=tcsam::nSXs;x++){
                if (nObs_x(x)>0){
                    for (int n=0;n<indent;n++) os<<tb;
                    os<<tcsam::getSexType(x)<<"="; wts::writeToR(os,trans(inpData_xcn(x)),colnames); os<<cc<<std::endl;
                }
            }
            os<<"NULL"<<std::endl;
        indent--;
    for (int n=0;n<indent;n++) os<<tb; os<<")"<<std::endl;
    if (debug) cout<<"GrowthData::done writing to R"<<std::endl;
}
void GrowthData :: writeToR ( ostream & os , std :: string nm , int indent ) { if ( debug ) cout << " " << std :: endl ; for ( int n = 0 ; n < indent ; n ++ ) os << tb ; os << " " << name << " " << " " << std :: endl ; indent ++ ; for ( int n = 0 ; n < indent ; n ++ ) os << tb ; os << " " << qt << name << qt << cc ; os << " " << qt << tcsam :: getLikelihoodType ( llType ) << qt << cc ; os << " " << llWgt << cc << std :: endl ; adstring colnames = " " ; for ( int x = 1 ; x <= tcsam :: nSXs ; x ++ ) { if ( nObs_x ( x ) > 0 ) { for ( int n = 0 ; n < indent ; n ++ ) os << tb ; os << tcsam :: getSexType ( x ) << " " ; wts :: writeToR ( os , trans ( inpData_xcn ( x ) ) , colnames ) ; os << cc << std :: endl ; } } os << " " << std :: endl ; indent -- ; for ( int n = 0 ; n < indent ; n ++ ) os << tb ; os << " " << std :: endl ; if ( debug ) cout << " " << std :: endl ; }
Write to an output stream as an R list with name given by name variable.
Write to an output stream as an R list with name given by name variable .
//x
