diff --git a/build_html.sh b/build_html.sh index 395e8e67b..bd894c5b6 100755 --- a/build_html.sh +++ b/build_html.sh @@ -1,2 +1,2 @@ # Script to generate HTML book -docker run --rm -m 5g -v $(pwd):/home/rstudio/introduction-to-datascience ubcdsci/intro-to-ds:v0.15.0 /bin/bash -c "cd /home/rstudio/introduction-to-datascience; Rscript _build_html.r" +docker run --rm -m 5g -v $(pwd):/home/rstudio/introduction-to-datascience ubcdsci/intro-to-ds:v0.16.0 /bin/bash -c "cd /home/rstudio/introduction-to-datascience; Rscript _build_html.r" diff --git a/build_pdf.sh b/build_pdf.sh index 94dc99f6f..0f30da98b 100755 --- a/build_pdf.sh +++ b/build_pdf.sh @@ -22,7 +22,7 @@ cp -r data/ pdf/data cp -r img/ pdf/img # Build the book with bookdown -docker run --rm -m 5g -v $(pwd):/home/rstudio/introduction-to-datascience ubcdsci/intro-to-ds:v0.15.0 /bin/bash -c "cd /home/rstudio/introduction-to-datascience/pdf; Rscript _build_pdf.r" +docker run --rm -m 5g -v $(pwd):/home/rstudio/introduction-to-datascience ubcdsci/intro-to-ds:v0.16.0 /bin/bash -c "cd /home/rstudio/introduction-to-datascience/pdf; Rscript _build_pdf.r" # clean files in pdf dir rm -rf pdf/references.bib diff --git a/classification1.Rmd b/classification1.Rmd index 19ba6bc70..a0f8b7db2 100644 --- a/classification1.Rmd +++ b/classification1.Rmd @@ -10,6 +10,7 @@ knitr::opts_chunk$set(echo = TRUE, options(knitr.table.format = function() { if (knitr::is_latex_output()) 'latex' else 'pandoc' }) +reticulate::use_miniconda('r-reticulate') ``` ## Overview @@ -598,7 +599,7 @@ plot_3d <- scaled_cancer_3 |> z = ~Symmetry, color = ~Class, opacity = 0.4, - size = 150, + size = 5, colors = c("orange2", "steelblue2", "red"), symbol = ~Class, symbols = c('circle','circle','diamond')) @@ -637,6 +638,9 @@ plot_3d <- plot_3d %>% if(!is_latex_output()){ plot_3d } else { + scene = list(camera = list(eye = list(x=2, y=2, z = 1.5))) + plot_3d <- plot_3d %>% layout(scene = scene) + save_image(plot_3d, "img/plot3d_knn_classification.png", scale = 10) knitr::include_graphics("img/plot3d_knn_classification.png") } ``` diff --git a/docker-compose.yml b/docker-compose.yml index 49613c464..5aad1ed80 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: book-env: - image: ubcdsci/intro-to-ds:v0.12.0 + image: ubcdsci/intro-to-ds:v0.16.0 ports: - "8787:8787" volumes: @@ -10,5 +10,5 @@ services: deploy: resources: limits: - memory: 4G + memory: 5G diff --git a/regression1.Rmd b/regression1.Rmd index 6acbe3d3e..3767af9ed 100644 --- a/regression1.Rmd +++ b/regression1.Rmd @@ -5,6 +5,7 @@ library(knitr) library(plotly) knitr::opts_chunk$set(fig.align = "center") +reticulate::use_miniconda('r-reticulate') ``` ## Overview @@ -797,6 +798,9 @@ plot_3d <- plot_ly() |> if(!is_latex_output()){ plot_3d } else { + scene = list(camera = list(eye = list(x=2, y=2, z = 1.5))) + plot_3d <- plot_3d %>% layout(scene = scene) + save_image(plot_3d, "img/plot3d_knn_regression.png", scale = 10) knitr::include_graphics("img/plot3d_knn_regression.png") } ``` diff --git a/regression2.Rmd b/regression2.Rmd index 22eb234ba..e3ab21c8f 100644 --- a/regression2.Rmd +++ b/regression2.Rmd @@ -5,6 +5,7 @@ library(knitr) library(plotly) knitr::opts_chunk$set(fig.align = "center") +reticulate::use_miniconda('r-reticulate') ``` ## Overview @@ -491,6 +492,9 @@ plot_3d <- plot_ly() |> if(!is_latex_output()){ plot_3d } else { + scene = list(camera = list(eye = list(x=2, y=2, z = 1.5))) + plot_3d <- plot_3d %>% layout(scene = scene) + save_image(plot_3d, "img/plot3d_linear_regression.png", scale = 10) knitr::include_graphics("img/plot3d_linear_regression.png") } ```