xpt2tsv <- function(xpt){
ext <- tools::file_ext(xpt)
if (ext=='xpt'){
sas <- haven::read_xpt(xpt)
}else{
sas <- haven::read_sas(xpt)
}
colnames(sas) <- tolower(colnames(sas))
(tsv <- do::Replace(xpt,paste0('\\.',ext),'.tsv'))
data.table::fwrite(sas,tsv,sep = '\t')
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.