I am attempting to use subset to send a row matching a specific value from a column, but I'm having issues recognizing a specific header I have defined and not another.
foo.csv is:
,3ZSJ_ALA_A_142,ED
1,0,0.249
2,10,0.379
3,20,0.542
example r code:
T1 = read.csv('foo.csv', header=T)
foo <- subset(T1, 3ZSJ_ALA_A_142 == '10')
Error: unexpected symbol in "foo <- subset(T1, 3ZSJ_ALA_A_142"
Execution halted
I have also tried to put the 3ZSJ_ALA_A_142 in parentheses and then my output lis is inappropriate, it should give the row with 10, but it gives this:
[1] X X3ZSJ_ALA_A_142 ED
<0 rows> (or 0-length row.names)
If I do ED instead of 3ZSJ_ALA_A_142 in my r code I get this lis:
X X3ZSJ_ALA_A_142 ED
2 2 10 0.379
Am I using an inappropriate function, or is my syntax all mucked up? any points would be greatly appreicated, thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…