Lake Erie Walleye

Lake Erie is world-renowned for its Walleye (Sander vitreus) population and fishing. The Ohio Department of Natural Resources samples Walleye with gillnets from three regions of Lake Erie every fall. Their results from 2003-2014 are stored in this file from the fishR webpage. Metadata for the data file is here. The following tasks should be completed to prepare these data for further analysis.

  • The regional sampling location should be converted from their numerical codes (1, 2, 3) to their actual regional names.
  • A standard weight variable should be computed from the observed lengths with this formula – 0.00000352*LENGTH3.18.
  • A relative weight variable should be computed by dividing the observed weight by the calculated standard weight and multiplying by 100.
  • A new variable should be created that has the words under “status” based on the lengths under “length” below.
status lengths (mm)
substock 0-249
stock 250-379
quality 380-509
preferred 510-629
memorable 630-759
trophy 760+
  • The “stock status” variable (i.e., “substock”, “stock”, etc.) variable should be moved to immediately follow the length variable.
  • The standard and relative weight variables should be moved to immediately follow the observed weight variable.
  • The gear set identification, sampling grid location, and maturity variables should be removed.
  • The year variable should be moved to be the first variable.
  • The otolith age variable should be moved to be before the sex variable.

Your final data frame should like the following.

## # A tibble: 33,734 x 9
##     year loc             tl status      w    ws    wr   age sex   
##    <dbl> <chr>        <dbl> <chr>   <dbl> <dbl> <dbl> <dbl> <chr> 
##  1  2003 Toledo-Huron   360 stock     460  474.  97.1     2 male  
##  2  2003 Toledo-Huron   371 stock     571  521. 110.      2 male  
##  3  2003 Toledo-Huron   375 stock     507  539.  94.0     2 male  
##  4  2003 Toledo-Huron   375 stock     584  539. 108.      2 male  
##  5  2003 Toledo-Huron   375 stock     537  539.  99.5     2 male  
##  6  2003 Toledo-Huron   376 stock     553  544. 102.      2 male  
##  7  2003 Toledo-Huron   379 stock     500  558.  89.6     2 female
##  8  2003 Toledo-Huron   379 stock     522  558.  93.6     2 male  
##  9  2003 Toledo-Huron   380 quality   525  563.  93.3     2 male  
## 10  2003 Toledo-Huron   380 quality   543  563.  96.5     2 male  
## # ... with 33,724 more rows

 

Northern Wisconsin Frogs

A researcher at the Sigurd Olson Environmental Institute conducted a frog call survey in the late 1990s to better understand populations of frogs in northern Wisconsin. The study design required either a resource professional or a trained volunteer to sit at a site on randomly selected lakes and listen for frog calls. From listening to these calls the person would ascertain the number of individuals present of each eleven species of frogs. The surveys were repeated at each site between one and three times.

The data from this study is stored in FrogsSOEI.xlsx with information about the sampling locations in the “LakeInfo” sheet and results about the frogs for each sampling event in the “FrogResults” sheet. More detailed information about what is on each sheet is in the “meta” sheet.

Load the lake information sheet and make the following modifications. [Hint: Examine the spreadsheet closely and make sure to adjust for how missing values were coded in the spreadsheet.]

  • Fix all non-standard names.
  • Make the values in the development variables more informative.

Load the frog call results sheet and make the following modifications.

  • Fix all non-standard names.
  • Remove the comments variable.
  • Make the values in the surveyor variable more informative

Following these modifications to the frog results data frame create a new data frame with the following modifications

  • Create new variables that have the counts for each frog species in one variable and a related variable that has the name of the frog species in it. [Hint: this requires a pivot.]
  • Change the abbreviations in the new frog species variable to actual species names. [Hint: examine the meta sheet in the Excel workbook.]
  • Create a new “occurrence” variable that is “yes” if the species of frog was seen at that site on that date and “no” otherwise. [Hint: think how you can do this from your frog count variable.]
  • Make sure that the site/location name variable is left-most in the data frame.

Use the two modified data frames from above to add lake information (i.e., development, lake area, alkalinity, and ph) to the frog results. [Hint: This requires a join] Make sure the lake information immediately follows the site/location name.

In the end, your data frame should be similar to this one (same number of rows and columns, but perhaps different variable names).

## # A tibble: 2,904 x 14
##    site  type   Area   Alk    pH DATE                  Run air_temp water_temp
##    <chr> <chr> <dbl> <dbl> <dbl> <dttm>              <dbl>    <dbl>      <dbl>
##  1 Musk~ Deve~   2.4    20   6.8 1997-05-10 00:00:00     1       48         49
##  2 Musk~ Deve~   2.4    20   6.8 1997-05-10 00:00:00     1       48         49
##  3 Musk~ Deve~   2.4    20   6.8 1997-05-10 00:00:00     1       48         49
##  4 Musk~ Deve~   2.4    20   6.8 1997-05-10 00:00:00     1       48         49
##  5 Musk~ Deve~   2.4    20   6.8 1997-05-10 00:00:00     1       48         49
##  6 Musk~ Deve~   2.4    20   6.8 1997-05-10 00:00:00     1       48         49
##  7 Musk~ Deve~   2.4    20   6.8 1997-05-10 00:00:00     1       48         49
##  8 Musk~ Deve~   2.4    20   6.8 1997-05-10 00:00:00     1       48         49
##  9 Musk~ Deve~   2.4    20   6.8 1997-05-10 00:00:00     1       48         49
## 10 Musk~ Deve~   2.4    20   6.8 1997-05-10 00:00:00     1       48         49
## # ... with 2,894 more rows, and 5 more variables: Surveyor <chr>,
## #   pairVP <dbl>, species <chr>, count <dbl>, occurrence <chr>
## tibble [2,904 x 14] (S3: tbl_df/tbl/data.frame)
##  $ site      : chr [1:2904] "Muskellunge access" "Muskellunge access" "Muskellunge access" "Muskellunge access" ...
##  $ type      : chr [1:2904] "Developed" "Developed" "Developed" "Developed" ...
##  $ Area      : num [1:2904] 2.4 2.4 2.4 2.4 2.4 2.4 2.4 2.4 2.4 2.4 ...
##  $ Alk       : num [1:2904] 20 20 20 20 20 20 20 20 20 20 ...
##  $ pH        : num [1:2904] 6.8 6.8 6.8 6.8 6.8 6.8 6.8 6.8 6.8 6.8 ...
##  $ DATE      : POSIXct[1:2904], format: "1997-05-10" "1997-05-10" ...
##  $ Run       : num [1:2904] 1 1 1 1 1 1 1 1 1 1 ...
##  $ air_temp  : num [1:2904] 48 48 48 48 48 48 48 48 48 48 ...
##  $ water_temp: num [1:2904] 49 49 49 49 49 49 49 49 49 49 ...
##  $ Surveyor  : chr [1:2904] "Professional" "Professional" "Professional" "Professional" ...
##  $ pairVP    : num [1:2904] NA NA NA NA NA NA NA NA NA NA ...
##  $ species   : chr [1:2904] "American Toad" "Spring Peeper" "Wood Frog" "Northern Leopard Frog" ...
##  $ count     : num [1:2904] 0 0 0 0 0 0 0 0 0 0 ...
##  $ occurrence: chr [1:2904] "no" "no" "no" "no" ...