#1
dat=read.csv(file='Ex_data.csv',stringsAsFactors=F)
#2
head(dat)
#3
dim(dat)
#4
write.table(dat[,1],file='gene_name.txt',quote=F,sep='')
#5
x=dat[,2:10]
head(x)
write.table(x,file='sub_data.txt',quote = F,sep = '\t')
#6
y=dat[nchar(dat[,1])>7,]
dim(y)
write.table(y,file='sub_data2.csv',sep=',')
#7
sum(is.na(dat))
#8
which(is.na(dat))
#9
which(is.na(dat),arr.ind = T)
#10
index=which(is.na(dat),T)
dat[index]=10
sum(is.na(dat))
dat[index]