I have a big df (CSV format) that looks like:
miRNAs <- c('mmu_mir-1-3p','mmu_mir-1-5p','mmu-mir-6-5p','mmu-mir-6-3p')
cca <- c('12854','5489','54485','2563')
ccb <- c('124','589','5465','25893')
taa <- c('12854','589','5645','763')
df <- data.frame(miRNAs,cca,ccb,taa)
and I want to use this df in DESeq2 analyses. I made this df unique by using unique(df)
and tried to open using countData <- as.matrix(read.csv(file="df.csv", row.name="miRNAs", sep = ","))
but it gives this error
Error in read.table(file = file, header = header, sep = sep, quote = quote, : duplicate 'row.names' are not allowed
Since I made the df unique
I don't know why this error keeps popping up. Basically why I want to read my df in that way is that I want to get the list of my column headers (except the first column)
when I type colnames(df)
. Because I need to do FALSE TRUE test to see if match these are matching with row names of another file called phenotype.csv all(rownames(phenotype) == colnames(countData))
new_df <- df[!duplicated(df$miRNAs),,drop=FALSE]
is this correct? – Apex