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

Add error check to verify that visit identities are unique #158

Open
drnickisaac opened this issue Apr 24, 2019 · 0 comments
Open

Add error check to verify that visit identities are unique #158

drnickisaac opened this issue Apr 24, 2019 · 0 comments

Comments

@drnickisaac
Copy link
Contributor

Julie Sheard (and @galinajonsson ) have both been creating data for occDetFunc outside of formatOccData, in order to integrate multiple data types. Julie has run into a problem in which the visits are not unique (i.e. an error in her data prep code). It should be very easy to check this and return a useful error message. In fact, there are two checks:

nrow(occDetdata) == nrow(spp_vis)
length(unique(occDetdata$visit)) == nrow(occDetdata)
length(unique(spp_vis$visit)) == nrow(spp_vis)

If these checks fail, it should be easy to return an informative error, such as:

temp <- table(spp_vis$visit)
paste(sum(table(temp)[-1]), " visits are duplicated in the spp_vis table")
paste("duplicate visits include", head(names(temp)[temp>1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants