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

54 recommended function length #83

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ check_arg <- function(arg, allow_class = c("character"), allow_len = NULL) {

#' Read in data if an object looks like path to it.
#'
#' @param obj
#' @return obj the object itself in case its not a character
#' @param obj Object to read if not already object
#' @return obj Object itself in case its not a character
read_if_char <- function(obj) {
if (is(obj, "character")) {
obj <- read.csv(obj, stringsAsFactors = FALSE)
Expand Down
18 changes: 18 additions & 0 deletions man/check_arg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions man/conv_py_bools.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions man/create_rl_map_cellphonedb.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions man/read_if_char.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 12 additions & 13 deletions tests/testthat/test-import_fxns.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,37 +79,36 @@ test_that("building a domino object under set parameters", {
})

test_that("create_rl_map_cellphonedb fails on wrong input arg type.", {
load(test_path("testdata", "sysdata.rda"))

expect_error(create_rl_map_cellphonedb(
genes = list(), proteins = proteins_test,
interactions = interactions_test, complexes = complexes_test
genes = list(), proteins = proteins_tiny,
interactions = interactions_tiny, complexes = complexes_tiny
))

expect_error(create_rl_map_cellphonedb(
genes = genes_test, proteins = list(),
interactions = interactions_test, complexes = complexes_test
genes = genes_tiny, proteins = list(),
interactions = interactions_tiny, complexes = complexes_tiny
))

expect_error(create_rl_map_cellphonedb(
genes = genes_test, proteins = proteins_test,
interactions = list(), complexes = complexes_test
genes = genes_tiny, proteins = proteins_tiny,
interactions = list(), complexes = complexes_tiny
))

expect_error(create_rl_map_cellphonedb(
genes = genes_test, proteins = proteins_test,
interactions = interactions_test, complexes = list()
genes = genes_tiny, proteins = proteins_tiny,
interactions = interactions_tiny, complexes = list()
))

expect_error(create_rl_map_cellphonedb(
genes = genes_test, proteins = proteins_test,
interactions = interactions_test, complexes = complexes_test,
genes = genes_tiny, proteins = proteins_tiny,
interactions = interactions_tiny, complexes = complexes_tiny,
database_name = list()
))

expect_error(create_rl_map_cellphonedb(
genes = genes_test, proteins = proteins_test,
interactions = interactions_test, complexes = complexes_test,
genes = genes_tiny, proteins = proteins_tiny,
interactions = interactions_tiny, complexes = complexes_tiny,
database_name = c("length", ">1")
))
})