R/tr8_cleanup_cols.R

##' Shortens up columns' names in the intermidiate steps of
##' tr8() retrieved data
##'
##' This function is internally used by \code{tr8()}.
##' @title column_conversion
##' @return a dataframe with shortened col names
##' @param DF a intermediate dataframe built by \code{tr8} 
##' @author Gionata Bocci <[email protected]@gmail.com>
column_conversion<-function(DF){

    env<-new.env(parent = parent.frame())
    data(column_list,envir=env)
    column_list<-get("column_list",envir=env)
    for(i in names(column_list)){
        if(i%in%names(DF)){
            names(DF)[which(names(DF)==i)]<-column_list[i][[1]][1]
        }
    }
    remove(list=c("column_list"), envir=env)
    return(DF)
}
    
GioBo/TR8 documentation built on June 9, 2019, 8:32 a.m.