[R] Plot with whispers

Matt Shotwell shotwelm at musc.edu
Mon Jul 5 18:31:48 CEST 2010


It looks like read.table is reading the first line as a data value,
which is the default for read.table. Try using read.table with the
argument header=TRUE. Also, consider using a box and whiskers plot for
these data (?boxplot, ?lattice::bwplot).

-Matt

On Mon, 2010-07-05 at 12:08 -0400, Ian Bentley wrote:
> Hello!
> 
> I need to make a plot with whispers that does the following.
> 
> Reads in 50 files, each file containing 200 data points.  A file looks like
> this:
> base100.log
> Send Receive
> 10.5   100.3
> 15.0   102.4
> ...
> 
> There are 100 lines, each with two data points.  I need to read in the 50
> files, and plot three lines
> 
> The first line is the mean of the send column with whiskers indicating
> standard deviation  (Each file represents one data point)
> 
> The second line is the mean of the receive column, as above.
> 
> the final plot is the mean of the two summed, with whiskers as above.
> 
> There will be 50 data points on the final graph, one for each file.
> 
> I've done this sort of a thing before, but I really can't figure out how to
> handle the different Columns.
> 
> If I use read.table:
> 
> x1 <- read.table("updateToSink1010.log")
> 
> then x1 becomes a matrix, with two columns and 101 rows.  -- including Send,
> Receive.
> 
> Anyways, I'd appreciate a push in some direction - hopefully the right one
> :).
> 
-- 
Matthew S. Shotwell
Graduate Student
Division of Biostatistics and Epidemiology
Medical University of South Carolina
http://biostatmatt.com



More information about the R-help mailing list