R/strata2df.R

Defines functions strata2df

Documented in strata2df

#'Convert a character vector to a data.frame
#'@param strata A character vector
#'@return A data.frame
#'@export
strata2df=function(strata){
     temp=strsplit(strata,", ")
     count=length(temp[[1]])
     temp1=data.frame(matrix(unlist(temp),ncol=count,byrow=TRUE))
     colnames(temp1)=gsub("=.*","",temp1[1,])
     temp2=data.frame(lapply(temp1,function(x) gsub(".*=","",x)))
     temp2
}
cardiomoon/autoReg documentation built on Dec. 10, 2023, 1:59 a.m.