[R] heatmap ploting

2021-11-05 Thread Stephen HonKit Wong
Dear Community, I have an example heatmap plot in this link which was generated by java I believe, I want to make a similar plot in R. Any clues on how to do it? Thanks. The column is a gene, and the rows are dif

Re: [R] How to modify data frame stored in a list

2018-06-18 Thread Honkit Wong
t; > "The trouble with having an open mind is that people keep coming along and > sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > >> On Mon, Jun 18, 2018 at 1:46 PM, Honkit Wong wrote: >> Dear R community

[R] How to modify data frame stored in a list

2018-06-18 Thread Honkit Wong
Dear R community, I have a question seems very simple but have trouble to do it. I have a list which stores many data frames. Now, I want to perform log10 on one column in each data frame in the list and save the value as a new column back to the original data frame in the list. How do I quickly

[R] how to make the code more efficient using lapply

2018-05-24 Thread Stephen HonKit Wong
Dear All, I have a following for-loop code which is basically intended to read in many excel files (each file has many columns and rows) in a directory and extract the some rows and columns out of each file and then combine them together into a dataframe. I use for loop which can do the work but q

[R] how to make row.names based on column1 with duplicated values

2018-02-28 Thread Stephen HonKit Wong
Dear All, Suppose I have a dataframe like this with many thousands rows all with different names: data.frame(gene=c("a","b","c","d","c","d","c","f"),value=c(20,300,48,55,9,2,100,200)), I want to set column "gene" as row.names, but there are duplicates (c, d), which I want to transform into this as

[R] a difficult situation, how to do this using base function.

2017-07-21 Thread Stephen HonKit Wong
Hello, I have a following dataframe with many rows. data.frame(match.start=c(5,10,100,200),range.coordinates=c("1000-1050","1500-1555","5000-5050,6000-6180","100-150,200-260,600-900")) match.start range.coordinates 5 1000-1050 10 1500-1555