R Language Learn Notes】的更多相关文章

One #install package install.packages("ggplot2") #load library library(ggplot2) #update.packages() #vector v=c(1,4,4,3,2,2,3) #get vector elements, index is 2,3,4 v[c(2,3,4)] #get vector elements, index range is 2 to 4 v[2:4] #get vector element…
## String comparison is too slow in R language ## it will take 3 minutes, it is too slow date() strArray1<-rep("1234567890",10000) strArray2<-rep("1234567890",10000) tt<-0 for(xx in 1:10000) { for(yy in 1:10000) { if(strArray1…
Linux Essentials Certification Globbing ls ?.txt --- ? stands for one character while * means one or more characters ls [F]*.txt --- list file starting with F ls [F]*.txt --- list file starting with F ls f[igh] --- the first character is f, but the s…
Main reference: [1] http://winterbe.com/posts/2014/03/16/java-8-tutorial/ [2] https://plus.google.com/107771575694787223844/posts 1. Add default methods for Interfaces In java 8, Interface could have concrete methods using keyword 'default'. interfac…
向量定义:x1 = c(1,2,3); x2 = c(1:100) 类型显示:mode(x1) 向量长度:length(x2) 向量元素显示:x1[c(1,2,3)] 多维向量:multi-dimensional vector:rbind(x1,x2); cbind(x1,x2) > x = c(1,2,3,4,5,6) > y = c(6,5,4,3,2,1) > z = rbind(x,y) > z [,1] [,2] [,3] [,4] [,5] [,6] x 1 2 3 4…
References: [1] http://www.tldp.org/LDP/Bash-Beginners-Guide/html/ 1. Executing programs from a script When the program being executed is a shell script, bash will create a new bash process using a fork. This subshell reads the lines from the shell s…
Main reference [1] http://winterbe.com/posts/2014/07/31/java8-stream-tutorial-examples 1. How Streams Work A stream represents a sequence of elements and supports different kind of operations to perform computations upon those elements: List<String>…
流程控制语句 流程控制语句的作用就是控制代码的执行流程. if and else var a = 10; if(a > 10){ print('ok'); }else if( 5 < a <=10 ){ print('soso'); }else{ print('not ok'); } for循环 var list = []; for(int i = 0; i<10; i++){ list.add(i); } list.forEach((item) => print(item)…
操作符 dart 有一套自己定义的操作符: 这里我就不再写了,直接copy一份官网的. 如果有过编程基础,上边展示的操作符应该都不陌生. 算术运算符 加: + 减: - 乘: * 除: / 取余: % 取模: ~/ 自增: ++var, var++ 自减: --var, var-- 比较运算符 ==: 等于 !=: 不等 >: 大于 <: 小于 >=: 大于等于 <=: 小于等于 类型判断 as: 类型转换 is: 判断是否是某种类型 is!: 判断是否不是某种类型 赋值操作符 =…
Functions Dart是一门面向对象的语言,所以即便是方法也是一个对象,它的类型是Function. 这就意味着方法可以指向变量,也可以作为方法中的参数供其他方法使用.甚至可以让 一个类作为一个方法,这种类叫Callable classes,即回调类. bool isTrule(String args) { return args != Null; } 定义一个方法注意返回值和参数. 在Dart中是不允许出现这种方法的: bool isTrule(String args) { return…