这些都没有显示pnorm功能的源代码,
stats:::pnorm
getAnywhere(pnorm)
Run Code Online (Sandbox Code Playgroud)
我怎么能看到源代码pnorm?
sum
(..., na.rm = FALSE) .Primitive("sum")
.Primitive("sum")
function (..., na.rm = FALSE) .Primitive("sum")
methods(sum)
no methods were found
Run Code Online (Sandbox Code Playgroud)
而且,我怎样才能看到该sum函数的源代码?
可能重复:
以下R摘录中的期限是什么意思?
在聚合帮助文件中:
Dot notation:
aggregate(. ~ Species, data = iris, mean)
aggregate(len ~ ., data = ToothGrowth, mean)
Run Code Online (Sandbox Code Playgroud)
这是什么意思. ?
import urllib
import lxml.html
down='http://blog.sina.com.cn/s/blog_71f3890901017hof.html'
file=urllib.urlopen(down).read()
root=lxml.html.document_fromstring(file)
body=root.xpath('//div[@class="articalContent "]')[0]
print body.text_content()
Run Code Online (Sandbox Code Playgroud)
当我运行代码时,我得到的是文本内容,我如何获得它的html源代码,而不是文本内容?
x <- iris[,1:4]
names(x) <- c("x1","x2","x3","x4")
aggregate(x1+x2+x3+x4~x1,FUN=sum,data=x)
Run Code Online (Sandbox Code Playgroud)
这是输出,我想知道
1. ~公式中的含义是什么?
2.为什么x1 = 4.3 ,x1 + x2 + x3 + x4 是8.5?
x1 x1 + x2 + x3 + x4
1 4.3 8.5
2 4.4 26.9
3 4.5 8.4
当我使用
transform(x,x1=sort(x1))
Run Code Online (Sandbox Code Playgroud)
我得到的是:
x1 x2 x3 x4
1 4.3 3.5 1.4 0.2
2 4.4 3.0 1.4 0.2
3 4.4 3.2 1.3 0.2
4 4.4 3.1 1.5 0.2
Run Code Online (Sandbox Code Playgroud)
?许多输出省略)
何时 x1=4.3 ,x1 + x2 + x3 + x4 不是 …
在data.frame中,<-可以得到很奇怪的输出,是什么原因?
x<-data.frame(name<-c("n1","n2"),age<-c(5,6))
y<-data.frame(name=c("n1","n2"),age=c(5,6))
> x
name....c..n1....n2.. age....c.5..6.
1 n1 5
2 n2 6
> y
name age
1 n1 5
2 n2 6
Run Code Online (Sandbox Code Playgroud)
data.frame中< - 和=之间的区别是什么?