R ||包:具有多个参数的函数的用法

问题描述

在R包中,我有一个接受许多参数函数。根据其性质,它们的认值为NULL或TRUE / FALSE。除了我定义@usage R CMD CHECK表示将存在所有参数外,一切看起来都不错。它以不同的方式出错:

 Mismatches in argument names:
Codoc mismatches from documentation object

出于各种原因,我想避免使用它:1)太长了,2)当我在@examples中提供示例时,它可能会使用户感到困惑

#' @title many_params
#' @description The function returns a matrix
#' @usage many_params(data_genetic,data_snp_annotation,keep_samples=NULL,remove_genes=NULL,exclude_SNP=NULL,impute_missing=FALSE,default_method="median")
#'
many_params<-function(data_genetic,default_method="median"){

@export

#' @param data_genetic a dataframe for genetic 
#' @param data_genetic a dataframe for data_snp_annotation where columns are present
#' @param keep_samples details
#' @param remove_genes details
#' @param exclude_SNP details
#' @param impute_missing details
#' @param default_method is mean (activated only when impute_missing =TRUE)
##do many things
#' @examples
#'
return(data_genetic)

}
#

我尝试使用@usage many_params(data_genetic,...),但在R CMD检查中产生了错误。 R-4.0。

如何在不指定所有参数并通过R CMD CHECK的情况下保持较小的使用量? 谢谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)