Git Product home page Git Product logo

biocgenerics's Introduction

BiocGenerics is an R/Bioconductor package that defines many S4 generic functions used in Bioconductor.

See https://bioconductor.org/packages/BiocGenerics for more information including how to install the release version of the package (please refrain from installing directly from GitHub).

biocgenerics's People

Contributors

andrewwbutler avatar dtenenba avatar hpages avatar jwokaty avatar mtmorgan avatar nhayden avatar nturaga avatar vobencha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

biocgenerics's Issues

which() generic conflicts with that from Matrix

Consider the following:

library(BiocGenerics)
which # says it's defined in BiocGenerics

library(Matrix)
which # says it's defined in base

This has the following consequences:

library(GenomicRanges)
example(GRanges, echo=FALSE)
which(seqnames(gr) %in% "chr2") # all is well

library(Matrix)
which(seqnames(gr) %in% "chr2")
## Error in which(seqnames(gr) %in% "chr2") :
##   argument to 'which' is not logical

Not sure what the best solution is but at worst we could just use the Matrix version of the generic.

Session information
R Under development (unstable) (2020-02-18 r77829)
Platform: x86_64-apple-darwin17.7.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS:   /Users/luna/Software/R/trunk/lib/libRblas.dylib
LAPACK: /Users/luna/Software/R/trunk/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] Matrix_1.2-18        GenomicRanges_1.39.2 GenomeInfoDb_1.23.13
[4] IRanges_2.21.3       S4Vectors_0.25.12    BiocGenerics_0.33.0

loaded via a namespace (and not attached):
[1] zlibbioc_1.33.1        compiler_4.0.0         tools_4.0.0
[4] XVector_0.27.0         GenomeInfoDbData_1.2.2 RCurl_1.98-1.1
[7] grid_4.0.0             bitops_1.0-6           lattice_0.20-40

R-devel

Hi, since this commit (69e6fad) it seems that the R-devel travis ci gives an warning if one uses the base which function and importing BiocGenerics.
See here for more information on it.

https://support.bioconductor.org/p/131811/

The warning is as follows:

Warning: multiple methods tables found for 'which'

Thank you in anticipation for sorting this out.

Best regards

Kristian Ullrich

Why S4 generics out of parallel's cluster functions?

It was added eight years ago, but I'm curious what's the reason for making S4 generics out of the parallel functions https://github.com/Bioconductor/BiocGenerics/blob/master/R/clusterApply.R resulting in:

> library(BiocGenerics)
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap, parApply,
    parCapply, parLapply, parLapplyLB, parRapply, parSapply, parSapplyLB

Is that really needed? Doesn't that just add unnecessary noise?

Support glue objects in base-masking functions

I have spent ~2 hours today trimming down a large code base to essentially this failing example code:

for (i in seq(2)) {
    message(basename(glue::glue("/some/file")))
    # ...
    suppressPackageStartupMessages(library(BiocGenerics))
    # ...
}

which fails in the second iteration:

file
Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘path’ for signature ‘"glue"’
Calls: fun ... message -> basename -> basename -> path -> <Anonymous>
Execution halted

Life would have been much easier if BiocGenerics functions masking base functions supported at least the same set of inputs:

glue_file <- glue::glue("/some/file")
base::basename(glue_file)         # works
BiocGenerics::basename(glue_file) # fails

as.data.frame generic for signature DataFrame

I am building a package for bioconductor that works with singleCellExperiment objects and I have come across an issue with the conversion from DataFrame to data.frame. Specifically, because column names of a matrix can be duplicated, the row names of colData(sce) which are stored as a DataFrame can also be duplicated. The conversion to data.frame via the as.data.frame method always produces valid rownames via make.unique.

My issue (really an enhancement request) is that I would like this particular situation to throw an error by supplying the make.names = FALSE to as.data.frame, unfortunately all ... are ignored by the current version of the method. As I'm aware that handling some but not all ... arguments would cause confusion, I would like to request that make.names be exposed which would match the base S3 method for class 'matrix'.

