Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metric.values - required fields (more than described in help) #13

Closed
leppott opened this issue Aug 9, 2018 · 4 comments
Closed

metric.values - required fields (more than described in help) #13

leppott opened this issue Aug 9, 2018 · 4 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@leppott
Copy link
Owner

leppott commented Aug 9, 2018

Describe the bug
The function metric.values doesn't work unless have more fields than specified in help file.

To Reproduce
Steps to reproduce the behavior:

  1. Use only the columns specified in the help file as your data input for metric.values.

col.help <- c("SAMPLEID, "TAXAID", "N_TAXA", "EXCLUDE", "SITE_TYPE", "NONTARGET", "PHYLUM", "CLASS", "ORDER", "FAMILY", "SUBFAMILY", "GENUS", "FFG", "HABIT", "LIFE_CYCLE", "TOLVAL", "BCG_ATTR")

  1. Will keep getting errors about missing fields until add the following.

col.needed <- c("INDEX_NAME", "SITE_TYPE", "THERMAL_INDICATOR", "SUBPHYLUM", "TRIBE").

Expected behavior
Would be beneficial to:

  1. check for all required fields in the function and return an error code if missing.

  2. Have all required fields stated in the help file.

Screenshots
image

Desktop (please complete the following information):
image

@leppott leppott self-assigned this Aug 9, 2018
@leppott leppott added bug Something isn't working enhancement New feature or request labels Aug 9, 2018
@leppott
Copy link
Owner Author

leppott commented Aug 28, 2018

Possible code fix.

  • Check for required fields.

  • Present to user the missing fields. Ask for user input to continue (Y/N). Warn user of dangers of continuing (i.e., some metric values will be inaccurate, e.g., habit metrics if don't have the habit field).

  • If continue add the missing fields with zero or NA values.

@leppott
Copy link
Owner Author

leppott commented Aug 28, 2018

col.req <- c("SAMPLEID, "TAXAID", "N_TAXA", "EXCLUDE", "INDEX_NAME", "SITE_TYPE", "NONTARGET", "PHYLUM", "SUBPHYLUM", "CLASS", "ORDER", "FAMILY", "SUBFAMILY", "TRIBE", "GENUS", "FFG", "HABIT", "LIFE_CYCLE", "TOLVAL", "BCG_ATTR", "THERMAL_INDICATOR")

leppott added a commit that referenced this issue Aug 28, 2018
metric.values missing fields.  Issue #13
@leppott
Copy link
Owner Author

leppott commented Aug 28, 2018

Add QC check for missing fields. Used "utils::menu" to prompt user. Added missing fields if continue but have warning message if continue with missing fields.

Renamed "FAMILY" to "FAMILYY" to showcase error new error checking (screenshots below).

image

image

@leppott leppott closed this as completed Aug 28, 2018
@leppott
Copy link
Owner Author

leppott commented Aug 29, 2018

Still have to update Vignette.

@leppott leppott reopened this Aug 29, 2018
leppott added a commit that referenced this issue Sep 5, 2018
Update Vignette for data munging exmaple (Issue #14 ), require fields for metric.values (Issue #13), selecting metrics (Issue #15), and text for metric.values.
@leppott leppott closed this as completed Sep 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant