View Single Post
Old 03-19-2019, 09:51 AM   #3
rookie_genomics
Junior Member
 
Location: USA

Join Date: Mar 2019
Posts: 4
Default

Hi,

I followed your advice and tried to import as a matrix. But when I try to set up col.data I still get an error

This is my code

Quote:
deseq2_analysis2 <- read_excel("deseq2_analysis2.xlsx")
> View(deseq2_analysis2)
> analysis3 <- as.matrix(deseq2_analysis2)
> (condition <- factor(c(rep("group1", 4), rep("group2", 4), rep("group3", 4), rep("group4", 4))))
[1] group1 group1 group1 group1 group2 group2 group2 group2 group3 group3 group3 group3 group4
[14] group4 group4 group4
Levels: group1 group2 group3 group4
> (coldata <- data.frame(row.names=colnames(analysis3), condition))
Error in data.frame(row.names = colnames(analysis3), condition) :
row names supplied are of the wrong length
This is my result for head command

Quote:
head(deseq2_analysis2)
# A tibble: 6 x 17
gene Sample1_group1 Sample2_group1 Sample3_group1 Sample4_group1 Sample1_group2 Sample2_group2
<chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 YAL0~ 0 0 0 0 2 0
2 YAL0~ 0 0 0 0 0 0
3 YAL0~ 243 242 109 130 271 233
4 YAL0~ 16 7 52 30 23 10
5 YAL0~ 23 21 21 33 11 28
6 YAL0~ 38 42 76 88 47 40
# ... with 10 more variables: Sample3_group2 <dbl>, Sample4_group2 <dbl>, Sample1_group3 <dbl>,
# Sample2_group3 <dbl>, Sample3_group3 <dbl>, Sample4_group3 <dbl>, Sample1_group4 <dbl>,
# Sample2_group4 <dbl>, Sample3_group4 <dbl>, Sample4_group4 <dbl>
What am I doing wrong here?
rookie_genomics is offline   Reply With Quote