Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 205399

devtools::check() F used instead of FALSE Execution halted ,R

$
0
0

my function and comment is:

#' @examples  check_duplication(iris,col_names = "Sepal.Length",check_type = F)
#             check_duplication(iris,col_names = "Sepal.Width")
check_duplication <- function(data,col_names,check_type=T){

  if(check_type){ data <- as.data.frame(data)}
  duplicate_nums<- nrow(data)-nrow(as.data.frame(base::unique(data[,col_names])))

  return(duplicate_nums)
}

it works will on testthat test and console when i used devtools::check(), it reports error

i know when i use F instead False ,this error would'd happan, but what cause this matter?

checking examples ... ERROR
  Running examples in ‘datools-Ex.R’ failed
  The error most likely occurred in:

  > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
  > ### Name: check_duplication
  > ### Title: check data unique
  > ### Aliases: check_duplication
  > 
  > ### ** Examples
  > 
  >  check_duplication(iris,col_names = "Sepal.Length",check_type = F)
  Error in check_duplication(iris, col_names = "Sepal.Length", check_type = F) : 
    F used instead of FALSE
  Execution halted

i have two question :

  1. how to solve this error
  2. what's difference between TRUE and F in R

thanks for your help ~


Viewing all articles
Browse latest Browse all 205399

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>