2012年5月21日

摘要: SAS与R语言的数据加载与转化 第一:R加载/调用SAS--在SAS中生成传送文件 LIBNAME SAS_R xport 'C:\sea.xpt';DATA SAS_R.sea;SET custdet1;RUN;--在R中读入library(foreign)library(Hmisc)sea<-sasxport.get("c:/sea.xpt")head(mydata)第二:SAS调用R的数据... 阅读全文
posted @ 2012-05-21 22:25 Buttonwood 阅读(763) 评论(0) 推荐(0)
 
摘要: 1a. choose rows where column 3 is larger than column 5:awk '$3>$5' input.txt > output.txt1b. calculate the sum of column 2 and 3 and put it at the end of a row:awk '{print $0,$2+$3}' input.txtor replace the first column:awk '{$1=$2+$3;print}' input.txt2. show rows betwe 阅读全文
posted @ 2012-05-21 20:57 Buttonwood 阅读(281) 评论(0) 推荐(0)
 
摘要: xargs是实现批量处理最方便的方法,掌握xargs能省下写许多不必要的脚本。下面已几个例子说明(某些只适用于GNU xargs):删除所有.txt文件,可以在子目录下:find . -name "*.txt" | xargs rm打包一个目录下所有.pl文件,可在深层子目录:find . -name "*.pl" | xargs tar -zcf perl.tar.gz提交一个文件所包含的所有命令(一个命令一行):cat myfile.sh | xargs -i echo qsub {} | shkill所有满足某个匹配的进程:ps -ax | awk 阅读全文
posted @ 2012-05-21 20:47 Buttonwood 阅读(1083) 评论(0) 推荐(0)