How can I fix and run "sigCVError" function ?
Entering edit mode
rekren ▴ 20
Last seen 3.7 years ago


I am using sigFeature package to apply SVM-RFE based feature selection method.

When I exactly follow the exemplary code of the package, I faced an issue on sigCVError function.

>featsweepSigFe = lapply(1:400, sigCVError, FeatureBasedonFrequency, inputdata)

Error in h(simpleError(msg, call)) :    error in evaluating the argument 'x' in selecting a method for function 'mean': argument "FUN" is missing, with no default

Can you help me to fix this issue, please?

Source-code of sigCVError function of sigFeature package and session info of mine;

> sigCVError

function (i, results, input) 
    stopifnot(!is.null(input) == TRUE)
    stopifnot(is.list(results) == TRUE, length(results) > 0)
    svm.list = lapply(results, function(x) tune(svm, train.x = input[x$, 
        1 + x$feature.ids[seq_len(i)]], train.y = input[x$, 
        1], validation.x = input[x$, 1 + x$feature.ids[seq_len(i)]], 
        validation.y = input[x$, 1], ranges = tune(svm, 
            train.x = input[x$, 1 + x$feature.ids[seq_len(i)]], 
            train.y = input[x$, 1], ranges = list(gamma = 2^(-12:0), 
                cost = 10^seq(-3, 1, by = 0.25)))$best.par, tunecontrol = tune.control(sampling = "fix"))$perf)
    error = mean(unlist(apply(svm.list, function(x) x$error)))
    errorSD = sd(unlist(apply(svm.list, function(x) x$error)))
    return(list(svm.list = svm.list, error = error, errorSD = errorSD))
<bytecode: 0x000001d52491ec98>
<environment: namespace:sigFeature>

sessionInfo() R version 4.0.1 (2020-06-06) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 18363)

Matrix products: default

locale: [1] LCCOLLATE=EnglishUnited Kingdom.1252 LCCTYPE=EnglishUnited Kingdom.1252 LCMONETARY=EnglishUnited Kingdom.1252 [4] LCNUMERIC=C LCTIME=English_United Kingdom.1252

attached base packages: [1] parallel stats4 stats graphics grDevices utils datasets methods base

other attached packages: [1] DESeq21.28.1 RColorBrewer1.1-2 pheatmap1.0.12 e10711.7-3
[5] SummarizedExperiment1.18.1 DelayedArray0.14.0 matrixStats0.56.0 Biobase2.48.0
[9] GenomicRanges1.40.0 GenomeInfoDb1.24.2 IRanges2.22.2 S4Vectors0.26.1
[13] BiocGenerics0.34.0 sigFeature1.6.0

loaded via a namespace (and not attached): [1] locfit1.5-9.4 Rcpp1.0.4.6 lattice0.20-41 class7.3-17 digest0.6.25
[6] R62.4.1 RSQLite2.2.0 ggplot23.3.2 pillar1.4.4 biocViews1.56.0
[11] zlibbioc1.34.0 rlang0.4.6 annotate1.66.0 SparseM1.78 blob1.2.1
[16] Matrix1.2-18 RUnit0.4.32 splines4.0.1 BiocParallel1.22.0 geneplotter1.66.0
[21] RCurl1.98-1.2 bit1.1-15.2 munsell0.5.0 compiler4.0.1 xfun0.14
[26] pkgconfig2.0.3 tidyselect1.1.0 tibble3.0.1 GenomeInfoDbData1.2.3 XML3.99-0.3
[31] crayon1.3.4 dplyr1.0.0 bitops1.0-6 grid4.0.1 RBGL1.64.0
[36] nlme3.1-148 xtable1.8-4 gtable0.3.0 lifecycle0.2.0 DBI1.1.0
[41] magrittr1.5 scales1.1.1 graph1.66.0 zip2.0.4 stringi1.4.6
[46] XVector0.28.0 genefilter1.70.0 ellipsis0.3.1 generics0.0.2 vctrs0.3.1
[51] openxlsx4.1.5 tools4.0.1 bit640.9-7 glue1.4.1 purrr0.3.4
[56] survival3.1-12 AnnotationDbi1.50.0 colorspace1.4-1 BiocManager1.30.10 memoise1.1.0
[61] knitr_1.28
sigFeature svm-rfe sigCVError feature selection • 411 views

Login before adding your answer.

Traffic: 627 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6