object of type 'closure' is not subsettable
1
0
Entering edit mode
4.9 years ago

Dear all I am analyzing my data of GEO using R and got the below error. Please guide me in this regards, Raheleh

tasks <- c("sorted.download_data")
source("runall.R")
Found 1 file(s)
GSE20853_series_matrix.txt.gz
Using locally cached version: ~/proj/lung/data/Kyoto_Expression/GSE20853_series_matrix.txt.gz
Parsed with column specification:
cols(
  .default = col_double()
)
See spec(...) for full column specifications.
|=================================================================| 100%   70 MB
Using locally cached version of GPL962 found here:
~/proj/lung/data/Kyoto_Expression/GPL962.annot.gz 
Error in df$fudan <- NA : object of type 'closure' is not subsettable
> tasks
[1] "sorted.download_data"
R • 2.4k views
ADD COMMENT
0
Entering edit mode

just check if file GSE20853_series_matrix.txt.gz is unzipped and a data frame is created within R, before trouble shooting. Also check if script accommodates gz files or not.

ADD REPLY
0
Entering edit mode

I unzipped the file and ran again, but the error exits yet,

ADD REPLY
0
Entering edit mode

In general, this happens when you index some thing that is not sub-settable (for eg. a function). Without code and example it may not be easy to troubleshoot the issue. Look at this object sorted.download_data

ADD REPLY
0
Entering edit mode

would you please guide me for creating a data frame.

ADD REPLY
1
Entering edit mode

I am not sure about the contents of runall.R and sorted.download_data. Without that it is not possible to understand the error (for me). Keep printing the type of the objects you have in the current workspace.

ADD REPLY
0
Entering edit mode

I need more documents for studying.

ADD REPLY
0
Entering edit mode

I would appreciate to provide more details for me in this matter.

ADD REPLY
1
Entering edit mode

This is not how this community works. Please be patient. We are driven by volunteers and not on-demand supporters. Your question is only 5h old by now (which is not much and it is a Saturday) and your post lacks details which currently prevents us from providing help.

=> As cpad0112 mentioned already, please show the content of that script you are running. Without that it is impossible to help.

The comment was:

I am not sure about the contents of runall.R and sorted.download_data. Without that it is not possible to understand the error (for me). Keep printing the type of the objects you have in the current workspace.

ADD REPLY
0
Entering edit mode

The code is here;

for (i in 1:nchar(gsms)) { sml[i] <- substr(gsms,i,i) } Error in nchar(gsms) : cannot coerce type 'closure' to vector of type 'character'

ADD REPLY
1
Entering edit mode

I doubt that is the full code. Where is df$fudan <- NA from the toplevel question and where does gsms and sml even comde from? If you want people to provide help please show full code.

ADD REPLY
0
Entering edit mode
4.9 years ago

gset <- getGEO("GSE20853", GSEMatrix =TRUE, destdir = "~/proj/lung/data/Kyoto_Expression", AnnotGPL=TRUE)[[1]] Found 1 file(s) GSE20853_series_matrix.txt.gz Using locally cached version: ~/proj/lung/data/Kyoto_Expression/GSE20853_series_matrix.txt.gz Parsed with column specification: cols( .default = col_double() ) See spec(...) for full column specifications. |=================================================================| 100% 70 MB Using locally cached version of GPL962 found here: ~/proj/lung/data/Kyoto_Expression/GPL962.annot.gz

fvarLabels(gset) <- make.names(fvarLabels(gset)) gsms <- paste0 sml <- c() for (i in 1:nchar(gsms)) { sml[i] <- substr(gsms,i,i) } Error in nchar(gsms) : cannot coerce type 'closure' to vector of type 'character'

ADD COMMENT

Login before adding your answer.

Traffic: 2367 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