R读数据stringsAsFactors=F,存数据时row.names = F

stringsAsFactors=F

 
以前在r里读数据,经常把character读成factor,还得费半天劲把它转回来,尤其是把factor转成numeric还没有那么直接。例如:
dat<-read.csv("D:/chengjun/digg/digg_votes_threshold_ForOnStageTimeAnalysis.csv", 
              header=T, stringsAsFactors = F)
 
 
存数据时,经常多出一列id,很讨厌,设置row.names = F,比如:
write.csv(dat, "D:/chengjun/digg/digg_votes_threshold_ForOnStageTimeAnalysis.csv", row.names = F)

posted on 2019-02-21 19:45  若流芳千古  阅读(555)  评论(0编辑  收藏  举报

导航