[R] Help on conditional selection of data.frame data...

skpark birdfire94 at naver.com
Mon Feb 4 15:01:36 CET 2013


Hello,
 
 
I have trouble with using data.frame data.
 
1. I loaded data using the following:
ff <- read.table("E:/R/VM/matrix.txt", header=T) 
The data I used is attached. 
 
I want to use at least 2 conditions for selecting of data. But I failed. 
 
It works. -> 
fff <- ff[ff$HG == "GUEST",] 
ffff <- fff[fff$WR == "READ",] 
 
But it doesn't work -> ff[ff$HG == "GUEST",ff$WR=="READ"]
 
How can I use 2 or more conditions together in one sentence ? 
 
2. I want to plot Throuput data using BlockSize as x-axis like the following:
plot(ffff$BlockSize, ffff$Throughput, type="o") 
 
But, Gap between 2 axis values are not consistent in the graph.
 
So I tried to use log() like the following:
plot( log(ffff$BlockSize), ffff$Throughput, type="o") 
 
The problem seems to be fixed. 
But x-axis sting is shown not as (1,2,4,8,16,32,64,128) but as (0,1,2,3,4,5), which is not my intention.
 
How can I fix this problem ? 
 
Thanks in advance, 
SK Park
 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: matrix.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130204/9132ce9d/attachment.txt>


More information about the R-help mailing list