### Installation instruction resistance GA for the Thursday morning session on resistance surfaces. ## Written by Joscha Beninde & Isolde van Riemsdijk. ## With questions for installation, email: isolde.van_riemsdijk@biol.lu.se, j.beninde@vu.nl or send a message on Slack ## There will also be trouble-shooting opportunities in breaks on Wednesday, so we can ensure everyone has a running installation on Thursday. ## Installing packages ResistanceGA and dependencies # We assume that you have installed R and R studio. If not, please use this website to install them following instructions for your running system: https://rstudio-education.github.io/hopr/starting.html # in Rstudio (or R) install the packages "devtools", "tinytex", "terra", and "ResistanceGA" by typing the following in the command line and hitting enter after each line: # Install 'devtools' package, if needed if(!("devtools" %in% list.files(.libPaths()))) { install.packages("devtools", repo = "http://cran.rstudio.com", dep = TRUE)} # tinytex; install.packages("tinytex") library("tinytex") tinytex::install_tinytex() # terra; install.packages("terra") library("terra") # ResistanceGA devtools::install_github("wpeterman/ResistanceGA", build_vignettes = TRUE) # Download package library("ResistanceGA") ## if you get errors during the installation of this package, try and see if you can get it to work by installing the packages as follows: install.packages("") library("") # and rerunning the devtools command until you are successfull or run out of patience. In the latter case, do not hesitate to contact us! # If installation ran without any errors, do a small test-run to see if the installation was indeed successfull. The following line of code will generate an error regardless: Frag.tran <- Resistance.tran(transformation = "Monomolecular", shape = 0.3, max = 150, r = Frag) # If the error reports that it cannot find "Frag", then your installation was sucessfull and you can continue with the installtion of Julia # If the error reports that it cannot find the function "Resistance.tran" then contact us to further trouble-shoot your installation! ## Installing coding software Julia, and Circuitscape for fast optimization # Install Julia for your system with the installation wizzard that you can download here: https://julialang.org/downloads/ # Install the Julia package Circuitscape (following under the header "Installation" here: https://github.com/Circuitscape/Circuitscape.jl) # Start Julia, and in the command line of Julia, type (hit "enter" after every line): # Load the package functions: using Pkg # Add the package "Circuitscape": Pkg.add("Circuitscape") # Test your newly installed package: Pkg.test("Circuitscape") # The test was successfull if the final line reports "Testing Circuitscape tests passed" # Now we need to get the path where Julia is by running (for instructions for MAC, see below): ENV["PATH"] # Your computer probably answers with a long string with several paths to different locations on your computer, separated by semi-colons (;) # You need to look for the path ending with "Julia", the version number, and "bin". For me it was: C:\\Users\\Isolde\\AppData\\Local\\Programs\\Julia-1.9.3\\bin # Save this path somewhere so you can use it for the tutorial # And the path where Julia is for MAC users (thanks to Ernst Jonsson for solving this one): # use the shell (the mac terminal) sudo mkdir -p /usr/local/bin sudo rm -f /usr/local/bin/julia sudo ln -s /Applications/Julia-1.9.app/Contents/Resources/julia /usr/local/bin/julia # Use this first path here (/Applications/ ... /julia) for the optional test below and the tutorial! ## OPTIONAL: to test if your Julia installation was sucessfull, restart your computer, and run the following code in the R studio or the R terminal: # Replace the path here to the path you saved above, remember to replace the double backward slashes with single forward slashes JULIA_HOME <- "C:/Users/Isolde/AppData/Local/Programs/Julia-1.9.3/bin" JuliaCall::julia_setup(JULIA_HOME) ## You are all prepared now, we look forward to meeting you all!