devtools::check() => How to resolve "missing arguments not allowed in calls to list" for R package development?
1
0
Entering edit mode
mnabian • 0
@mnabian-21969
Last seen 4.3 years ago

I am creating an R package and trying to run devtools::check(). The generated NOTE appear as follows :

checking R code for possible problems ... NOTE myFunction: missing arguments not allowed in calls to ‘list’

How to know which argument is missing? What does that even mean? I have a large function with many variables.

Here is part of the function: It is basically creating an html-report for my bioinformatics analysis.


cAMARETTO_HTMLreport <- function(cAMARETTOresults,
                                cAMARETTOnetworkM,
                                cAMARETTOnetworkC,
                                PhenotypeTablesList = NULL,
                                output_address ="./",
                                HTMLsAMARETTOlist = NULL,
                                CopyAMARETTOReport = TRUE,
                                hyper_geo_reference = NULL,
                                hyper_geo_reference_gp = NULL,
                                hyper_geo_reference_cp = NULL,
                                driverGSEA = TRUE,
                                NrCores=2){

    ##################################### Bioconductor Considerations :
    Run_Names <- AMARETTOres <- Weights <- Color<- Type<- GeneNames<-NULL
    GeneName <- Community <- TypeColored <- Community_key<-NULL
    Community_type<- ModuleNr<-NULL
    ModuleName <- Run <- Genes <- q.value<-NULL
    #####################################

    RunInfoList<-InitialCheckInputs(cAMARETTOresults=cAMARETTOresults,
                                    output_address,
                                    HTMLsAMARETTOlist=cAMARETTOresults,
                                    CopyAMARETTOReport,
                                    hyper_geo_reference,
                                    hyper_geo_reference_gp,
                                    hyper_geo_reference_cp)
    RunInfo<-RunInfoList$RunInfo
    RunInfo2<-RunInfoList$RunInfo2
    full_path<-RunInfoList$full_path
    HTMLsAMARETTOlist<-RunInfoList$HTMLsAMARETTOlist
    #====================================================================
    # Extract main dataframes
    com_gene_df<-suppressWarnings(
        ComRunModGenInfo(cAMARETTOresults,cAMARETTOnetworkM,
                        cAMARETTOnetworkC))
    comm_info <-suppressWarnings(
        cAMARETTO_InformationTable(cAMARETTOnetworkM,cAMARETTOnetworkC))
    #====================================================================
    Runs_AMARETTOs_info<-com_gene_df%>%
        dplyr::select(Run_Names,AMARETTOres)%>%
        dplyr::distinct()%>%
        dplyr::mutate(Run_Names = RunHyperLink(Run_Names,AMARETTOres,
                    HTMLsAMARETTOlist,CopyAMARETTOReport))%>%
                        filter(AMARETTOres==1)%>%select(Run_Names)
    #====================================================================
    ComModulesLink<-CommunityModuleTableCreate(cAMARETTOresults,
                                                cAMARETTOnetworkM, 
                                                cAMARETTOnetworkC,
                                                HTMLsAMARETTOlist,
                                                CopyAMARETTOReport)
    #====================================================================
 ...
}

software error • 489 views
ADD COMMENT
2
Entering edit mode
@martin-morgan-1513
Last seen 21 days ago
United States

If this is a question about Bioconductor package development then please ask on the bioc-devel mailing list. If it's about general R usage try the r-help or R-pkg-devel mailing list or StackOverflow.

I'd guess the check is complaining about something like list(foo,,bar) or list(foo,) where there is an implied argument but it is not present; note that this generates an error in R

list(1,)

so probably indicates an opportunity for a unit test / example that covers this part of the code.

ADD COMMENT
0
Entering edit mode

Thank you so much @Martin Morgan. You were indeed right and one of my lists was in wrong format: list(a,) changed to list(a) and it and I don't get the error anymore.

Many Thanks Mohsen

ADD REPLY
0
Entering edit mode

Thank you so much @Martin Morgan. You were indeed right and one of my lists was in wrong format: list(a,) changed to list(a) and it and I don't get the error anymore.

Many Thanks Mohsen

ADD REPLY

Login before adding your answer.

Traffic: 388 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6