# ' @title: RTweetV2 Function flattenlist
#' This function is a sub function helping make a list flat.
#' @param x list with elements from the twitter API
#' @return a list
#' @export
#'
#' @importFrom stats na.omit
# flatten list of lists where lists are nested within and of unequal length!
flattenlist <- function(x){
morelists <- sapply(x, function(xprime) class(xprime)[1]=="list")
out <- c(x[!morelists], unlist(x[morelists], recursive=FALSE))
if(sum(morelists)){
Recall(out)
}else{
return(out)
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.