Re: Plotting categorical data

Gordon Haverland
 

On Tue, 4 Dec 2018 18:18:24 -0700
"Jared " <@jared> wrote:
You have R installed don't you? That can produce your charts and save
to SVG.
Still working at things.

I wrote my data file as a tab separated text file.

I managed to get R to
rd <- read.table("file.txt", header=TRUE)
which worked.

About half of my efforts to plot are errors. I found it easier to
attach( rd )
Apparently I need to remember to detach( rd ) when I am done (and
before I exit R).

plotting the rank of referees was
plot( Rank ~ Week, xlab="GameDay", ylab="Rank" )
but, that uses the same symbol for all referees. So it is a bit better
to
plot( Rank ~ Week, xlab="GameDay", ylab="Rank" pch=c( Referee ) )
pch is "plot character"? and c is a function to "coerce" data types.
So, the first referee in the vector gets character 1, the second gets
character 2, and so on (I believe).

This is slow, but I guess that is learning curves for you. :-)

To get a good I believe I use the svg function to attach to a file,
plot the data, and then unattach the svg "device".

svg( "file.svg" )
plot( ... )
dev.off()

--

Gord

Join elug@groups.io to automatically receive all group messages.