#' Linearize data frame
#'
#' @param df A data frame to be linearized.
#' @param mode A character indicating whether to linearize per column or row. Defults to "column".
#' @return A vector after linearization.
#' @export
linearize_dataFrame = function(df,mode="column"){
stopifnot(mode == "column" | mode == "row")
o = c()
if(mode=="column"){
for(column in 1:ncol(df)){
o = c(o,df[,column])
}
}
else{
for(row in 1:nrow(df)){
o = c(o,df[row,])
}
}
o
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.