小编Bqs*_*jbq的帖子

如何查看R .Internal或.Primitive函数的源代码?

这些都没有显示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

77
推荐指数
3
解决办法
2万
查看次数

的意义是什么 .在总功能?

可能重复:
以下R摘录中的期限是什么意思?

在聚合帮助文件中:

Dot notation:  
aggregate(. ~ Species, data = iris, mean)  
aggregate(len ~ ., data = ToothGrowth, mean)  
Run Code Online (Sandbox Code Playgroud)

这是什么意思.

r

4
推荐指数
2
解决办法
2582
查看次数

如何获取lxml中的html源代码?

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源代码,而不是文本内容?

python lxml

4
推荐指数
1
解决办法
2344
查看次数

〜总的来说是什么意思?

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 不是 …

r

2
推荐指数
2
解决办法
2245
查看次数

data.frame中< - 和=之间有什么区别?

在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中< - 和=之间的区别是什么?

r

2
推荐指数
2
解决办法
218
查看次数

标签 统计

r ×4

lxml ×1

python ×1