-
Notifications
You must be signed in to change notification settings - Fork 21
User Customizations
The following customizations are needed for running these SDM scripts on this project's server. They may also be useful for others:
-
Change a default setting in MikTex so that packages are installed automatically
- open MiKTeX console
- choose "Stay in User Mode"
- Choose settings, choose "Always install missing packages on-the-fly"
- Exit
-
Change the temp file location for RStudio because C: is too small
- create a file called
.Renviron
- include in this file this line
TMPDIR = "D:/R_tmp"
- Place this file in
C:\Users\yournamehere\Documents
(at the same level as theR
folder)
- create a file called
-
Also set the raster temp file location and the CRAN snapshot date
- create a file called
.Rprofile
- add these three lines
dir.create("D:/R_tmp", showWarnings = F) options(rasterTmpDir="D:/R_tmp")
- Place this file in
C:\Users\yournamehere\Documents
(at the same level as theR
folder)
- create a file called
-
Set PATH environments for MikTex and OSGeo4
- click search/magnifier in lower left corner
- type
PATH
in the window - select "Edit Environment Variables for your account" (might have to click on gear to make it appear)
- in upper window, select the line with "Path" on the left, choose "Edit..."
- Add "C:\OSGeo4W64\bin" and "C:\Program Files\MiKTeX 2.9\miktex\bin\x64", separated by a semi-colon ";"
- OK, OK
- Close everything, log out of mobiprep, log back in.
-
Set a link to env vars so you don't have space-hogging duplicate copies in _data
- the full set of rasters (env vars) are stored here:
G:\terrestrialEnvVars_30m_masked
- open a windows command windows (type
cmd
in search window) - navigate to the raster folder in your repo (Regional_SDM\_data\env_vars\raster). Hint: typing drive-letter-plus-colon alone at the command line without "cd" (like this >
f:
) changes drives in this windows command prompt environment. - create a hard link (junction) to the envvar folder, name it
ras
with the commandmklink /J ras G:\terrestrialEnvVars_30m_masked
- it should report "Junction created for ras <<==>> G:\terrestrialEnvVars_30m_masked"
- now in script
0_user_run_SDM.R
, setloc_envVars = here("_data","env_vars","raster", "ras")
- (if, at some time you want to remove this link, use
rmdir ras
in cmd window. It won't delete the destination files, only the link)
- the full set of rasters (env vars) are stored here:
-
Change the Windows %Temp% directory for ArcGIS to use (some tools may be ignoring geoprocessing environment settings)
- click the search magnifier lens in lower left corner and search for "path"
- choose "Edit Environment variables for your account" (note, do not choose "Edit the system environment variables" as this needs admin permissions)
- Look in the System Variables box at the bottom of the Environment Variables window. Scroll down to the
TEMP
andTMP
variables are both set to "D:\Pro_GP_Scratch". If you can't modify these system vars, add these two variables (TMP
andTEMP
) to your user environment, and set as above.
-
Set up a connection to the Access tracking database in R (this is also documented at N:\tracking_database\how_to_connect_to_tracking_DB_inR.r)
- First, make sure you have the most recent version copied to N:/tracking_database and renamed to MoBI_Tracking_currentVersion.accdb
- Second, set up an ODBC connection. You only need to do this once, if you continue to connect to the db with the same name
- click magnifier (search) in lower left, type "ODBC" in search window, open "ODBC Data Sources (64 bit)"
- On User DSN tab, choose "Add", then choose "Microsoft Access Driver (.mdb,.accdb)", click on Finish
- In Data Source Name, put "mobi_spp_tracking", then select the DB using the Select button. "OK", then close out.
-
Set up git, as described here
-
https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup mainly these two
git config --global user.name
git config --global user.email
-
https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup mainly these two