Hi,
I get two data frames by running the following codes with R:
#data frame 1
demo_syntable <- synTableQuery("SELECT * FROM syn10146552")
demo <- demo_syntable@values
healthCodeCol <- c(as.character(demo$healthCode))
healthCodeList <- paste0(sprintf("'%s'", healthCodeCol), collapse = ", ")
#data frame 2
actv_walking_syntable <- synTableQuery(paste0("SELECT * FROM ", syn10146553, " WHERE healthCode IN ", "(", healthCodeList, ")"))
actv_walking <- actv_walking_syntable@values
I noticed the row names of the two data frames have very similar format, such as "0_0" "1_0" "2_0" "3_0" "4_0" "5_0", named idx here. However, it seems to be wrong if cross-linking the two objects by using the idx values.
My question is, how to understand the two similar-formated idx values in the two data frames? Currently, I neglected idx in demo table, and only used idx in syn10146553 table as unique label for record. As a result, if a sample has N records, the sample will have N idx values, and the length of idx (records) in different samples are also different. Am I correct?
Thank you,
Xinyu Zhang
Created by Xinyu Zhang starrcofly Thank you for the reply, Solly. It helps a lot.
Xinyu The two tables can be linked by the "healthCode" (individual ID). The IDs you're referring to are row number and version variables, which are stored in a Synapse table, and do not link the two tables. The IDs which are important to track are healthCode (individual ID) and recordID (task ID) for the walking table which uniquely identifies each walking task. I hope that helps.
Solly
Drop files to upload
How to understand the relationship between row names of returned data from syn10146553 and syn10146552 page is loading…