i have this need that I need to print tables across pages, would this take it and adjust the length across pages????
if i want to print the iris dataset how I would do it? i created a layout with title, intro box and content box and this is what i am trying to file at the beginning and then create another slide with title and content box
i used the below link for youtube using officer package and i have been generally successful except for
- paginating tables i.e. spreading a long table across slides
- somehow i am getting erros generating the pptx, before it was working fine
code-------
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(officer)
library(quantmod)
# library("yfinance")
library(here)
library(flextable)
pres <- read_pptx(here("input/Rpresentation Template.pptx"))
read_pptx(here("input/Rpresentation Template.pptx")) %>%
officer::layout_properties()
ticker <- "AAPL"
company_name <- yfinance::search_stock(ticker, keep_results = "top")
company_name <- "Apple"
summary <- yfinance::get_summaries(ticker)
# irisah <- flextable(iris) %>% autofit() %>% align( align="center", part="body")
irisah <- flextable(iris)
my_pres <- pres %>%
remove_slide(index = 1) %>%
add_slide(layout= "StockPresentation", master="Office Theme") %>%
ph_with(value= company_name,
location= ph_location_label(ph_label="Company Name")) %>%
ph_with(value= summary$longBusinessSummary,
location= ph_location_label(ph_label= "Company Description")) %>%
add_slide(layout= "IntroTable", master="Office Theme") %>%
ph_location(value= irisah,
location= ph_location_label(ph_label="Table"))
print(my_pres,("C:/Users/jic00/Desktop/210611- Business analytics/R/Output/{Sys.Date()} - Example {company_name} Summary.pptx"))