I have one tab delimited file.
cat file
A B C
2 3 4
3 4 5
2 6 6
infile<-read.table("file",header=TRUE)
I need to get value for column which has header = "A".
A
2
3
2
How can i get it?
I have one tab delimited file.
cat file
A B C
2 3 4
3 4 5
2 6 6
infile<-read.table("file",header=TRUE)
I need to get value for column which has header = "A".
A
2
3
2
How can i get it?
For a single column data.frame
as the output:
infile["A"]
infile[1]
For a vector as the output:
infile[, "A"]
infile[, 1]
infile[["A"]]
infile[[1]]
infile$A
infile$A should work. You need read R book more and then to start your programming trials.