Dear All, I am trying to make incidence matrices (where each row represents a pathway, and each column a gene) and there is a 1 if that gene is in the pathways, otherwise it is a zero.
I am using the function categoryReshape from the package plotrix as follows:
df_incid<-t(categoryReshape(df)) >head(df) gene_name pwy gene1 pwy1 gene2 pwy2
In the resulting incidence matrix (df_incid) I can see that the rows are labelled with the pathway names, however there are no column names.
I know these names are from the first column in my original dataframe, but I don't know if they are sorted in any way.
the help in the user manual is quite limited for this function.
Any help, from anyone who has used this is appreciated,
thanks
Thanks, this is great, and much faster than the categoryReshape function in plotrix.
And incase anyone was wondering, by comparing the results I can see that the column names from categoryReshape, are in the order of