Entering edit mode
4.5 years ago
imrankhanbioinfo
▴
70
Dear Biostars community, 1. Does anyone know how we remove default column names (integer value) in the data frame to the first row in R studio? 2. How to compile clinical information with RNA-seq data from two CSV files with matching patients IDs. I will be grateful to have your suggestions. Thank you very much! Imran
Hey Imran! Can you share some examples of your data? Also, what have you already tried? When you paste your examples [of your data], can you then highlight the output and press the
101 010
button for formatting.X1 X2 X3 X4 X5 X6 X6 X7 Patient_id Condition tcga_counts A1BG A1CF A2BP1 A2LD1 A2ML
Thank you. Here is my question. I wanted to paste a screenshot but I can't see any possibility. Anyways
1) I got more than 20000 columns in DF 1. Just as an example I need to replace all column names (X1 to X7) values with raw 1 values (Patient_id to A2ML).
2) I have all patient's gender in another table. The only variable common between the two tables is the patient's ID. Is there any way I can combine two data frames into one table with matching patients ID?
@ imrankhanbioinfo How did you get two columns with the same name? You can use rename (from tidyr) to rename columns. Use join functions esp inner_join from dplyr or sqldf package to join two dataframes with common column name. It always would help if you can post example data and expected outcome with proper forum formatting here.