摘要: R gsub Function gsub() function replaces all matches of a string, if the parameter is a string vector, returns a string vector of the same length and ... 阅读全文
posted @ 2015-04-28 20:55 emanlee 阅读(6840) 评论(2) 推荐(0)
摘要: ProblemYou want to do reorder the columns in a data frame.Solution# A sample data framedata id size weight#> 1 1 small 20#> 2 2 large ... 阅读全文
posted @ 2015-04-28 19:20 emanlee 阅读(261) 评论(0) 推荐(0)
摘要: You should use either indexing or the subset function. For example : R> df <- data.frame(x=1:5, y=2:6, z=3:7, u=4:8) R> df x y z u 1 1 2 3 4 2 2 3 4 5 阅读全文
posted @ 2015-04-28 19:10 emanlee 阅读(593) 评论(0) 推荐(0)
摘要: 按照某列的值拆分data.frameMy data is like this (for example):ID Rate State1 24 AL2 35 MN3 46 FL4 34 AL5 78 MN6 99 FLI want to split the ... 阅读全文
posted @ 2015-04-28 17:24 emanlee 阅读(737) 评论(0) 推荐(0)