#' Function that creates blank columns that openSpecimen has to have....
#' Requires that you be mounted to jhpce! Needs this file 'dcs01/arking/arkinglab/resources/openSpec/colnames.rds' in order to work
#'
#' @export
#' @param new.df The finished file, after running getLoc(), getRequiredFields(), and assignBar()
#'
#' @return A bulk upload file template. BE WARY YOU WILL NOT BE ABLE TO VIEW THIS IN RSTUDIO.
#'
#' @examples
#' new.df <- assignDummy(new.df)
assignDummy <- function (new.df)
{
load("/Users/arkinglab/jhpce/dcs01/arking/arkinglab/resources/openSpec/colnames.rds")
load("/Users/arkinglab/jhpce/dcs01/arking/arkinglab/resources/openSpec/colnames_noperiods.rds")
'%!in%' <- function(x,y)!('%in%'(x,y))
colnames(new.df) <- make.names(colnames(new.df))
# get rid of columns that shouldn't be there
new.df[,which((colnames(new.df)) %!in% bulk_upload_columns)] <- NULL
missing.columns <- bulk_upload_columns[which(bulk_upload_columns %!in% colnames(new.df))]
# initialize columns that should exist
new.df[, missing.columns] <- ''
reordered <- new.df[bulk_upload_columns]
colnames(reordered) <- bulk_upload_columns_noperiods
return(reordered)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.