leppott / MBSStools

Suite of tools for data manipulation and calculations for Maryland DNR MBSS program.
https://leppott.github.io/MBSStools/
GNU General Public License v3.0
3 stars 3 forks source link

PHIcalc? example data seems corrupted #19

Closed ashtonmj closed 4 years ago

ashtonmj commented 5 years ago

Describe the bug Ran example code from PHIcalc? on 10/18/2018 in R 3.4.0 and see many NA in raw values for PHI data table. Referenced a handful of sites in database and see they should have data.

To Reproduce Steps to reproduce the behavior:

  1. Go to PHIcalc? http://127.0.0.1:11817/library/MBSStools/html/PHIcalc.html
  2. Copy and paste example code into R console and run
  3. Visually examine InStrmHab_020 for StationID 1:10
  4. See NA
  5. Those sites have Instream Habitat scores

Expected behavior Function ran as expected, but View(PHI) returns table of suspect data

Screenshots image

Desktop (please complete the following information):

leppott commented 4 years ago

The input data (MBSS.PHI) and output from the calculation (PHI) match for the NA values.

image

The input data comes from an Excel file and matches for number of blank cells (20/60 so 40 non-blank). The Excel file is in the "inst" folder, PHI Worksheet_from MP (Erik20170329).xls and is on the "R_Data" worksheet.

image

leppott commented 4 years ago

Added "testthat" for PHI calc.

Final result is fine for all 60 example samples.

image