Given the following:
library(biomaRt) mart <- useMart("ensembl") list <- listDatasets(m) dataset.name <- list[ grep("sapiens",list$dataset, ignore.case=TRUE), 'dataset' ]
list
clearly shows a data.frame containing character strings, is.character( dataset.name)
is TRUE
,
dataset.name == "hsapiens_gene_ensembl"
is also TRUE
, yet the following call:
set <- useDataset(dataset.name, mart=mart)
gives
Error in (function (cl, name, valueClass) : assignment of an object of class "AsIs" is not valid for @'dataset' in an object of class "Mart"; is(value, "character") is not TRUE
but
set <- useDataset("
hsapiens_gene_ensembl
"
, mart=mart)
works fine. I consider this a bug, and (to the more casual end user), a very intractible one. If data.set
is, for all intents and purposes, a character string, then useDataset
really should (try to) coerce this argument to a chr before crashing. Or should I report this elsewehere? Cheers,
Philip
Oh and the details:
> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
locale:
[1] C
attached base packages:
[1] stats datasets graphics grDevices utils methods base
other attached packages:
[1] biomaRt_2.30.0
loaded via a namespace (and not attached):
[1] IRanges_2.6.1 parallel_3.3.0 DBI_0.5-1
[4] RCurl_1.95-4.8 memoise_1.0.0 Rcpp_0.12.8
[7] Biobase_2.34.0 AnnotationDbi_1.36.0 RSQLite_1.1
[10] S4Vectors_0.10.3 BiocGenerics_0.20.0 digest_0.6.10
[13] stats4_3.3.0 bitops_1.0-6 XML_3.98-1.5
>
brilliant, thanks!