We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi @elong0527,
I ran the following code. But footnote and source doesn't appear in each pages.
` library(dplyr) # version '1.0.8' library(ggplot2) # version ‘3.3.5’ library(r2rtf) # version ‘0.3.2’
for(i in sort(unique(iris$Species))) { fil_data <- iris %>% filter(Species == i)
p <- ggplot2::ggplot(fil_data, aes(x = Sepal.Length, y = Sepal.Width))+ geom_point(size = 3)+ theme_minimal()
plot_file <- paste0("figure_", i, ".png")
ggplot2::ggsave(filename = plot_file, plot = p, path=file.path(tempdir()), device="png", width=8.9, height=4.5, units = "in") }
filename <- file.path(tempdir(), purrr::map_chr(unique(iris$Species), ~ paste0("figure_", .x, ".png")))
ttl1 <- "Plot of iris Sepal.Width by Sepal.Length" ttl2 <- paste(\b0\fs20,"Page \pagenumber of \totalpage")
fig_rtf <- filename %>% rtf_read_png() %>% # read PNG files from the file path rtf_title(ttl1, ttl2) %>% # add title or subtitle rtf_figure() %>% rtf_footnote("footnote", text_justification = "l" ) %>% # add footnote rtf_source("[source: IRIS data]", text_justification = "l") # add data source
fig_rtf %>% rtf_encode(page_footnote = "all", page_source = "all", doc_type = "figure") %>% write_rtf(file = file.path(getwd(),"/","iris_3specices.rtf")) iris_3specices.pdf `
The text was updated successfully, but these errors were encountered:
c41fd4b
Thanks! The bug is fixed in c41fd4b
Sorry, something went wrong.
No branches or pull requests
Hi @elong0527,
I ran the following code. But footnote and source doesn't appear in each pages.
`
library(dplyr) # version '1.0.8'
library(ggplot2) # version ‘3.3.5’
library(r2rtf) # version ‘0.3.2’
for(i in sort(unique(iris$Species))) {
fil_data <- iris %>% filter(Species == i)
p <- ggplot2::ggplot(fil_data, aes(x = Sepal.Length, y = Sepal.Width))+
geom_point(size = 3)+
theme_minimal()
plot_file <- paste0("figure_", i, ".png")
ggplot2::ggsave(filename = plot_file, plot = p,
path=file.path(tempdir()), device="png", width=8.9, height=4.5, units = "in")
}
filename <- file.path(tempdir(), purrr::map_chr(unique(iris$Species),
~ paste0("figure_", .x, ".png")))
ttl1 <- "Plot of iris Sepal.Width by Sepal.Length"
ttl2 <- paste(\b0\fs20,"Page \pagenumber of \totalpage")
Create RTF file
fig_rtf <- filename %>%
rtf_read_png() %>% # read PNG files from the file path
rtf_title(ttl1, ttl2) %>% # add title or subtitle
rtf_figure() %>%
rtf_footnote("footnote", text_justification = "l" ) %>% # add footnote
rtf_source("[source: IRIS data]", text_justification = "l") # add data source
fig_rtf %>%
rtf_encode(page_footnote = "all",
page_source = "all",
doc_type = "figure") %>%
write_rtf(file = file.path(getwd(),"/","iris_3specices.rtf"))
iris_3specices.pdf
`
The text was updated successfully, but these errors were encountered: