Re: [R] how to create a sorted barplot and colored by groups

2020-04-19 Thread Jim Lemon
Hi aiguo, I assume that the data in your request was a text file that you want to read in. You can do it like this if you make a few changes as in the attached "aiguo_example.txt". Here is some code that may be helpful: # let the pipes be read in as fields, then index them out aiguo.df<-read.table

Re: [R] how to create a sorted barplot and colored by groups

2020-04-19 Thread John Kane
"MYC" "MYCL" "MYCN" "types" "DIPG_IV_1" 13.63 0.290 "DIPG" "DIPG_IV_2" 15.20.170 "DIPG" "DIPG_IV_3" 11.68 0.080 "DIPG" "BT142_1" 45.95 2.028.23"MCL" "BT142_2" 45.43 2.399.77"MCL" "BT142_3" 48.88 1.7110

Re: [R] how to create a sorted barplot and colored by groups

2020-04-19 Thread John Kane
Hi, At the moment I cannot make sense of your data. You write "I have three genes and a type column in the dataframe" but it seems to have 5 columns. Would you please supply us with the sample data in dput() format? Here are some suggestions and an example on how to do this plus other advice on as

[R] how to create a sorted barplot and colored by groups

2020-04-19 Thread aiguo li via R-help
Dear all, I need some help for creating a barplot as below.  I have three genes and a type column in the dataframe attached.  I would like to sort each gene from low to high within each type and create a barplot similar to the one below, but colored and grouped by type.  Thanks in advance for yo