我有以下问题。我想将一个文本文件导入 R。它看起来像这样:
# Below, those lines that start with a minus sign and an l (-l)
# define loci, while those that start with a minus sign and an i (-i)
# define epistatic interactions between the loci previously defined.
# The loci must be defined before the interactions can be defined.
# For some experimental designs, some interactions will be ignored.
#
-start model
#
# Here is the data on the QTLS...
#
-t 3 is the number of traits
#
#
-k 1
# for trait -number 1
#
# # ..Chrom..Markr. .RecombiL. .RecombiR. .Additive. .Dominance
-l 1 2 19 0.0823 0.0028 1.1712 0.0000
#
# QTL1 QTL2 Type Value
#
#
#
-k 1
# for trait -number 2
#
# # ..Chrom..Markr. .RecombiL. .RecombiR. .Additive. .Dominance
-l 1 2 14 0.0309 0.0564 0.4635 0.0000
#
# QTL1 QTL2 Type Value
#
#
#
-k 1
# for trait -number 3
#
# # ..Chrom..Markr. .RecombiL. .RecombiR. .Additive. .Dominance
-l 1 15 61 0.0782 0.0261 0.1200 0.0000
#
# QTL1 QTL2 Type Value
#
#
#
#End of this block of information
#
-end model
#
现在我想读取以 -l 开头的行并将它们保存在 data.frame 中。有人知道实现这一目标的方法吗?谢谢。