as.data.frame.integer(x) is deprecated

Hi Hervé,

I am confused about an error on my topdownr package caused by as.data.frame generic:

https://bioconductor.org/checkResults/devel/data-experiment-LATEST/topdownrdata/nebbiolo1-checksrc.html

Warning in as.data.frame.numeric(value, row.names = row.names, optional = optional, :
Direct call of 'as.data.frame.numeric()' is deprecated. Use 'as.data.frame.vector()' or 'as.data.frame()' instead
Error in value[3L] :
converted from warning: Direct call of 'as.data.frame.numeric()' is deprecated. Use 'as.data.frame.vector()' or 'as.data.frame()' instead

The backtrace of one of my unit tests is:

── Warning (test_utils.R:158:5): .groupByLabels ────────────────────────────────
Direct call of 'as.data.frame.integer()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
Backtrace:
     ▆
  1. ├─testthat::expect_equal(...) at test_utils.R:158:5
  2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
  3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
  4. └─topdownr:::.groupByLabels(DF, c("ID", "LE"))
  5.   ├─BiocGenerics::as.data.frame(x) at topdownr/R/utils.R:241:5
  6.   └─S4Vectors::as.data.frame(x)
  7.     └─S4Vectors (local) .local(x, row.names, optional, ...)
  8.       ├─BiocGenerics::lapply(...)
  9.       └─base::lapply(...)
 10.         └─S4Vectors (local) FUN(X[[i]], ...)
 11.           ├─BiocGenerics::as.data.frame(col, optional = optional)
 12.           ├─base::as.data.frame(col, optional = optional)
 13.           └─base::as.data.frame.integer(col, optional = optional)
 14.             └─base::.Deprecated(...)Do you have a

A MWE:

x <- 1L:3L

as.data.frame(x)
#>   x
#> 1 1
#> 2 2
#> 3 3

library("BiocGenerics")
#> 
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:stats':
#> 
#>     IQR, mad, sd, var, xtabs
#> The following objects are masked from 'package:base':
#> 
#>     anyDuplicated, aperm, append, as.data.frame, basename, cbind,
#>     colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
#>     get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
#>     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
#>     Position, rank, rbind, Reduce, rownames, sapply, setdiff, table,
#>     tapply, union, unique, unsplit, which.max, which.min

as.data.frame(x)
#> Warning in as.data.frame.integer(x): Direct call of 'as.data.frame.integer()'
#> is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
#>   x
#> 1 1
#> 2 2
#> 3 3

Created on 2024-03-15 with reprex v2.1.0

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R Under development (unstable) (2024-03-15 r86132)
#>  os       Debian GNU/Linux 12 (bookworm)
#>  system   x86_64, linux-gnu
#>  ui       X11
#>  language en
#>  collate  de_DE.UTF-8
#>  ctype    de_DE.UTF-8
#>  tz       Europe/Berlin
#>  date     2024-03-15
#>  pandoc   2.19.2 @ /home/sebastian/.guix-profile/bin/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package      * version date (UTC) lib source
#>  BiocGenerics * 0.49.1  2023-11-01 [1] Bioconductor
#>  cli            3.6.2   2023-12-11 [1] CRAN (R 4.4.0)
#>  digest         0.6.35  2024-03-11 [1] CRAN (R 4.4.0)
#>  evaluate       0.23    2023-11-01 [1] CRAN (R 4.4.0)
#>  fastmap        1.1.1   2023-02-24 [1] CRAN (R 4.4.0)
#>  fs             1.6.3   2023-07-20 [1] CRAN (R 4.4.0)
#>  glue           1.7.0   2024-01-09 [1] CRAN (R 4.4.0)
#>  htmltools      0.5.7   2023-11-03 [1] CRAN (R 4.4.0)
#>  knitr          1.45    2023-10-30 [1] CRAN (R 4.4.0)
#>  lifecycle      1.0.4   2023-11-07 [1] CRAN (R 4.4.0)
#>  reprex         2.1.0   2024-01-11 [1] CRAN (R 4.4.0)
#>  rlang          1.1.3   2024-01-10 [1] CRAN (R 4.4.0)
#>  rmarkdown      2.26    2024-03-05 [1] CRAN (R 4.4.0)
#>  sessioninfo    1.2.2   2021-12-06 [1] CRAN (R 4.4.0)
#>  withr          3.0.0   2024-01-16 [1] CRAN (R 4.4.0)
#>  xfun           0.42    2024-02-08 [1] CRAN (R 4.4.0)
#>  yaml           2.3.8   2023-12-11 [1] CRAN (R 4.4.0)
#> 
#>  [1] /home/sebastian/opt/R/lib/R/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────

I looked at the as.data.frame generic which is just setGeneric("as.data.frame", signature="x"). Any idea to fix this?

Best wishes,

Sebastian

No need to refer to scater::normalize anymore

I was wondering why scater and SingleCellExperiment had rev-suggests from BiocGenerics, but scater::normalize is now defunct so these are no longer relevant.

IMO this generic is far too... generic for a relatively complex analytical step, but what's done is done.

version error when using BiocGenerics in shinyapps.io deployment

I have started to receive the following error with my automatic deployment script to shinyapps:

Screenshot from 2022-11-30 10-50-54

I am using R version 4.2.1, which has remained consistent for my previous deployments. Based on the Bioconductor version being used (3.16), it should be able to download the correct version using Github Actions.

`%in%` conflict

Hello,

I noticed an issue arises when trying to subset a GRanges object after BiocGenerics is attached (in this case by regioneR::getGenome).

Reprex1

The following produces an error when running it from within a one of my package's functions (but, oddly, not when I run it line-by-line):

if(!require("regioneR")) BiocManager::install("regioneR")

func <- function(chroms =  c("chr6", "chr8")){  

        all_chrom <- regioneR::getGenome(genome ="hg19")
        
        select_chrom <- all_chrom[GenomicRanges::seqnames(all_chrom) %in% chroms, ]
        return(select_chrom)
 }
func()

Error

error in evaluating the argument 'i' in selecting a method for function '[': 'match' requires vector arguments

Full console output

Here is the full console output when running from within my R package.
You can see that the error occurs right after BiocGenerics gets attached.

Querying 1 samples.

Query: GSM4703766 
Using build: hg19
Determining available file types.
Setting options('download.file.method.GEOquery'='auto')
Setting options('GEOquery.inmemory.gpl'=FALSE)
1 supplementary file(s) found: 
 - GSM4703766_GAWSU510-A549-H3K4me3-ChIP-rep2_AGTCAA_GAWSU510_CKDL200157349-1a-13_HC3LFBBXX_L2_PE_R1-2.fastq.sam_noDup_RPBM.bedgraph.gz
Computing peaks from bedGraph file.
Importing chromosomes: chr6
'getOption("repos")' replaces Bioconductor standard repositories, see '?repositories'
for details

replacement repositories:
    CRAN: https://cran.rstudio.com/


Attaching package: 'BiocGenerics'

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    anyDuplicated, append, as.data.frame, basename, cbind, colnames, dirname,
    do.call, duplicated, eval, evalq, Filter, Find, get, grep, grepl,
    intersect, is.unsorted, lapply, Map, mapply, match, mget, order, paste,
    pmax, pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rownames,
    sapply, setdiff, sort, table, tapply, union, unique, unsplit, which.max,
    which.min


Attaching package: 'S4Vectors'

The following objects are masked from 'package:base':

    expand.grid, I, unname


Attaching package: 'Biostrings'

The following object is masked from 'package:base':

    strsplit

The masked version of 'hg19' is not installed. Using the unmasked version. This means that no automatic masking will be available.
+ Selecting available chromosomes.
error in evaluating the argument 'i' in selecting a method for function '[': 'match' requires vector argumentsSaving results ==>  /var/folders/zq/h7mtybc533b1qzkys_ttgpth0000gn/T//RtmpdxqwBu/file832c2b34218grl.hg38.rds

Potential source

I think this might have something to do with different behaviours between S4Vectors::%in% and BiocGenerics::%in%

Temporary solution

Using grepl instead of %in% seems to work ok, both within and outside of my package function.

select_chrom <-  all_chrom[grepl(paste(paste0("^",chroms,"$"),collapse = "|"),
                        as.character(GenomicRanges::seqnames(all_chrom))), ]

Best,
Brian

Session info

R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

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

other attached packages:
 [1] regioneR_1.26.1                   BSgenome.Hsapiens.UCSC.hg19_1.4.3
 [3] BSgenome_1.62.0                   rtracklayer_1.54.0               
 [5] Biostrings_2.62.0                 XVector_0.34.0                   
 [7] GenomicRanges_1.46.1              GenomeInfoDb_1.30.1              
 [9] IRanges_2.28.0                    S4Vectors_0.32.4                 
[11] BiocGenerics_0.40.0              

loaded via a namespace (and not attached):
  [1] utf8_1.2.2                    reticulate_1.24-9000         
  [3] R.utils_2.11.0                tidyselect_1.1.2             
  [5] RSQLite_2.2.11                AnnotationDbi_1.56.2         
  [7] htmlwidgets_1.5.4             grid_4.1.0                   
  [9] BiocParallel_1.28.3           XGR_1.1.8                    
 [11] munsell_0.5.0                 DT_0.22                      
 [13] colorspace_2.0-3              OrganismDbi_1.36.0           
 [15] Biobase_2.54.0                filelock_1.0.2               
 [17] MACSr_1.2.0                   knitr_1.38                   
 [19] supraHex_1.32.0               rstudioapi_0.13              
 [21] DescTools_0.99.44             MatrixGenerics_1.6.0         
 [23] GenomeInfoDbData_1.2.7        bit64_4.0.5                  
 [25] echoconda_0.99.5              rprojroot_2.0.2              
 [27] basilisk_1.6.0                vctrs_0.4.0                  
 [29] generics_0.1.2                xfun_0.30                    
 [31] biovizBase_1.42.0             BiocFileCache_2.2.1          
 [33] R6_2.5.1                      AnnotationFilter_1.18.0      
 [35] bitops_1.0-7                  cachem_1.0.6                 
 [37] reshape_0.8.8                 DelayedArray_0.20.0          
 [39] assertthat_0.2.1              promises_1.2.0.1             
 [41] BiocIO_1.4.0                  scales_1.1.1                 
 [43] nnet_7.3-17                   rootSolve_1.8.2.3            
 [45] gtable_0.3.0                  lmom_2.8                     
 [47] ggbio_1.42.0                  ensembldb_2.18.4             
 [49] rlang_1.0.2                   clisymbols_1.2.0             
 [51] MungeSumstats_1.3.16          echodata_0.99.7              
 [53] splines_4.1.0                 lazyeval_0.2.2               
 [55] GEOquery_2.62.2               gargle_1.2.0                 
 [57] dichromat_2.0-0               hexbin_1.28.2                
 [59] checkmate_2.0.0               BiocManager_1.30.16          
 [61] yaml_2.3.5                    reshape2_1.4.4               
 [63] GenomicFeatures_1.46.5        ggnetwork_0.5.10             
 [65] backports_1.4.1               httpuv_1.6.5                 
 [67] Hmisc_4.6-0                   RBGL_1.70.0                  
 [69] tools_4.1.0                   ggplot2_3.3.5                
 [71] ellipsis_0.3.2                RColorBrewer_1.1-2           
 [73] proxy_0.4-26                  Rcpp_1.0.8.3                 
 [75] plyr_1.8.7                    base64enc_0.1-3              
 [77] progress_1.2.2                zlibbioc_1.40.0              
 [79] purrr_0.3.4                   RCurl_1.98-1.6               
 [81] basilisk.utils_1.6.0          prettyunits_1.1.1            
 [83] rpart_4.1.16                  SummarizedExperiment_1.24.0  
 [85] ggrepel_0.9.1                 cluster_2.1.3                
 [87] here_1.0.1                    fs_1.5.2                     
 [89] crul_1.2.0                    magrittr_2.0.3               
 [91] data.table_1.14.2             echotabix_0.99.5             
 [93] dnet_1.1.7                    openxlsx_4.2.5               
 [95] gh_1.3.0                      mvtnorm_1.1-3                
 [97] ProtGenerics_1.26.0           matrixStats_0.61.0           
 [99] xtable_1.8-4                  mime_0.12                    
[101] patchwork_1.1.1               hms_1.1.1                    
[103] XML_3.99-0.9                  jpeg_0.1-9                   
[105] gridExtra_2.3                 testthat_3.1.3               
[107] compiler_4.1.0                biomaRt_2.50.3               
[109] tibble_3.1.6                  crayon_1.5.1                 
[111] R.oo_1.24.0                   htmltools_0.5.2              
[113] later_1.3.0                   echoannot_0.99.4             
[115] tzdb_0.3.0                    Formula_1.2-4                
[117] tidyr_1.2.0                   expm_0.999-6                 
[119] Exact_3.1                     lubridate_1.8.0              
[121] DBI_1.1.2                     ExperimentHub_2.2.1          
[123] dbplyr_2.1.1                  MASS_7.3-56                  
[125] rappdirs_0.3.3                boot_1.3-28                  
[127] Matrix_1.4-1                  readr_2.1.2                  
[129] brio_1.1.3                    piggyback_0.1.1              
[131] cli_3.2.0                     R.methodsS3_1.8.1            
[133] parallel_4.1.0                igraph_1.2.11                
[135] pkgconfig_2.0.3               dir.expiry_1.2.0             
[137] GenomicAlignments_1.30.0      RCircos_1.2.2                
[139] foreign_0.8-82                osfr_0.2.8                   
[141] xml2_1.3.3                    stringr_1.4.0                
[143] VariantAnnotation_1.40.0      digest_0.6.29                
[145] graph_1.72.0                  httpcode_0.3.0               
[147] htmlTable_2.4.0               gld_2.6.4                    
[149] restfulr_0.0.13               curl_4.3.2                   
[151] shiny_1.7.1                   Rsamtools_2.10.0             
[153] rjson_0.2.21                  lifecycle_1.0.1              
[155] nlme_3.1-157                  jsonlite_1.8.0               
[157] limma_3.50.1                  fansi_1.0.3                  
[159] pillar_1.7.0                  lattice_0.20-45              
[161] GGally_2.1.2                  KEGGREST_1.34.0              
[163] fastmap_1.1.0                 httr_1.4.2                   
[165] survival_3.3-1                googleAuthR_2.0.0            
[167] waldo_0.4.0                   interactiveDisplayBase_1.32.0
[169] glue_1.6.2                    zip_2.2.0                    
[171] png_0.1-7                     BiocVersion_3.14.0           
[173] bit_4.0.4                     Rgraphviz_2.38.0             
[175] class_7.3-20                  stringi_1.7.6                
[177] blob_1.2.2                    AnnotationHub_3.2.2          
[179] latticeExtra_0.6-29           memoise_2.0.1                
[181] dplyr_1.0.8                   e1071_1.7-9                  
[183] ape_5.6-2     

Long-term recommendations for Matrix generics

Just noticed 0527f88. Is the long-term recommendation to switch to importing these generics from Matrix rather than BiocGenerics? It wouldn't make a difference to me as a developer, but I could imagine that you might want to get rid of the redundant definitions in BiocGenerics at some point.

BiocGenerics::unlist creating an error

Hi @hpages, the latest changes of BiocGenerics seems to cause a common error across many packages in the dev build server (see https://bioconductor.org/checkResults/3.16/bioc-LATEST/crisprDesign/nebbiolo2-buildsrc.html for instance)

Error: processing vignette 'intro.Rmd' failed with diagnostics:
error in evaluating the argument 'x' in selecting a method for function 'as.matrix': dims [product 42] do not match the length of object [7]
--- failed re-building ‘intro.Rmd’

That error arises from BiocGenerics::unlist used in the crisprDesign package. Here's a simple reproducible example:

library(BiocGenerics)
library(S4Vectors)
df <- DataFrame(a=1:2, b=1:2)
df <- split(df, f=df$b)
BiocGenerics::unlist(df)

with output

> unlist(df)
DataFrame with 2 rows and 2 columns
Error in h(simpleError(msg, call)) : 
  error in evaluating the argument 'x' in selecting a method for function 'as.matrix': dims [product 4] do not match the length of object [2]

My sessionInfo:

R version 4.2.1 (2022-06-23)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] S4Vectors_0.35.3    BiocGenerics_0.43.2

loaded via a namespace (and not attached):
[1] compiler_4.2.1 IRanges_2.31.2

import error

Hello, I have installed the BioGenerics of newest version 0.32 on my linux server. But when I import it, I get the following error,

library(BiocGenerics)
Error in value[3L] :
Package ‘BiocGenerics’ version 0.30.0 cannot be unloaded:
Error in unloadNamespace(package) : namespace ‘BiocGenerics’ is imported by ‘GenomicRanges’, ‘XVector’, ‘S4Vectors’, ‘GenomeInfoDb’, ‘IRanges’ so cannot be unloaded

How to fix this problem? Thanks.

Export `replaceSlots` function?

Hi,

I see that BiocGenerics:::replaceSlots is used and recommended in some places, e.g. https://www.bioconductor.org/packages/devel/bioc/vignettes/SummarizedExperiment/inst/doc/Extensions.html#37_Enabling_subsetting_operations

Now as we unfortunately know R CMD check does not really like using the ::: trick to get unexported functions from packages. And I also don't really like copying the code into our package just to circumvent this (plus possible license issues).

How about just exporting replaceSlots?

Thanks for considering.
Cheers
Daniel

BiocGenerics::var() crashing with is.atomic error

i had a line of code calculating the variance of several numeric values failing unexpectedly. took me a long time to discover that BiocGenerics overwrites stats::var() when imported, and the errors i'm seeing is not from base var().

$ R

R version 4.4.1 (2024-06-14) -- "Race for Your Life"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BiocGenerics)

Attaching package:BiocGenericsThe following objects are masked frompackage:stats:

    IQR, mad, sd, var, xtabs

The following objects are masked frompackage:base:

    anyDuplicated, aperm, append, as.data.frame, basename, cbind,
    colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
    get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
    Position, rank, rbind, Reduce, rownames, sapply, setdiff, sort,
    table, tapply, union, unique, unsplit, which.max, which.min

> var(c(1,2,3))
Error in var(c(1, 2, 3)) : is.atomic(y) is not TRUE
> is.atomic(c(1,2,3))
[1] TRUE
> stats::var(c(1,2,3))
[1] 1
> sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Debian GNU/Linux trixie/sid

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/blis-openmp/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3;  LAPACK version 3.12.0

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C

time zone: Australia/Sydney
tzcode source: system (glibc)

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

other attached packages:
[1] BiocGenerics_0.48.1

loaded via a namespace (and not attached):
[1] compiler_4.4.1

googling the "is.atomic" error message didn't lead to anything constructive--suggesting a more recent bug?

am i using the var() function correctly? (i mean, i wasn't expecting something that worked in stats::var() to NOT work in BiocGenerics::var() in the first place...)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.