楼主: luofuyan
3706 6

[求助]7.0试用版中找源代码,有些找不到,怎么办 [推广有奖]

  • 1关注
  • 4粉丝

已卖:3355份资源

教授

42%

还不是VIP/贵宾

-

威望
0
论坛币
24272 个
通用积分
10.8853
学术水平
2 点
热心指数
3 点
信用等级
2 点
经验
12653 点
帖子
271
精华
0
在线时间
2531 小时
注册时间
2005-10-20
最后登录
2025-9-11

楼主
luofuyan 发表于 2007-1-21 19:01:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

比如在splus6.2发现找到的函数colMeans源代码如下 输入:colMeans 回车得到:function(x, na.rm = F, dims = 1)
{
if(is.data.frame(x))
...................... ......}
answer
}

在7.0试用版 输入:colMeans 回车得到:

function(x, ...)
.Call("S_c_use_method", "colMeans")

没有显示相应的源代码,

而在7.0中colMeans函数已作了修改,

现在我想把splus6.2中的colMeans函数源代码修改为7.0中colMeans函数定义。

没有源代码怎么办呢


[此贴子已经被作者于2007-1-21 19:42:57编辑过]

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:试用版 怎么办 源代码 colMeans函数 function 源代码 试用版

回帖推荐

anning189 发表于2楼  查看完整内容

7.0中的S语言函数用类对象封装 7.0中可以查看源代码 > colMeansfunction(x, ...).Call("S_c_use_method", "colMeans")> colMeans.defaultfunction(x, na.rm = F, dims = 1, weights = NULL, freq = NULL, n = NULL ){ # Compute column means for a matrix. # Supports higher-dimensional arrays - use dims to specify how # many "row dimensions". # May supply weights or frequencies (repetition counts). # If `n' ...

本帖被以下文库推荐

沙发
anning189 发表于 2007-1-21 21:03:00

7.0中的S语言函数用类对象封装

7.0中可以查看源代码

> colMeans
function(x, ...)
.Call("S_c_use_method", "colMeans")
> colMeans.default
function(x, na.rm = F, dims = 1, weights = NULL, freq = NULL, n = NULL
)
{
# Compute column means for a matrix.
# Supports higher-dimensional arrays - use dims to specify how
# many "row dimensions".
# May supply weights or frequencies (repetition counts).
# If `n' supplied, use that as number of rows, and
# and return vector w/o names.
# Otherwise return vector with names in usual case,
# or array with dimnames if there are at least 2 column dimensio
ns.
haveN <- !is.null(n)
if(haveN)
p <- length(x)/n
else {
if(length(dim(x)) < 2)
x <- as.matrix(x)
dimx <- dim(x)
if(dims < 1 || dims > length(dimx) - 1)
stop("dims not compatible with dim(x)")
dims <- seq(length = dims)
n <- prod(dimx[dims])
p <- prod(dimx[ - dims])
}
if(length(freq)) {
if(length(freq) != n)
stop("Length of freq does not match the number o
f rows"
)
if(length(weights))
weights <- weights * freq
else weights <- freq
}
answerIsNA <- F
if(length(weights)) {
# if weights supplied
if(length(weights) != n) stop(
"Length of weights does not match the nu
mber of rows"
)
# When calling C code, weights must have length 0 or n.
if(anyMissing(weights)) {
if(na.rm) {
wna <- which.na(weights)
weights <- weights[ - wna, drop = F]
dim(x) <- c(n, p)
x <- x[ - wna, , drop = F]
n <- nrow(x)
}
else answerIsNA <- T
}
}
if(answerIsNA)
answer <- NA * double(p)
else if(is.complex(x)) {
answer <- .C("S_colSums_NA_weights",
as.integer(n),
as.integer(p),
Re(x),
as.integer(length(weights)),
as.double(weights),
answer = double(p),
divide = TRUE,
as.integer(na.rm),
NAOK = T,
specialsok = T)$answer + (1i) * .C(
"S_colSums_NA_weights",
as.integer(n),
as.integer(p),
Im(x),
as.integer(length(weights)),
as.double(weights),
answer = double(p),
divide = TRUE,
as.integer(na.rm),
NAOK = T,
specialsok = T)$answer
}
else {
answer <- .C("S_colSums_NA_weights",
as.integer(n),
as.integer(p),
as.double(x),
as.integer(length(weights)),
as.double(weights),
answer = double(p),
divide = TRUE,
as.integer(na.rm),
NAOK = T,
specialsok = T)$answer
}
if(haveN)
return(answer)
if(length(dimx[ - dims]) > 1) {
#result is an array
dim(answer) <- dimx[ - dims]
if(!is.null(dimnames(x)))
dimnames(answer) <- dimnames(x)[ - dims]
}
else {
#result is a vector
temp <- dimnames(x)[[length(dimx)]]
if(length(temp) == p)
names(answer) <- temp
}
answer
}
ps:介绍s programming一书看看

已有 1 人评分论坛币 学术水平 收起 理由
crystal8832 + 10 + 1 热心帮助其他会员

总评分: 论坛币 + 10  学术水平 + 1   查看全部评分

藤椅
anning189 发表于 2007-1-21 21:05:00

还是自己试着多写点code

板凳
luofuyan 发表于 2007-1-21 21:19:00

谢谢 你


谢谢 你

谢谢 你

[此贴子已经被作者于2007-1-21 22:41:03编辑过]

报纸
anning189 发表于 2007-1-22 08:21:00
不客气,多来光顾

地板
davidhaitaopan 发表于 2008-11-6 16:22:00
xiexie

7
zsd8355 发表于 2009-6-21 17:28:49
我是Splus菜鸟,能否告知在6.2中怎么定义函数stop.on.bdObject?跪谢!

PS,我运行 R.S.bekk=mgarch(R.S~1,~bekk(1,1))
出现:Problem in mgarch(R.S ~ 1,  ~ bekk(1, 1)): Couldn't find a function definition for "stop.on.bdObject"
Use traceback() to see the call stack

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-30 12:26