libRDataFrame  0.815
A library with R style datatypes and associated utilities
 All Classes Files Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
categoryType Class Reference

Public Member Functions

 categoryType ()
 
 categoryType (std::string vName)
 
 categoryType (std::string vName, std::map< int, std::string > catSet)
 
 categoryType (std::string vName, std::map< int, std::string > catSet, void *ptrData)
 
 categoryType (std::string vName, void *ptrData)
 
 categoryType (std::string vName, std::map< int, std::string > catSet, std::vector< int > *ptrData)
 
std::vector< std::vector< int > > getDummyVarData ()
 
void setCategoryLevels (std::vector< std::string > levelStrList, std::vector< int > levelIntList)
 
void setCatVarRanks (std::vector< int > cData)
 
void setDummyVarData (std::vector< std::vector< int > > dummyVData)
 
std::map< int, std::string > getCategoryLevels ()
 
std::vector< int > getCatVarRanks ()
 
void addLevNameToData (std::vector< int > cData)
 

Protected Attributes

int nRows
 
int nLevels
 
std::string catVarName = ""
 
std::vector< int > dummySet
 
std::map< int, std::string > categorySet
 
std::vector< int > catVarRanks
 
std::vector< std::vector< int > > dummyVarData
 

Constructor & Destructor Documentation

categoryType::categoryType ( )

Constructors default constructor

Member Function Documentation

void categoryType::addLevNameToData ( std::vector< int >  cData)

map the int level data to corresponding names and return each name value pair

Parameters
nonesource is the class instance itself
Returns
a vector of name value pairs
map< int, string > categoryType::getCategoryLevels ( )

get map of category levels in vector<categoryLevels>

Returns
category set of levels the intern map of the categories is (re)populated
vector< int > categoryType::getCatVarRanks ( )

get the data vector values

Parameters
vector<int>vector of values as the categorized observations
Returns
void values are read into the carVarData vector.
void categoryType::setCategoryLevels ( std::vector< std::string >  levelStrList,
std::vector< int >  levelIntList 
)

set or amend map of category levels in vector<categoryLevels>

Parameters
levelStrLista string vector, blank names must be held with a ' ' space.
levelIntListan integer vector integers from 1 to n where n is the total number of levels
Returns
void the intern map of the categories is (re)populated
void categoryType::setCatVarRanks ( std::vector< int >  cData)

set the data vector values

Parameters
vector<int>vector of values as the categorized observations
Returns
void values are read into the carVarData vector.
void categoryType::setDummyVarData ( std::vector< std::vector< int > >  dummyVData)

set or build the dummy variable set for the categorical data

Parameters
return

The documentation for this class was generated from the following files: