r - 如何解决 f(x, ...) 中的错误:未使用的参数 (x)
问题描述
f <- function(x) {((1/2)*((4*x)-1)*exp(-(1/2)*((3*x)+(2*x^2))))};
f # order of arguments reversed
h <- function(x) integrate(f, lower=0, upper=Inf, x=x)$value;
h
g <- Vectorize(h);
g
x <- seq(0,100)
plot(x,g(x), xlab="x", ylab="y", col="blue")
解决方案
我认为你应该使用下面的代码
h <- function(x) integrate(f, lower=0, upper=Inf)$value;
推荐阅读
- input - Svelte - 使用复选框在两个输入值之间切换
- angular - 如何在离子 4 App sqlite db 中的 1 之后启动索引数组
- gstreamer-1.0 - 将 tsdemux 链接到 h264parse 的 GStreamer 1.16.0 问题
- vue.js - 如何从 api 获取 taginput 数据
- http - 如何在golang中使用multipart
- docker - Docker栈容器交互
- php - 如何从历史列表中排除“已删除邮件”
- java - Oracle Java 8 不支持密码套件 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
- python - 根据特定类别名称过滤对象
- c - Linux SPARSEMEM 内存模型真的很稀疏吗?