#' Read a parquet file as an R dataframe
#'
#' This function allows you to read a parquet file as an R data frame.
#' @param path The parquet file path
#' @keywords parquet
#' @import reticulate dplyr
#' @export
read_parquet <- function(file) {
tryCatch( {
pd <- import("pandas")
dd <- as_tibble(pd$read_parquet(file))
return(dd)
}, error = function(e) {
cat("unable to read file. \n")
print(e)
}
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.