我使用此代码来解决R. f(a)= | x | + 5a-6,其中| x |的问题。绘制合并值是否正确?我得到一条直线。
merge <- function(x) {
y <- abs(a) + 5*(a)-6
return(y)
}
merge (-4.534)
#c. Obtain the graph of the function.
plot (merge)
merge <- function(x) {
y <- abs(a) + 5*(a)-6
return(y)
}
merge (-4.534)
#c. Obtain the graph of the function.
plot (merge)
答案 0 :(得分:0)
您的功能没有价值。您必须提供参数。试试:
x <- seq(-100, 100)
merge <- function(a) {
y <- abs(a) + 5*(a)-6
return(y)
}
merge(x)
plot(x, merge(x))