wbart
wbart

Reputation: 27

Error in is.na(output) || !is.character(output) : 'length = 3' in coercion to 'logical(1)'

if I run following code I get the error message: Error in is.na(output) || !is.character(output) : 'length = 3' in coercion to 'logical(1)'

The code was

library(rentrez)
gene_sombols <- "IL7"
organism <- "human"
query <- paste(gene_sombols, organism, sep = " ")
genes <- entrez_search(db="gene", term = query, retmax=1)

I innitinal run the following code succesffully:

genes <- entrez_search(db="gene", term = "IL7 human", retmax=1)

After I run the mal code also this previous working code does not work any more.

Any suggestions?

Best regards wbart

UPDATE: I get this Error even when I load the workspace !!! UPDATE2: I generate a new Workspace (no errror), I installed rentrez UPDATE3: I deleted all code below and generate new one. I generated a query and forced the error by viewing the result then run traceback() and sessioninfo()

# here is the code

library(rentrez)
> resul<-entrez_search(db="gene", term= query)
# only after clicking on view the error appears
> View(resul)
Error in is.na(output) || !is.character(output) : 
  'length = 3' in coercion to 'logical(1)'

# run traceback
> traceback()
10: .rs.explorer.objectDesc(.$object)
9: .rs.scalar(.rs.explorer.objectDesc(.$object))
8: .rs.explorer.createInspectionResult(object, context, children)
7: .rs.explorer.inspectDefault(object, context)
6: .rs.explorer.inspectObject(object[[i]], childContext)
5: FUN(X[[i]], ...)
4: lapply(indices, function(i) {
       if (is.null(names) || !nzchar(names[[i]])) {
           name <- sprintf("[[%i]]", i)
           access <- sprintf("#[[%i]]", i)
           tags <- .rs.explorer.tags$VIRTUAL
       }
       else {
           name <- names[[i]]
           access <- sprintf("#[[\"%s\"]]", name)
           tags <- character()
       }
       childContext <- .rs.explorer.createChildContext(context, 
           name, access, tags)
       .rs.explorer.inspectObject(object[[i]], childContext)
   })
3: .rs.explorer.inspectList(object, context)
2: .rs.explorer.inspectObject(object, context)
1: .rs.rpc.explorer_begin_inspect("0e1396e2e86e48d88b07ab7585d76766", 
       "resul")

# run sessioninfo
> sessionInfo()
R version 4.3.1 (2023-06-16 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)

Matrix products: default


locale:
[1] LC_COLLATE=German_Germany.utf8  LC_CTYPE=German_Germany.utf8   
[3] LC_MONETARY=German_Germany.utf8 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.utf8    

time zone: Europe/Berlin
tzcode source: internal

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

other attached packages:
[1] rentrez_1.2.3

loaded via a namespace (and not attached):
[1] httr_1.4.7      compiler_4.3.1  R6_2.5.1        tools_4.3.1     curl_5.2.0     
[6] jsonlite_1.8.8  XML_3.99-0.16.1

Upvotes: 0

Views: 336

Answers (0)

Related Questions