getAnywhere 该函数可以返回一些函数的R源代码,如: getAnywhere(kmeans) 该函数具体用法,请参看官方说明. Retrieve an R Object, Including from a Namespace Description These functions locate all objects with name matching their argument, whether visible on the search path, registered as
练习一:打出1-100之间的所有偶数 def even_print(): for i in range(1,101): if i % 2 == 0: print (i) even_print() #列表解析式的方式: k = [n for n in range(1,101) if n%2 == 0] print (k) 练习二:设计一个函数,在桌面上创建10个文件,并以数字命名 def text_creation(): path = 'C:/Users/Administrator/Desktop
关于这两个函数,官方是这么定义的: substitute returns the parse tree for the (unevaluated) expression expr, substituting any variables bound in env. quote simply returns its argument. The argument is not evaluated and can be any R expression. 貌似看不懂,看几个例子来帮助理解. > x <