R/as_package_version.R

Defines functions as_package_version

as_package_version <- function(version){
    
    if(length(version)>1) {
        return(base::Map(f=as_package_version, version))
    }
    version <- gsub("^v","",version, ignore.case = TRUE)
    subversion <- gsub("[^a-zA-Z]", "", version)
    if(nchar(subversion)>0){
        version <- gsub(subversion, 
                        paste0(".",match(subversion, letters)), 
                        version)    
    }
    version <- package_version(version)
    return(version)
}
NathanSkene/MAGMA_Celltyping documentation built on Oct. 11, 2024, 7:19 a.m.