diff --git a/.gitignore b/.gitignore index ef4280a..b4ebb88 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Ignore for publishing /.quarto/ /_site/ +# Ignore the rendered files but keep the directory +/docs/* +!docs/.keep .Rhistory .Rprofile diff --git a/08-Appendix.qmd b/08-Appendix.qmd index d83fff5..3762dd4 100644 --- a/08-Appendix.qmd +++ b/08-Appendix.qmd @@ -514,7 +514,7 @@ s1e_heart_plot I also explored whether participants reported different levels of need-threat between Time 3 and Time 5. Results are plotted in @fig-s1e-nts-across-time-plot. -```{r s1e-exploratory-NTS-mixed, cache=TRUE} +```{r s1e-exploratory-NTS-mixed} # Exploratory Mixed Model with Time -------------------------------------------- # run model NTS_vars <- c("nts_belonging_mean", "nts_esteem_mean", @@ -691,7 +691,7 @@ s2_mnsdcor %>% as_tibble() %>% ``` #### Bivariate Scatter Plot Matrix -```{r s2-matplot, fig.cap = "Matrix Plot for Study 2 Variables", fig.height=15, fig.width=15, message=FALSE, warning=FALSE, cache=TRUE} +```{r s2-matplot, fig.cap = "Matrix Plot for Study 2 Variables", fig.height=15, fig.width=15, message=FALSE, warning=FALSE} #| label: fig-s2-matplot # Study 2 - Matrix Plot s2_df %>% @@ -908,8 +908,7 @@ s3_mnsdcor %>% as_tibble() %>% kable_styling_cortable() ``` -```{r appendix-s3-ggpairs, fig.cap='Study 3 - Bivariate Scatter Plot Matrix',fig.height=15, fig.width=15, out.width='100%', message=FALSE, warning=FALSE, cache=TRUE} -#| label: fig-appendix-s3-ggpairs +```{r appendix-s3-ggpairs, fig.cap='Study 3 - Bivariate Scatter Plot Matrix',fig.height=15, fig.width=15, out.width='100%', message=FALSE, warning=FALSE} # GG Pairs for Study 3 s3_df %>% dplyr::select(parasocial, social_world, T1_Heart_1, T1_Valence_1, T1_Arousal_1, T1_Dominance_1, diff --git a/Dockerfile b/Dockerfile index aea3acb..1ef5cc6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,87 +1,42 @@ -FROM rocker/rstudio:4 - -# Install Ubuntu distributions of R Packages -RUN apt-get update -RUN apt-get install -y zlib1g-dev -RUN -RUN install2.r -e here -RUN install2.r -e haven - -# xml2 -RUN apt-get install -y libxml2-dev -RUN install2.r -e xml2 - -# svg lite -RUN apt-get -y install libfontconfig1-dev -RUN install2.r -e svglite - -RUN install2.r -e patchwork -RUN install2.r -e table1 -RUN install2.r -e papaja -RUN install2.r -e kableExtra -RUN install2.r -e tidyr -RUN install2.r -e tibble - -RUN install2.r -e bookdown - - -RUN install2.r -e remotes -# ggtext -RUN apt-get -y install libcurl4-openssl-dev -RUN install2.r -e ggtext -RUN install2.r -e labelled - -# Install R packages on GitHub -RUN Rscript -e "remotes::install_github('achetverikov/APAstats')" +FROM rocker/rstudio:4.4.2 +# Install renv +RUN R -e "install.packages('renv', repos = c(CRAN = 'https://cloud.r-project.org'))" -RUN install2.r -e readr -RUN install2.r -e stringr -RUN install2.r -e purrr -RUN install2.r -e tinytex +# Get the renv files from the current project +RUN mkdir -p /project +WORKDIR /project +COPY renv.lock renv.lock +# Specify library paths for installation +RUN mkdir -p renv +COPY renv/activate.R renv/activate.R +COPY renv/settings.json renv/settings.json -RUN apt-get -y install libcairo2-dev libharfbuzz-dev libfribidi-dev -RUN apt-get -y install libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev -RUN install2.r -e flextable -RUN install2.r -e metathis -RUN install2.r -e Hmisc -RUN install2.r -e GGally -RUN install2.r -e corrr - -RUN apt-get -y install cmake -RUN install2.r -e lme4 - -RUN install2.r -e lmerTest -RUN install2.r -e forestplot -RUN install2.r -e broom.mixed -RUN install2.r -e ggpubr -RUN install2.r -e pacman - -RUN install2.r -e tidyverse -RUN install2.r -e rio - -RUN install2.r -e english -RUN install2.r -e sjlabelled -RUN install2.r -e sjPlot -RUN install2.r -e ggh4x -RUN install2.r -e knitcitations - - -RUN install2.r -e wordcloud -RUN install2.r -e emmeans -RUN install2.r -e tidytext -RUN install2.r -e ggmosaic -RUN install2.r -e broom -RUN install2.r -e codebook -RUN install2.r -e effectsize +# Install system dependencies +RUN apt-get update +## xml2 +RUN apt-get install -y libxml2-dev +## png +RUN apt-get install -y libpng-dev +## curl +RUN apt-get install -y libcurl4-openssl-dev +## cmake (for nloptr) +RUN apt-get install -y cmake +## gert +RUN apt-get install -y libgit2-dev +## systemfonts +RUN apt-get install -y libfontconfig1-dev +## Other dependencies +RUN apt-get install -y libcairo2-dev libharfbuzz-dev libfribidi-dev +RUN apt-get install -y libfreetype6-dev libtiff5-dev libjpeg-dev + +# Restore the packages via renv +RUN R -e "renv::restore()" + +# Install knitr and rmarkdown packages +RUN R -e "install.packages('knitr', repos = c(CRAN = 'https://cloud.r-project.org'))" +RUN R -e "install.packages('rmarkdown', repos = c(CRAN = 'https://cloud.r-project.org'))" # Install tinytex as the rstudio user -USER rstudio -RUN Rscript -e "tinytex::install_tinytex(force = TRUE)" -ENV PATH="${PATH}:/home/rstudio/bin" - -# Start the RStudio server as root -USER root -ENV USER=rstudio -CMD ["/usr/lib/rstudio-server/bin/rserver","--server-daemonize=0","--auth-none=1"] \ No newline at end of file +RUN Rscript -e "tinytex::install_tinytex(force = TRUE)" \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index b03fe68..7c26355 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,17 @@ services: - 8787:8787 volumes: - ./:/home/rstudio/dissertation/ - environment: - - PASSWORD=changeme # default username is rstudio - + working_dir: /home/rstudio/dissertation + command: quarto render # Render the book + ## To launch RStudio server use the command & environment below + ## ------------------------- + # user: root # For launching RStudio server + # command: + # [ + # "/usr/lib/rstudio-server/bin/rserver", + # "--server-daemonize=0", + # "--auth-none=1", + # ] + # environment: + # - PASSWORD=changeme # default username is rstudio + # - USER=root # For launching RStudio server diff --git a/docs/.keep b/docs/.keep new file mode 100644 index 0000000..e69de29 diff --git a/packages.bib b/packages.bib index bea5f6b..8f164ab 100644 --- a/packages.bib +++ b/packages.bib @@ -1,9 +1,9 @@ @Manual{R-apastats, title = {apastats: APA-style results}, author = {Andrey Chetverikov}, - year = {2025}, note = {R package version 0.5, commit acbf761e3f66643c96e9b6ad65fdcd4af01382ed}, url = {https://github.com/achetverikov/APAstats}, + year = {2025}, } @Manual{R-base, @@ -174,14 +174,6 @@ @Manual{R-lme4 url = {https://github.com/lme4/lme4/}, } -@Manual{R-lubridate, - title = {lubridate: Make Dealing with Dates a Little Easier}, - author = {Vitalie Spinu and Garrett Grolemund and Hadley Wickham}, - year = {2024}, - note = {R package version 1.9.4}, - url = {https://lubridate.tidyverse.org}, -} - @Manual{R-Matrix, title = {Matrix: Sparse and Dense Matrix Classes and Methods}, author = {Douglas Bates and Martin Maechler and Mikael Jagan}, @@ -253,14 +245,6 @@ @Manual{R-tidytext url = {https://juliasilge.github.io/tidytext/}, } -@Manual{R-tidyverse, - title = {tidyverse: Easily Install and Load the Tidyverse}, - author = {Hadley Wickham}, - year = {2023}, - note = {R package version 2.0.0}, - url = {https://tidyverse.tidyverse.org}, -} - @Manual{R-wordcloud, title = {wordcloud: Word Clouds}, author = {Ian Fellows}, @@ -333,17 +317,6 @@ @Article{lme42015 doi = {10.18637/jss.v067.i01}, } -@Article{lubridate2011, - title = {Dates and Times Made Easy with {lubridate}}, - author = {Garrett Grolemund and Hadley Wickham}, - journal = {Journal of Statistical Software}, - year = {2011}, - volume = {40}, - number = {3}, - pages = {1--25}, - url = {https://www.jstatsoft.org/v40/i03/}, -} - @Article{tidytext2016, title = {tidytext: Text Mining and Analysis Using Tidy Data Principles in R}, author = {Julia Silge and David Robinson}, @@ -356,14 +329,3 @@ @Article{tidytext2016 journal = {JOSS}, } -@Article{tidyverse2019, - title = {Welcome to the {tidyverse}}, - author = {Hadley Wickham and Mara Averick and Jennifer Bryan and Winston Chang and Lucy D'Agostino McGowan and Romain François and Garrett Grolemund and Alex Hayes and Lionel Henry and Jim Hester and Max Kuhn and Thomas Lin Pedersen and Evan Miller and Stephan Milton Bache and Kirill Müller and Jeroen Ooms and David Robinson and Dana Paige Seidel and Vitalie Spinu and Kohske Takahashi and Davis Vaughan and Claus Wilke and Kara Woo and Hiroaki Yutani}, - year = {2019}, - journal = {Journal of Open Source Software}, - volume = {4}, - number = {43}, - pages = {1686}, - doi = {10.21105/joss.01686}, -} -