Estoy tratando de escribir una secuencia de viñetas en la misma diapositiva, con el siguiente código R:
library(officer)
library(magrittr)
ppt <- read_pptx()
ppt <- ppt %>%
add_slide(layout = "Title and Content", master = "Office Theme") %>%
ph_with_text(type = "title", str = "FFT power spectrum") %>%
ph_with_text(type = "body", str = "no visual discrimination") %>%
ph_add_par(level = 1L) %>%
ph_add_text(str = "whole trajectories")
print(ppt, target = "test.pptx") %>% invisible()
... que falla, diciendo ...
Error in doc_parse_raw(x, encoding = encoding, base_url = base_url, as_html = as_html, :
Premature end of data in tag p line 1 [77]
Cuando cambio el parámetro de nivel a
ph_add_par(level = 2L)
funciona bien (como se demuestra en la viñeta: https://cran.r-project.org/web/packages/officer/vignettes/powerpoint.html )
¿Que me estoy perdiendo aqui?
Eso fue un error, gracias por informarlo. Puede obtener la versión dev con devtools::install_github("davidgohel/officer")
.
Y debajo un guión ligeramente modificado:
library(officer)
library(magrittr)
default_font <- fp_text(font.family = "Calibri", font.size = 0)
ppt <- read_pptx()
ppt <- ppt %>%
add_slide(layout = "Title and Content", master = "Office Theme") %>%
ph_with_text(type = "title", str = "FFT power spectrum") %>%
ph_with_text(type = "body", str = "no visual discrimination") %>%
ph_add_par(level = 1L, type = "body") %>%
ph_add_text(str = "whole trajectories", type = "body", style = default_font )
print(ppt, target = "test.pptx") %>% browseURL()
Este artículo se recopila de Internet, indique la fuente cuando se vuelva a imprimir.
En caso de infracción, por favor [email protected] Eliminar
Déjame decir algunas palabras