A toolkit for working with phylogenetic data.
v0.24.0
factor.hpp File Reference
#include "genesis/utils/containers/dataframe.hpp"
#include <algorithm>
#include <cassert>
#include <limits>
#include <stdexcept>
#include <sstream>
#include <vector>

Go to the source code of this file.

Classes

struct  GlmFactor< T >
 

Namespaces

 genesis
 Container namespace for all symbols of genesis in order to keep them separate when used as a library.
 
 genesis::utils
 

Functions

template<class ForwardIterator >
GlmFactor< typename ForwardIterator::value_type > glm_factor (ForwardIterator first, ForwardIterator last, std::vector< typename ForwardIterator::value_type > const &levels, std::vector< typename ForwardIterator::value_type > const &exclude)
 Reduce a list of values in the given range to a set of unique factors. More...
 
template<class ForwardIterator >
GlmFactor< typename ForwardIterator::value_type > glm_factor (ForwardIterator first, ForwardIterator last, std::vector< typename ForwardIterator::value_type > const &levels)
 
template<class ForwardIterator >
GlmFactor< typename ForwardIterator::value_type > glm_factor (ForwardIterator first, ForwardIterator last)
 
template<class T >
std::vector< size_t > glm_factor_summary (GlmFactor< T > const &factor)
 Get the number of occurrences of each level in a GlmFactor. More...
 
template<class T >
Dataframe glm_indicator_variables (GlmFactor< T > const &factor, T const &reference_level, std::vector< std::string > const &row_names=std::vector< std::string >{})
 Turn a GlmFactor into a set of (dummy) indicator variables to be used in regression. More...
 
template<class T >
Dataframe glm_indicator_variables (GlmFactor< T > const &factor, std::vector< std::string > const &row_names=std::vector< std::string >{})
 Turn a GlmFactor into a set of (dummy) indicator variables to be used in regression. More...