Skip to content

Commit

Permalink
follow CRAN directions to include system package data
Browse files Browse the repository at this point in the history
  • Loading branch information
iskandari committed Jul 16, 2024
1 parent 2010996 commit 39b4612
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 45 deletions.
2 changes: 0 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ Suggests:
tidyselect,
vdiffr,
vol2birdR
Remotes:
github::adokter/vol2birdR@cran_upload
LazyData: true
Encoding: UTF-8
VignetteBuilder: knitr
Expand Down
8 changes: 0 additions & 8 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ S3method(rcs,vpts)
S3method(sd_vvp_threshold,list)
S3method(sd_vvp_threshold,vp)
S3method(sd_vvp_threshold,vpts)
S3method(select,pvol)
S3method(select,scan)
S3method(summary,param)
S3method(summary,ppi)
S3method(summary,pvol)
Expand Down Expand Up @@ -147,14 +145,8 @@ export(select_vpfiles)
export(sunrise)
export(sunset)
export(update_docker)
export(validate_vpts)
export(vol2bird_version)
export(write_pvolfile)
importFrom(dplyr,"%>%")
importFrom(dplyr,.data)
importFrom(dplyr,select)
importFrom(glue,glue)
importFrom(methods,as)
importFrom(readr,read_csv)
importFrom(stats,na.omit)
importFrom(stringr,str_detect)
1 change: 0 additions & 1 deletion R/as.vpts.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#'
#' @param data a dataframe created from a VPTS CSV file
#' @returns a bioRad vpts object
#' @importFrom glue glue
#' @examples
#' # locate example file in VPTS CSV format:
#' df <- read.csv(system.file("extdata", "example_vpts.csv", package = "bioRad"))
Expand Down
4 changes: 0 additions & 4 deletions R/hooks.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
register_all_s3_methods() # dynamically registers non-imported pkgs (tidyverse) # nocov
}

.onLoad <- function(libname, pkgname) {
data("vpts_schema", package=pkgname, envir=parent.env(environment()))
}

.onAttach <- function(libname, pkgname) {
packageStartupMessage(paste("Welcome to", pkgname, "version", utils::packageVersion(pkgname)))
if (rlang::is_installed("vol2birdR")) {
Expand Down
4 changes: 2 additions & 2 deletions R/select.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# generalizations for the dplyr verb `select` to `scan` and `pvol` objects
#' @exportS3Method
#' @keywords internal
select.scan <- function(.data, ...) {
if (!requireNamespace("dplyr", quietly = TRUE)) {
stop("package dplyr required, please install it first") # nocov
Expand All @@ -16,7 +16,7 @@ select.scan <- function(.data, ...) {
.data
}

#' @exportS3Method
#' @keywords internal
select.pvol <- function(.data, ...) {
.data$scans <- lapply(.data$scans, select.scan, ...)
.data
Expand Down
9 changes: 3 additions & 6 deletions R/validate_vpts.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,16 @@ validate_datetime_format <- function(data, format) {
#' Validate dataframe against VPTS schema
#'
#' @param df The dataframe to validate.
#'
#' @noRd
#' @return Invisibly returns a list with validation results including messages for any issues found.
#' @keywords internal
#' @examples
#' my_vpts <- as.data.frame(example_vpts)
#' validate_vpts(my_vpts)
validate_vpts <- function(df) {
schema <- vpts_schema
schema <- bioRad::vpts_schema
required_fields <- schema$fields$name[schema$fields$constraints.required ==
TRUE]
all_fields <- schema$fields$name
df_fields <- names(df)

# Check for missing required fields
missing_required <- setdiff(required_fields, df_fields)
if (length(missing_required) > 0) {
Expand Down
Binary file modified data/vpts_schema.rda
Binary file not shown.
22 changes: 0 additions & 22 deletions man/validate_vpts.Rd

This file was deleted.

0 comments on commit 39b4612

Please sign in to comment.