Merge problems in R
0
0
Entering edit mode
FWNL15 • 0
@aba2f833
Last seen 8 days ago
Netherlands

I'm having trouble with merging two datasets in R. The first part is not giving any problems, but in the second part I get an error that a uniquely valid column must be specified. It is actually an existing column, so I don't understand why it is not valid. Does anyone have a clue?

# Data merge and save for further processing
> df1<- as.data.frame(mynormGSE117852)
> df2<- as.data.frame(mynormSPN)
> merged_panNET_SPN<- merge(df1, df2, by.x="row.names", by.y="row.names")
> rownames(merged_panNET_SPN) <- merged_panNET_SPN[,1]
> merged_panNET_SPN[,1] <- NULL
> tmerged_panNET_SPN<-as.data.frame(t(merged_panNET_SPN))
> annoGEO<- merge(PD_panNET_SPN[,c(1,3)], tmerged_panNET_SPN, by.x="Sample_Name", by.y="row.names", sort = FALSE)
Error in fix.by(by.x, x) : 'by' must specify a uniquely valid column
methylationArrayAnalysis ChAMP MethylationArrayData • 139 views
ADD COMMENT
0
Entering edit mode

What is colnames(PD_panNET_SPN) and rownames(tmerged_panNET_SPN) ?

ADD REPLY
0
Entering edit mode

tmerged_panNET_SPN = dataframe of two datasets which are merged above.

PD_panNET_SPN= a PD file of the two merged datasets

ADD REPLY
0
Entering edit mode

I was asking for the output of colnames(PD_panNET_SPN) and rownames(tmerged_panNET_SPN), we need to check your column and rownames, without this it is impossible to help you

ADD REPLY
0
Entering edit mode

Sorry, good one!

> colnames(PD_panNET_SPN)
 [1] "ï..X.Header." "X"            "X.1"          "X.2"          "X.3"          "X.4"          "X.5"         
 [8] "X.6"          "X.7"          "X.8"          "X.9"          "X.10.."      
> rownames(tmerged_panNET_SPN)
 [1] "A_mk11"   "A_mk12"   "A_mk4"    "A_mk47"   "AM1_mk36" "AM1_mk53" "D_LS21"   "D_mk18"   "D_mk26"   "D_mk34"  
[11] "D_mk42"   "D_mk51"   "D_mk9"    "DM1_LS7"  "DM1_mk17" "DM1_mk44" "DM1_mk45" "DM1_mk52" "M1_LS1"   "WT_LS27" 
[21] "WT_LS35"  "WT_LS39"  "WT_LS65"  "WT_mk13"  "WT_mk15"  "WT_mk19"  "WT_mk21"  "WT_mk27"  "WT_mk39"  "WT_mk49" 
[31] "WT_mk50"  "WT_mk8"   "SPN2T"    "SPN3T"    "SPN4T"    "SPN5T"    "SPN6T"    "SPN7T"    "SPN8T"    "SPN9T"   
[41] "SPN10T"   "SPN11T"   "SPN12T"   "SPN13T"   "SPN14T"   "GCT4"     "GCT5"

Guess I have to change colnames in PD file if I look at this right now?

ADD REPLY
0
Entering edit mode

You don't have any Sample_Name column inside your PD_panNET_SPN dataframe so it can't work

ADD REPLY
0
Entering edit mode

Yes there is one but not in the right place I see right now. Thanks, I know how to solve this now!

ADD REPLY

Login before adding your answer.

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