Archaeoriddle, the bookdown
last compiled: 2025-02-14 10:22:58
Preface
This bookdown has two main objectives:
- documents all the steps, models, functions and results done during the archaeoriddle project
- generate your own fake world with specific parameters and a fake archaeological record
To use this book you can follow it on this online version and copy paste the chunks on your local computer, or you can clone the source at the git repository here and compile the bookdown on your local machine.
Dependencies
If you want this to be successful, you will need to install a few additional packages by running the command in the chunk below, which will check if all packages are installed, install them if not and then load them.
needed=c("terra","sf","igraph","devtools")
success=sapply(needed,require,character.only=T)
sapply(needed[!success],install.packages)
## named list()
success=sapply(needed,require,character.only=T)
terra::terraOptions(progress=0) #by default terra show a progress bar when applying function to large raster, this messes with our output so we set it to zero to remove it.These packages will very likely need other packages that will depend on your operating system, so check the error messages from the previous commands.
You will also need to install and load the package associated with the bookdown by doing
devtools::install_github("acortell3/archaeoriddle")
library(archaeoriddle)Compiling the book
If you want to compile the book yourself, you will need bookdown and a few more packages used to render the book. But first, you will need to clone the repository:
git clone https://github.com/acortell3/archaeoriddle/
cd archaeoriddle
Once done you can then load the package using the local source:
devtools::load_all()
## ℹ Loading archaeoriddleAnd then install the specific packages to render the book.
compneeded=c("DiagrammeR","bookdown","igraph","gifski")
success=sapply(compneeded,require,character.only=T)
sapply(needed[!success],install.packages)
success=sapply(compneeded,require,character.only=T)Using load_all() instead of install(...) will allow you to modify the source code and reload the package after any change, thus making test and integration of your own implementation way easier.
Once the package has been loaded or installed, you can then render the book locally. Note that this may take a long time as it generates a full new world, and run a couple of simulations and examples.
bookdown::render_book() #you need to be in the folder 'doc/bookdown/'