如何使用r?
解析下面给出的nls fit(多行文本)文件Nonlinear regression model
model: A ~ BOTTOM + (TOP - BOTTOM)/(1 + 10^((logEC50 - xdata) * hillSlope))
data: keep
TOP BOTTOM hillSlope logEC50
101.027 0.704 1.374 -6.319
residual sum-of-squares: 581.7
Number of iterations to convergence: 7
Achieved convergence tolerance: 1.798e-06
我想得到一个第四行文本的表格作为列标题,第五行数字作为值s显示如下:
TOP BOTTOM hillSlope logEC50
101.027 0.704 1.374 -6.319
答案 0 :(得分:2)
使用read.table
尝试这三个参数 skip / nrows / header :
read.table(text = "Nonlinear regression model
model: A ~ BOTTOM + (TOP - BOTTOM)/(1 + 10^((logEC50 - xdata) * hillSlope))
data: keep
TOP BOTTOM hillSlope logEC50
101.027 0.704 1.374 -6.319
residual sum-of-squares: 581.7
Number of iterations to convergence: 7
Achieved convergence tolerance: 1.798e-06", skip = 3, nrows = 1, header = T)
# TOP BOTTOM hillSlope logEC50
#1 101.027 0.704 1.374 -6.319
根据@ 42-要求:
skip
指定在阅读时要忽略的行数; header = T
,以便跳过行后的第一行将被读取为标题; nrows = 1
来指定;