#' @title Create BED, BIM, FAM Variables
#'
#' @description Convenience function to create the variables .bed, .bim, .fam in the global environment to be used by other functions.
#'
#' @param filestub Stub of the PLINK bfiles.
#' @param clear Logical. Should existing bfile objects be cleared first?
#'
#' @export
bfile <- function(filestub, clear = FALSE) {
if(clear) {
rm(.bed, .bim, .fam, .bfile, envir = .GlobalEnv)
return(invisible(NULL))
}
bfile <- filestub
class(bfile) <- "bfile"
assign(".bed", paste0(filestub, ".bed"), envir=.GlobalEnv)
assign(".bim", paste0(filestub, ".bim"), envir=.GlobalEnv)
assign(".fam", paste0(filestub, ".fam"), envir=.GlobalEnv)
assign(".bfile", bfile, envir=.GlobalEnv)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.