请参见以下示例。列子设置适用于所有其他列,但不适用于repeat
列。
library(data.table)
dtt <- fread(text = 'tx_name tstart tend repeat class_family
ENST00000001008.6 3115 3216 AluJb SINE/Alu
ENST00000001008.6 3351 3489 MIRb SINE/MIR
ENST00000001008.6 3534 3625 MIR3 SINE/MIR
ENST00000002125.9 1657 1948 AluSp SINE/Alu
ENST00000002165.10 1800 2356 Tigger3b DNA/TcMar-Tigger
ENST00000002596.6 2588 2693 MIRb SINE/MIR')
> dtt[, .(tx_name, class_family)]
# tx_name class_family
# 1: ENST00000001008.6 SINE/Alu
# 2: ENST00000001008.6 SINE/MIR
# 3: ENST00000001008.6 SINE/MIR
# ...
dtt[, .(tx_name, repeat)]
# Error: unexpected ')' in "dtt[, .(tx_name, repeat)"