I have this data frame :
and I want to remove those rows which contain NA values from the log2fold change column
How can I do this through R?
I have this data frame :
and I want to remove those rows which contain NA values from the log2fold change column
How can I do this through R?
Hi Anas,
If your data frame is called res
, then:
res[!is.na(res$log2FoldChange),]
Kevin
Hi,
For dataframe manipulation you should look into the dplyr and tidyr libraries. You can take a look a this cheatsheet for example.
You can remove NAs and rename columns as follows:
library(dplyr)
your_dataframe %>%
dplyr::filter(!is.na(log2FoldChange)) %>%
dplyr::rename(gene_names = X)
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
I also want to rename column 'X' to 'gene names' . How can i do it?
...or:
I am trying this to make a heatmap:
But it is giving me this error:
The data frame which I am using for annotation is:
kindly help me