ソースを参照

Fix #34

tags/v0.3.3
コミット
e5ecb0eca9
5個のファイルの変更28行の追加28行の削除
  1. +13
    -13
      R/ggplot2.R
  2. +2
    -2
      inst/rmarkdown/templates/xaringanthemer/skeleton/skeleton.Rmd
  3. +3
    -3
      man/theme_xaringan.Rd
  4. +7
    -7
      man/theme_xaringan_base.Rd
  5. +3
    -3
      man/theme_xaringan_inverse.Rd

+ 13
- 13
R/ggplot2.R ファイルの表示

#' ) #' )
#' #'
#' library(ggplot2) #' library(ggplot2)
#' ggplot(iris) +
#' aes(Petal.Length, Petal.Width) +
#' ggplot(mpg) +
#' aes(cty, hwy) +
#' geom_point() + #' geom_point() +
#' ggtitle("Yet another Iris plot") +
#' ggtitle("Fuel Efficiency of Various Cars") +
#' theme_xaringan() #' theme_xaringan()
#' } #' }
#' @return A ggplot2 theme #' @return A ggplot2 theme
#' ) #' )
#' #'
#' library(ggplot2) #' library(ggplot2)
#' ggplot(iris) +
#' aes(Petal.Length, Petal.Width) +
#' ggplot(mpg) +
#' aes(cty, hwy) +
#' geom_point() + #' geom_point() +
#' ggtitle("Yet another Iris plot") +
#' ggtitle("Fuel Efficiency of Various Cars") +
#' # themed to match the inverse slides: teal background with dark blue text #' # themed to match the inverse slides: teal background with dark blue text
#' theme_xaringan_inverse() #' theme_xaringan_inverse()
#' } #' }
#' if (has_ggplot2) { #' if (has_ggplot2) {
#' library(ggplot2) #' library(ggplot2)
#' #'
#' plot1 <- ggplot(iris) +
#' aes(Petal.Length, Petal.Width) +
#' plot1 <- ggplot(mpg) +
#' aes(cty, hwy) +
#' geom_point() + #' geom_point() +
#' theme_xaringan_base( #' theme_xaringan_base(
#' text_color = "#602f6b", # imperial #' text_color = "#602f6b", # imperial
#' set_ggplot_defaults = TRUE #' set_ggplot_defaults = TRUE
#' ) + #' ) +
#' labs( #' labs(
#' title = "Basic Iris Plot",
#' title = "Fuel Efficiency of Various Cars",
#' subtitle = "+ theme_xaringan_base()", #' subtitle = "+ theme_xaringan_base()",
#' caption = "xaringanthemer" #' caption = "xaringanthemer"
#' ) #' )
#' #'
#' print(plot1) #' print(plot1)
#' #'
#' plot2 <- ggplot(iris) +
#' aes(Sepal.Width) +
#' geom_histogram(binwidth = 0.1) +
#' plot2 <- ggplot(mpg) +
#' aes(hwy) +
#' geom_histogram(binwidth = 2) +
#' theme_xaringan_base( #' theme_xaringan_base(
#' text_color = "#a8a9c8", # light purple #' text_color = "#a8a9c8", # light purple
#' background_color = "#303163", # deep slate purple #' background_color = "#303163", # deep slate purple
#' set_ggplot_defaults = TRUE #' set_ggplot_defaults = TRUE
#' ) + #' ) +
#' labs( #' labs(
#' title = "Basic Iris Plot",
#' title = "Highway Fuel Efficiency",
#' subtitle = "+ theme_xaringan_base()", #' subtitle = "+ theme_xaringan_base()",
#' caption = "xaringanthemer" #' caption = "xaringanthemer"
#' ) #' )

+ 2
- 2
inst/rmarkdown/templates/xaringanthemer/skeleton/skeleton.Rmd ファイルの表示

If you want to generate a table, make sure it is in the HTML format (instead of Markdown or other formats), e.g., If you want to generate a table, make sure it is in the HTML format (instead of Markdown or other formats), e.g.,


```{r} ```{r}
knitr::kable(head(iris), format = 'html')
knitr::kable(head(mtcars), format = 'html')
``` ```


--- ---


```{r eval=require('DT'), tidy=FALSE} ```{r eval=require('DT'), tidy=FALSE}
DT::datatable( DT::datatable(
head(iris, 10),
mtcars[1:6, 1:6],
fillContainer = FALSE, options = list(pageLength = 8) fillContainer = FALSE, options = list(pageLength = 8)
) )
``` ```

+ 3
- 3
man/theme_xaringan.Rd ファイルの表示

) )


library(ggplot2) library(ggplot2)
ggplot(iris) +
aes(Petal.Length, Petal.Width) +
ggplot(mpg) +
aes(cty, hwy) +
geom_point() + geom_point() +
ggtitle("Yet another Iris plot") +
ggtitle("Fuel Efficiency of Various Cars") +
theme_xaringan() theme_xaringan()
} }
} }

+ 7
- 7
man/theme_xaringan_base.Rd ファイルの表示

if (has_ggplot2) { if (has_ggplot2) {
library(ggplot2) library(ggplot2)


plot1 <- ggplot(iris) +
aes(Petal.Length, Petal.Width) +
plot1 <- ggplot(mpg) +
aes(cty, hwy) +
geom_point() + geom_point() +
theme_xaringan_base( theme_xaringan_base(
text_color = "#602f6b", # imperial text_color = "#602f6b", # imperial
set_ggplot_defaults = TRUE set_ggplot_defaults = TRUE
) + ) +
labs( labs(
title = "Basic Iris Plot",
title = "Fuel Efficiency of Various Cars",
subtitle = "+ theme_xaringan_base()", subtitle = "+ theme_xaringan_base()",
caption = "xaringanthemer" caption = "xaringanthemer"
) )


print(plot1) print(plot1)


plot2 <- ggplot(iris) +
aes(Sepal.Width) +
geom_histogram(binwidth = 0.1) +
plot2 <- ggplot(mpg) +
aes(hwy) +
geom_histogram(binwidth = 2) +
theme_xaringan_base( theme_xaringan_base(
text_color = "#a8a9c8", # light purple text_color = "#a8a9c8", # light purple
background_color = "#303163", # deep slate purple background_color = "#303163", # deep slate purple
set_ggplot_defaults = TRUE set_ggplot_defaults = TRUE
) + ) +
labs( labs(
title = "Basic Iris Plot",
title = "Highway Fuel Efficiency",
subtitle = "+ theme_xaringan_base()", subtitle = "+ theme_xaringan_base()",
caption = "xaringanthemer" caption = "xaringanthemer"
) )

+ 3
- 3
man/theme_xaringan_inverse.Rd ファイルの表示

) )


library(ggplot2) library(ggplot2)
ggplot(iris) +
aes(Petal.Length, Petal.Width) +
ggplot(mpg) +
aes(cty, hwy) +
geom_point() + geom_point() +
ggtitle("Yet another Iris plot") +
ggtitle("Fuel Efficiency of Various Cars") +
# themed to match the inverse slides: teal background with dark blue text # themed to match the inverse slides: teal background with dark blue text
theme_xaringan_inverse() theme_xaringan_inverse()
} }

読み込み中…
キャンセル
保存