-
Notifications
You must be signed in to change notification settings - Fork 17
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
bird insect partitioning and post-hoc precipitation filter #698
Open
adokter
wants to merge
27
commits into
master
Choose a base branch
from
bird_insect_mixture
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+723
−12
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
720046b
add prototype clean_mixture function
adokter 0768d8b
add documentation
adokter 0c9d859
add assertions
adokter db10191
update to new formulation in paper
adokter a75688b
Merge branch 'master' into bird_insect_mixture
adokter 52d339c
add vp and vpts method for clean_mixture
adokter effb25c
add missing arguments, rebuild documentation
adokter d6bd140
fix access to rcs attribute
adokter da72750
expand examples
adokter 633c74b
add posthoc precipitation filter
adokter 0903089
update defaults
adokter 16f664c
Merge branch 'master' into bird_insect_mixture
adokter cc5ba25
Merge branch 'master' into bird_insect_mixture
adokter 886261c
Merge branch 'master' into bird_insect_mixture
adokter 557662d
fix type of gap field
adokter 2ccba65
add as.vp() function
adokter 58ce948
update documentation clean_mixture() and add tests
adokter c91a494
Merge branch 'master' into bird_insect_mixture
adokter f6f3e8a
update news
adokter 60101bf
Merge branch 'bird_insect_mixture' of https://github.com/adokter/bioR…
adokter 4f3056f
add missing functions
adokter e961351
fix devtools::check() notes and warnings
adokter 9d2ce32
update news
adokter af0e181
fix yaml
adokter aa51101
fix typo
adokter a67e89c
small documentation improvements
adokter 77ef402
documentation fix [skip actions]
adokter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#' Convert a dataframe into a vp object | ||
#' | ||
#' @param data a dataframe created from a VPTS CSV file | ||
#' @returns a bioRad vp object | ||
#' @examples | ||
#' # load vp data as a data.frame: | ||
#' df <- as.data.frame(example_vp) | ||
#' # convert the data.frame to a vp object: | ||
#' as.vp(df) | ||
#' @export | ||
as.vp <- function(data) { | ||
assertthat::assert_that(inherits(data,"data.frame")) | ||
|
||
vpts <- as.vpts(data) | ||
|
||
assertthat::assert_that(length(vpts$datetime) == 1, msg="multiple timestamps found, data is not a single vertical profile") | ||
|
||
vpts_to_vp(vpts) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
test_that("as.vp() returns valid data", { | ||
df <- as.data.frame(example_vp, suntime=FALSE) | ||
expect_s3_class(as.vp(df), "vp") | ||
df <- as.data.frame(example_vpts, suntime=FALSE) | ||
expect_error(as.vp(df),"not a single vertical profile") | ||
}) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might want to extent this check to if height bins are duplicated. Also do height bins need to be regularly spaced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe those checks are performed already by as.vpts() which is used under the hood, but I'll double check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rows can be removed, so no check for regular spacing currently:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
related to #697, which requires a fix before next release