我只是寻找B1(newx)线性模型系数的值,而不是名称.我只想要0.5值.我不想要名字"newx".
newx <- c(0.5,1.5.2.5)
newy <- c(2,3,4)
out <- lm(newy ~ newx)
Run Code Online (Sandbox Code Playgroud)
out 好像:
Call:
lm(formula = newy ~ newx)
Coefficients:
(Intercept) newx
1.5 1.0
Run Code Online (Sandbox Code Playgroud)
我到了这里 但现在我被卡住了.
out$coefficients["newx"]
newx
1.0
Run Code Online (Sandbox Code Playgroud) 我正在使用Windows.我正在尝试使用CasperJS测试框架.
我正在使用phantomjs版本1.9.0.我正在使用casperjs版本1.0.2.
我跑的时候
casperjs test cow-test.js
Run Code Online (Sandbox Code Playgroud)
返回以下内容.
Test file: cow-test.js
FAIL TypeError: 'undefined' is not a function (evaluating 'casper.test.begin')
# type: uncaughtError
# error: "TypeError: 'undefined' is not a function (evaluating 'casper.test.begin')"
TypeError: 'undefined' is not a function (evaluating 'casper.test.begin')
C:/cow-test.js:16
FAIL 1 tests executed in 0.116s, 0 passed, 1 failed.
Details for the 1 failed test:
In cow-test.js:0
uncaughtError: TypeError: 'undefined' is not a function
(evaluating 'casper.test.begin')
var cow = {};
test.assert(cow);
test.done();
})')
Run Code Online (Sandbox Code Playgroud)
如果我只做
console.log(casper.test);
Run Code Online (Sandbox Code Playgroud)
返回以下内容
[object Object] …Run Code Online (Sandbox Code Playgroud)