考虑以下代码:
ScriptBlock
当我选择第一个元素fun <- function(theta1,theta2,x){
theta1*x/(x+theta2)
}
x <- seq(from = -5,to = 5, by = 1)
y <- lapply(c(0.04,0.06,0.08,0.1),fun,x=x,theta1 = 200)
时,结果是:
y[1]
我想在使用[[1]]
[1] #some number
时骑上[[1]]
,以便绘制y:
y[1]
修改
有人还提到plot(x,y[1],col=1)
有用!