search for: honkit

Displaying 9 results from an estimated 9 matches for "honkit".

Did you mean: honkin
2011 May 13
3
Adding same items together in data.frame
Dear All, I am new to R. I have a 2 column data frame with more than ten thousand rows. Something like below. I want to add up all duplicated items, e.g. the three "aa" add up together to get a single value gene=a, value=74. How can I do that?? Thanks for help ! gene value aa 20 bb 10 cc 9 aa 30 aa 24 dd 100 ee 55 .... ... Millions thanks. Best Regards, hon WONG, Hon-Kit
2018 Mar 01
3
how to make row.names based on column1 with duplicated values
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 row names:
2018 Mar 01
0
how to make row.names based on column1 with duplicated values
On Wed, 28 Feb 2018, Stephen HonKit Wong wrote: > 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)), &...
2012 Sep 02
2
a newbie seeking for a simple problem
Dear Experienced R users, I have a looks-like simple but complicated problem urgently needed to be solved. Below is the detail: I have two dataframes, df1, df2. df1 contains two column and many thousands rows: column 1 is a "gene_name", column 2 is "value". df2 contains only one column which is "gene_name" with couple hundred rows. I want to change "value"
2017 Jul 22
0
a difficult situation, how to do this using base function.
...len(nrow(df)),function(i){ test <- numex[[i]] val <- df[i,1] if(nrow(test) ==1 ) test[1,1]+val else { wm <- which(val < test[,2])[1] test[wm,1]+val - test[wm-1,2] } }) > df$updated [1] 1005 1510 6050 690 Cheers, Bert On Fri, Jul 21, 2017 at 4:24 PM, Honkit Wong <stephen66 at gmail.com> wrote: > Sorry for confusion, it was right, it should be: 600+(200-60-50)=690. > 60 and 50 are from difference of previous two ranges. Thanks! Any clue? > > Stephen (Hon-Kit) Wong > >> On Jul 21, 2017, at 4:13 PM, Bert Gunter <bgunter.4567...
2018 May 25
0
how to make the code more efficient using lapply
...quot;geneC"),] } myL <- lapply( X=list.files(), FUN=f ) temp.df.all<-do.call("rbind",myL) names(temp.df.all)<-gsub("^.*] ","",names(temp.df.all)) write_xlsx(temp.df.all, path="output.xlsx") HTH, Eric On Fri, May 25, 2018 at 9:24 AM, Stephen HonKit Wong <stephen66 at gmail.com> wrote: > 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 &...
2018 May 25
2
how to make the code more efficient using lapply
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 quite slow. How to make it faster using lapply function ? Thanks in advance! temp.df<-c() #
2017 Jul 21
1
a difficult situation, how to do this using base function.
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 100 5000-5050,6000-6180 200
2018 May 25
1
how to make the code more efficient using lapply
...st.files(), FUN=f ) temp.df.all<-do.call("rbind",myL) names(temp.df.all)<-gsub("^.*] ","",names(temp.df.all)) write_xlsx(temp.df.all, path="output.xlsx") HTH, Eric On Fri, May 25, 2018 at 9:24 AM, Stephen HonKit Wong <stephen66 at gmail.com> wrote: > 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...