how to fix error: object 'gsg' not found ?
1
0
Entering edit mode
megha • 0
@d6df8bdb
Last seen 3.5 years ago
India
''' getwd();

workingDir = ".";
setwd(workingDir); 

library(WGCNA);

options(stringsAsFactors = FALSE);

femData = read.csv("GSE78929_series_matrix (1).csv");

dim(femData);
names(femData);


datExpr0 = as.data.frame(t(femData[, -c]));
names(datExpr0) = femData$substanceBXH;
rownames(datExpr0) = names(femData)[-c];


gsg = goodSamplesGenes(datExpr0, verbose = 3);
gsg$allOK

'''

output

 datExpr0 = as.data.frame(t(femData[, -c]));
Error in -c : invalid argument to unary operator
> names(datExpr0) = femData$substanceBXH;
Error in names(datExpr0) = femData$substanceBXH : 
  object 'datExpr0' not found
> rownames(datExpr0) = names(femData)[-c];
Error in -c : invalid argument to unary operator
> gsg = goodSamplesGenes(datExpr0, verbose = 3);
 Flagging genes and samples with too many missing values...
  ..step 1
Error in as.matrix(datExpr) : object 'datExpr0' not found
> gsg$allOK
Error: object 'gsg' not found
> 
errorinr objectnotfound • 1.4k views
ADD COMMENT
0
Entering edit mode
Kevin Blighe ★ 4.0k
@kevin
Last seen 24 days ago
Republic of Ireland

Hi, WGCNA is not a Bioconductor package. This forum was created to address technical issues pertaining to Bioconductor packages. Irrespective, please try to solve your first error (I have pasted it again below). Please debug in your own time, but by closely following the WGCNA tutorials.

Your first error, the issue relating specifically with -c. What are you hoping to do here? Are you supposed to have a variable named c? - poor choice, if so, as c is also a very common function name.

datExpr0 = as.data.frame(t(femData[, -c]));
Error in -c : invalid argument to unary operator

Kevin

ADD COMMENT

Login before adding your answer.

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