User Tools

Site Tools


day1_exercise3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

day1_exercise3 [2017/12/13 18:12]
hyjeong created
day1_exercise3 [2017/12/13 18:12] (current)
hyjeong created
Line 1: Line 1:
 +  #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]
  
day1_exercise3.txt ยท Last modified: 2017/12/13 18:12 by hyjeong