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

Missing data in the Aspect field of the Locations table makes Aspect a text field #211

Open
johnpauls opened this issue Aug 31, 2020 · 3 comments
Assignees
Labels
data analysis need Issue with data that will likely impact ongoing analysis export issue P3 - Medium Priority 3 - Issue is a medium priority to resolve S3 - Moderate Severity 3 - Issue has limited impact or blocks unimportant features

Comments

@johnpauls
Copy link
Member

In the locations table there is an aspect field that indicates what direction the plot is facing. Typically this field is numeric - degrees between 0 and 360. There are 2 cases when it can be something else:

  1. If the aspect of the plot has not yet been determined then there is no data for the field.
  2. If the plot has a slope of 0, then the plot is flat and by definition it has no aspect.

Currently when the slope is 0, the database is putting "N/A" in the aspect field. When this is imported into R it make all the data into text. If this was switched to NA (no slash) then R would read that as missing data and keep the rest numeric.

There may be other solutions as well, but preventing the conversion to Text is what is needed.

@johnpauls johnpauls added data analysis need Issue with data that will likely impact ongoing analysis export issue P3 - Medium Priority 3 - Issue is a medium priority to resolve S3 - Moderate Severity 3 - Issue has limited impact or blocks unimportant features labels Aug 31, 2020
@blcampbell blcampbell added this to the 2020 Pre-Season Updates milestone Sep 1, 2020
@blcampbell blcampbell self-assigned this Sep 1, 2020
@blcampbell
Copy link
Contributor

@johnpauls
Some questions for identifying how these should be adjusted.

  • How do the 0 and 360 aspects differ?
    Seems they would be the same, if so why 2 numbers? (considering a circle, 0 and 360 coincide)
  • Would a 0 slope with a 0 aspect make sense for flat plots?
    Or would this have other impacts?

If the answers don't otherwise dictate, a flat plot could be set w/ aspect 0.
This would eliminate the need for text and allow the aspect field to be tightened to handle numbers only.
Missing aspects from the past could be identified by NULL values which have an associated missing value flag.
Aspects for the future could then be required so that NULL values wouldn't be allowed for additional new plots.

Thoughts?

@johnpauls
Copy link
Member Author

@blcampbell

  • We don't use an aspect of 0 degrees. 360 is used for straight North, so the lowest number in the aspect field in 1

  • The issue with 0 in the aspect field is that it would very easily be confused with North. Someone could, for instance, look for any plot with an aspect > 350 or < 10 and pull up plots with a 0 aspect.

I am not sure how requiring an aspect would work. That is something we measure in the field, so typically we would pull up an existing plot and then enter the data. Would aspect need to be measured before the plot could be in the database?

@blcampbell
Copy link
Contributor

@johnpauls

So the actual range for aspect is 1-360 vs. 0-360.

Based on this, the only way to 'require' the location record to have an aspect would be to force users to include this value in the data entry form when the info is updated. In general, a field in a table cannot be changed to required unless all of the records have a value for it. (Doing so can drop records that don't have a value in the newly required field.)

Since 0 isn't viable and has other unintended consequences, requiring aspect in the form would mean that a user entering data would need to add the aspect value every time slope > 0. The two would need to be tied (they may already be - need to investigate).

For 0 slope plots, a flag would need to be entered to identify the plot aspect as NA and not simply missing.
This would result in a flag record for the aspect of the plot and a NULL value in the plot's aspect field.

Exports will require a discussion of the latest flagging views which display both the field & the flag for the field. In this case the location record would display ...slope, slope_flag, aspect, aspect_flag...
Example
.... slope, slope_flag, aspect, aspect_flag ...
.... 35, NULL, 22, NULL ...
.... 10, NULL, NULL, 99805 ...
.... 0, NULL, NULL, 99880 ...
where 99805 would be the flag for missing aspect data, 99880 the flag for NA with a 0 slope.
Broader discussion will be needed to make sure exports work well w/ R code while meeting this field, field_flag pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data analysis need Issue with data that will likely impact ongoing analysis export issue P3 - Medium Priority 3 - Issue is a medium priority to resolve S3 - Moderate Severity 3 - Issue has limited impact or blocks unimportant features
Projects
None yet
Development

No branches or pull requests

2 participants