Skip to content

ELF Method Tutorial

passeroe edited this page Oct 18, 2017 · 3 revisions

The following tutorial is intended to show users how to use the ELF scripts. Using the provided R-scripts and inputs, users will create four different ELF plots of the total number of taxa of fish by mean annual flow in the Upper Roanoke watershed.

  1. Download elf_user_inputs.R, elf_rest_token.R, elf_retrieve_data.R, elf_quantreg.R, elf_pw_it.R, elf_twopoint.R, and elf_ymax.R. Store these scripts in a new folder together. Do not change their names.

  2. In elf_user_inputs change lines 9 and 10 to the folders that you stored the scripts in and where you intend to store any resulting plots. Make sure there are two backslashes at the end of the script locations.

  3. Beginning on line 33 the x_metric(s) can be selected. Selecting multiple x_metrics will result in multiple plots. To include an x_metric remove the # from the beginning of the line. If you are selecting multiple x_metrics, make sure there is a comma after all of the metrics except for the last one. For example, if erom_q0001e_mean and erom_q0001e_aug are selected, there should be a comma after erom_q0001e_mean but the comma should be removed after erom_q0001e_aug. For this tutorial only erom_q0001e_mean should be used.

  4. In line 54 you can specify y_metric. Only one y_metric should be used at a time. The dh variable key gives the input for the script. For this tutorial use aqbio_nt_total.

  5. In line 66 you need to specify the ws_ftype. This is the watershed or regional level that will determine how the data is geographically grouped together. For example, selecting nhd_huc6 means ecological data will be grouped together and plotted by the NHD HUC6 the data was recorded in. Select nhd_huc8.

  6. Line 67 gives the option to process an individual watershed or region at the level you previously selected. Type nhd_huc8_03010101 to look at only the Upper Roanoke River watershed.

  7. In line 68 you can set the quantile that will be used to calculate the quantile regression equations. Leave the quantile at 0.80 for the example.

  8. Lines 70 through 74 let users set a date range for their analysis. The date range determines which years ecological data will be pulled from. On line 74, set the timespan equal to ‘full’ to use all of the samples available for the watershed.

  9. In line 78 the sampres, sample resolution, can be set. The sample resolution specifies the taxonomic levels of the ecological data you will be using. Ecological data is not available at every taxonomic level for every y_metric because agencies identified samples at different levels. Lines 80 through 85 list the different groupings and which can be used with the y_metric you selected. Since aqbio_nt_total (number of taxa total fish) is used for this example, set sampres = “species”.

  10. In lines 87 through 90 you will choose the ELF methods to run. Setting a method equal to “YES” will run the model; setting it to “NO” prevents the model from running. To produce a plot from each method, set all four methods = “YES”.

  11. If running the Piecewise Iterative (pw_it) method, in lines 91 and 92, you set upper and lower bounds for the iterative function to look within for breakpoints in the data. These breakpoints are in the units of your x_metric. Set the glo = 1 and ghi = 530.

Clone this wiki locally